|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectformatter.FontState
public class FontState
This class is meant to keep track of what the HTML tags of an HTML document have altered the state of the text into. In other words, this class makes it trivial to keep track of what the HTML tags have commanded the browser to do. This is useful in this program because it allows for an easy way of keeping track of what to put in new message parts.
| Field Summary | |
|---|---|
static int |
MAX_DEPTH
Maximum number of consecutive calls to set methods
this object can keep track of before overflowing. |
| Constructor Summary | |
|---|---|
FontState()
Creates a new FontState with all the default values in place. |
|
FontState(int defaultSize,
java.lang.String defaultTypeface,
java.awt.Color defaultColor)
Creates a new FontState with the passed two default values. |
|
| Method Summary | |
|---|---|
java.awt.Color |
getBGColor()
Get the current background color. |
java.awt.Color |
getFontColor()
Get the current font color. |
java.lang.String |
getFontFace()
Get the current font face. |
int |
getFontSize()
Get the current font size. |
boolean |
isBold()
Determines if text has been set to bold. |
boolean |
isItalicized()
Determines if text has been set to italized. |
boolean |
isUnderlined()
Determines if text has been set to underlined. |
void |
popBGColor()
Removes the top-most background color from the stack. |
void |
popFont()
Removes the top-most font from the stack. |
void |
pushBGColor(java.awt.Color c)
Puts another background color on the stack. |
void |
pushFont(int s,
java.lang.String f,
java.awt.Color c)
Puts another font on the stack of fonts. |
void |
setBold()
Register that another <b> or
<em> tag has been seen. |
void |
setItalicized()
Register that another <i> tag has been seen. |
void |
setNotBold()
Register that another </b> or
</em>tag has been seen. |
void |
setNotItalicized()
Register that another </i> tag has been seen. |
void |
setNotUnderlined()
Register that another </u> tag has been seen. |
void |
setUnderlined()
Register that another <u> tag has been seen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int MAX_DEPTH
set methods
this object can keep track of before overflowing. Currently 10.
| Constructor Detail |
|---|
public FontState()
FontState with all the default values in place.
public FontState(int defaultSize,
java.lang.String defaultTypeface,
java.awt.Color defaultColor)
FontState with the passed two default values.
defaultSize - The default (starting) size.defaultTypeface - The default (starting) typeface.defaultColor - The default (starting) color.| Method Detail |
|---|
public void setBold()
<b> or
<em> tag has been seen.
public void setNotBold()
</b> or
</em>tag has been seen.
public boolean isBold()
public void setItalicized()
<i> tag has been seen.
public void setNotItalicized()
</i> tag has been seen.
public boolean isItalicized()
public void setUnderlined()
<u> tag has been seen.
public void setNotUnderlined()
</u> tag has been seen.
public boolean isUnderlined()
public void pushFont(int s,
java.lang.String f,
java.awt.Color c)
s - The new font size. -1 means "use last"f - The new font face. null means "use last"c - The new font color. null means "use last"
java.lang.RuntimeException - if too man different font changes have been pushed.public void popFont()
java.lang.RuntimeException - if the stack is empty (there are
no font sizes to pop).public void pushBGColor(java.awt.Color c)
c - The color to add to the stack.
java.lang.RuntimeException - if the stack gets full.public void popBGColor()
java.lang.RuntimeException - if the stack is empty.public int getFontSize()
public java.lang.String getFontFace()
public java.awt.Color getFontColor()
public java.awt.Color getBGColor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||