|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.gui.formatitems.FontItem
A FontItem encapsulates the font format data and provides methods for accessing and changing them.
Changing a FontFormat without creating and pooling it is very often needed within font editors, where a typical user want to try out different fonts before he makes a decision.
| Constructor Summary | |
FontItem(FontFormat ff)
Constructor which creates a FontItem from a given FontFormat. |
|
FontItem(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
Constructor which takes initial values for each FontItem data field. |
|
| Method Summary | |
int |
getColor()
Returns the current FontItem color |
java.lang.String |
getDescription()
Returns the canonical description used to create a format. |
java.lang.String |
getFamily()
Returns the current font family of the FontItem |
Format |
getFormat()
Returns a new format. |
java.lang.Object[] |
getFormatData()
Returns all format parameters |
int |
getSize()
Returns the currently used font size. |
int |
getWeight()
Returns the currently used font weight. |
boolean |
isItalic()
Checks if FontItem is in italic state. |
boolean |
isStrikethrough()
Checks if the current FontItem is strikethrough. |
boolean |
isUnderline()
Checks if this FontItem is underlined. |
void |
setColor(int color)
Sets the current FontItem color |
void |
setFamily(java.lang.String family)
Changes the currently used font family. |
void |
setItalic(boolean italic)
Sets the italic field of this FontItem. |
void |
setSize(int size)
Sets the currently used font size. |
void |
setStrikethrough(boolean strikethrough)
Sets the strikethrough field of this FontItem. |
void |
setUnderline(boolean underline)
Sets the underlined field of this FontItem. |
void |
setWeight(int weight)
Changes the font weight of this FontItem. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FontItem(FontFormat ff)
ff - a FontFormat instance
public FontItem(int size,
int weight,
java.lang.String family,
int color,
boolean italic,
boolean underline,
boolean strikethrough)
size - initial font sizeweight - initial font weightfamily - initial font familycolor - initial font coloritalic - set to true if initial font is italic, false otherwiseunderline - set to true if initial font is underlined, false otherwisestrikethrough - set to true if initial font is strikethrough, false otherwise| Method Detail |
public Format getFormat()
throws StaticException
FormatItem
getFormat in interface FormatItemStaticException - if something goes wrong during format creationpublic java.lang.String getDescription()
FormatItem
getDescription in interface FormatItempublic java.lang.Object[] getFormatData()
FormatItem
getFormatData in interface FormatItempublic final int getColor()
public final void setColor(int color)
color - new color in Tensegrity formatpublic final java.lang.String getFamily()
public final void setFamily(java.lang.String family)
family - the font family namepublic final boolean isItalic()
public final void setItalic(boolean italic)
italic - true to indicate that the FontItem is italic, false otherwisepublic final int getSize()
public final void setSize(int size)
size - the new font sizepublic final boolean isStrikethrough()
public final void setStrikethrough(boolean strikethrough)
strikethrough - true to indicate that this FontItem is strikethrough,
false otherwisepublic final boolean isUnderline()
public final void setUnderline(boolean underline)
underline - true to indicate that this FontItem is underlined,
false otherwisepublic final int getWeight()
public final void setWeight(int weight)
weight - the new font weight
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||