|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.tools.cm.Style
public class Style
Text formatting style information.
A style object records the following information about line and word text formatting style attributes:
The NO_CHANGE value for these three attributes is used when adding styles. See the description of the add method for details.
Field Summary | |
---|---|
static int |
BOLD
Bold style mask. |
static int |
CENTER
Center alignment line style. |
static int |
EXTENDED
Extended style mask. |
static int |
ITALIC
Italic style mask. |
static int |
LEFT
Left alignment line style. |
static int |
MONOSPACED
Monospaced style mask. |
static int |
NO_CHANGE
No change in style. |
static int |
OVERLINE
Overline style mask. |
static int |
PLAIN
Plain style mask. |
static int |
RIGHT
Right alignment line style. |
static java.lang.String[] |
STYLE_NAMES
Array of WordHoard style names, in the order of their style mask bit postions. |
static int |
SUBSCRIPT
Subscript style mask. |
static int |
SUPERSCRIPT
Superscript style mask. |
static int |
UNDERLINE
Underline style mask. |
Constructor Summary | |
---|---|
Style(org.w3c.dom.Element el)
Creates a style from a parameters XML element. |
|
Style(int lineStyle,
int indent,
int wordStyles)
Creates a style. |
Method Summary | |
---|---|
void |
add(Style style)
Adds a style to this style. |
java.lang.Object |
clone()
Clones the style. |
int |
getIndent()
Gets the indentation. |
int |
getLineStyle()
Gets the line style. |
int |
getWordStyles()
Gets the word styles. |
void |
setIndent(int indent)
Sets the indentation. |
void |
setLineStyle(int lineStyle)
Sets the line style. |
void |
setWordStyles(int wordStyles)
Sets the word styles. |
boolean |
styleChange()
Returns true if the style changes. |
java.lang.String |
toString()
Converts the style to a string. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NO_CHANGE
This constant is used with all kinds of formatting styles - line styles, indentation styles, and word styles.
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int BOLD
public static final int ITALIC
public static final int EXTENDED
public static final int UNDERLINE
public static final int OVERLINE
public static final int SUPERSCRIPT
public static final int SUBSCRIPT
public static final int MONOSPACED
public static final int PLAIN
public static final java.lang.String[] STYLE_NAMES
Constructor Detail |
---|
public Style(int lineStyle, int indent, int wordStyles)
lineStyle
- Line style.indent
- Indentation.wordStyles
- Word styles. public Style(org.w3c.dom.Element el)
el
- Element. Method Detail |
---|
public int getLineStyle()
public void setLineStyle(int lineStyle)
lineStyle
- The line style. public int getIndent()
public void setIndent(int indent)
indent
- Indentation. public int getWordStyles()
public void setWordStyles(int wordStyles)
wordStyles
- Word styles. public void add(Style style)
If A and B are two styles, A.add(B) is constructed as follows:
If B.lineStyle == NO_CHANGE, the result line style is A.lineStyle, otherwise it is B.lineStyle.
If B.indent == NO_CHANGE, the result indentation is A.indent, otherwise it is A.indent + B.indent. Notice that the indentation is cumulative.
If B.wordStyles == NO_CHANGE, the result word styles is A.wordStyles. If B.wordStyles == PLAIN, the result word styles is PLAIN. Otherwise it is A.wordStyles | B.wordStyles, the logical OR of the two bit masks. Notice that in the last case, word styles, like indentation, are cumulative.
style
- The style to add. public boolean styleChange()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |