|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.princeton.swing.text.HighlightStyle
HighlightStyle encapsulates the stylistic variations which different highlights in a THighlightedTextArea may take. This class is immutable.
| Field Summary | |
static HighlightStyle |
DEFAULT_STYLE
The plain black style. |
static char[] |
HEX_DIGITS
An array to convert an integer between 0 and 16 to a hexidecimal digit. |
| Constructor Summary | |
HighlightStyle(Color color,
boolean bold,
boolean italic)
Instantiates a new HighlightStyle. |
|
| Method Summary | |
boolean |
equals(Object obj)
Returns true if two HighlightStyles are identical. |
Color |
getColor()
Returns the color which the highlighted text should take. |
int |
getStyleMask()
Returns the style mask which can be sent straight to the constructor of Font. |
static int |
hexDigitToInt(char c)
Returns the hexidecimal value of a character. |
boolean |
isBold()
Returns wheter or not the highlighted text should be bold. |
static boolean |
isHexDigit(char c)
Returns whether or not a character is a hexidecimal digit. |
boolean |
isItalic()
Returns wheter or not the highlighted text should be italicized. |
static HighlightStyle |
parseStyle(String string)
Decodes the string produced by toString() back into a HighlightStyle. |
String |
toString()
Encodes the HighlightStyle in a format that can be read by parseStyle(). |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final char[] HEX_DIGITS
public static final HighlightStyle DEFAULT_STYLE
| Constructor Detail |
public HighlightStyle(Color color,
boolean bold,
boolean italic)
| Method Detail |
public Color getColor()
public boolean isBold()
public boolean isItalic()
public int getStyleMask()
public boolean equals(Object obj)
equals in class Objectobj - The object to compare this HighlightStyle with.
public String toString()
toString in class Objectpublic static HighlightStyle parseStyle(String string)
string - The string to parse. A null value will result in a NullPointerException.
public static boolean isHexDigit(char c)
c - The character to test.
public static int hexDigitToInt(char c)
c - The character to convert. If this character is not a hex digit, an
IllegalArgumentException will be thrown.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||