|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--hamsam.api.TextComponent
A text component of a message.
A text component contains a sequence of characters that represent a message. This sequence, together with the font and color information, determines what to display to the user.
This class defines various methods to set and retrieve the sequence of characters, as well as the font and color information.
Constructor Summary | |
TextComponent()
Construct a new text component that represents an empty character sequence. |
|
TextComponent(java.lang.String str)
Construct a new text component and initialize it with the given character sequence. |
|
TextComponent(java.lang.String str,
java.awt.Color color)
Construct a new text component and initialize it with a given character sequence and color information. |
|
TextComponent(java.lang.String str,
java.awt.Font font)
Construct a new text component and initialize it with a given character sequence and font information. |
|
TextComponent(java.lang.String str,
java.awt.Font font,
java.awt.Color color)
Construct a new text component and initialize it with a given character sequence, font, and color information. |
Method Summary | |
void |
append(char[] str)
Appends the sequence of characters to this text component. |
void |
append(java.lang.String str)
Appends the string to this text component. |
java.awt.Color |
getColor()
Returns the color that is used with this text component. |
java.awt.Font |
getFont()
Returns the font that is used with this text component. |
char[] |
getSequence()
Returns the sequence of characters corresponding to this text component. |
void |
setColor(java.awt.Color color)
Specify the color to be used with this text component. |
void |
setFont(java.awt.Font font)
Specify the font to be used with this text component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TextComponent()
TextComponent(null, null, null)
.
public TextComponent(java.lang.String str)
TextComponent(str, null, null)
.
str
- sequence of characters representing this text component.public TextComponent(java.lang.String str, java.awt.Color color)
TextComponent(str, null, color)
.
str
- sequence of characters representing this text component.color
- the color of the text represented by this component.public TextComponent(java.lang.String str, java.awt.Font font)
TextComponent(str, font, null)
.
str
- sequence of characters representing this text component.font
- the font of the text represented by this component.public TextComponent(java.lang.String str, java.awt.Font font, java.awt.Color color)
str
- sequence of characters representing this text component.font
- the font of the text represented by this component.color
- the color of the text represented by this component.Method Detail |
public void append(java.lang.String str)
str
- the string to be appended.public void append(char[] str)
str
- the characters to be appended.public char[] getSequence()
public void setFont(java.awt.Font font)
font
- the font to be used.public java.awt.Font getFont()
public void setColor(java.awt.Color color)
color
- the color to be used.public java.awt.Color getColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |