|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--com.yospace.yae.yogi.YogiComponent
|
+--com.yospace.yae.yogi.YogiImageComponent
|
+--com.yospace.yae.yogi.YogiLabel
|
+--com.yospace.yae.yogi.YogiTextArea
YogiTextAreas are bascially YogiLabels that are rendered onto separate lines in the paint method. Be aware when overriding any methods that line breaks are cached and only updated when the text or the shape of the text area is changed. Methods such as setText are overridden here to make sure that a change in text, size, or font forces a recalculation of the line breaks.
| Field Summary | |
static int |
BREAKING_STYLE_CHARACTER
Word breaking constant used for setting the type of word breaking used within the YogiTextArea to allow words to break anywhere, i.e. |
static int |
BREAKING_STYLE_HYPHEN
Word breaking constant used for setting the type of word breaking used within the YogiTextArea to allow breaking a word across a line with the break being joined with a hyphen. |
static int |
BREAKING_STYLE_WORD
Word breaking constant used for setting the type of word breaking used within the YogiTextArea to allow breaking only at word boundaries. |
static int |
PROPERTY_AUTO_RESIZE
Constant for the automatic resize property |
static int |
PROPERTY_BREAKING_STYLE
Constant for the (word)breaking style property |
| Fields inherited from class com.yospace.yae.yogi.YogiLabel |
PROPERTY_TEXT, PROPERTY_TEXT_PLACEMENT |
| Fields inherited from class com.yospace.yae.yogi.YogiImageComponent |
PROPERTY_IMAGE |
| Constructor Summary | |
YogiTextArea()
Default constructor simply calls the superclass constructor. |
|
YogiTextArea(java.lang.String text,
Image image)
Constructs a new text area and sets the text to be the given String and the default image to be the given Image. |
|
| Method Summary | |
int |
getBreakingStyle()
This method returns the current breaking style being used for the TextArea. |
java.lang.String |
getLine(int lineNumber)
Returns the text that lies on the given line number. |
int |
getNumberOfLines()
Returns the number of lines of text that the TextArea currently has. |
boolean |
isAutoResizable()
This method allows the TextArea to be queried as to whether it will resize to fit the content. |
void |
setAutoResizable(boolean resize)
This method allows the auto resizing of the TextArea to be switched on/off. |
void |
setBounds(int x,
int y,
int width,
int height)
Overridden in order to make sure that breaks are recalculated after a change in the bounds of the text area |
void |
setBreakingStyle(int style)
This method allows the breaking style for the TextArea to be set programmatically. |
void |
setFont(Font font)
Overridden in order to make sure that breaks are recalculated after a change in the font of the text area |
void |
setSize(int width,
int height)
Overridden in order to make sure that breaks are recalculated after a change in the size of the text area |
void |
setText(java.lang.String text)
Sets the text in the text area. |
| Methods inherited from class com.yospace.yae.yogi.YogiLabel |
getCellRendererComponent, getText, isTextOnRight, setTextImpl, setTextOnRight |
| Methods inherited from class com.yospace.yae.yogi.YogiImageComponent |
getImage, getImageName, setImage, setImage |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PROPERTY_BREAKING_STYLE
public static final int PROPERTY_AUTO_RESIZE
public static final int BREAKING_STYLE_CHARACTER
setBreakingStyle(int)public static final int BREAKING_STYLE_WORD
setBreakingStyle(int)public static final int BREAKING_STYLE_HYPHEN
setBreakingStyle(int)| Constructor Detail |
public YogiTextArea()
public YogiTextArea(java.lang.String text,
Image image)
text - the default text for this text area.image - the default image for this text area.| Method Detail |
public void setBreakingStyle(int style)
style - the style, must be one of BREAKING_STYLE_CHARACTER,
BREAKING_STYLE_WORD,BREAKING_STYLE_HYPHEN.public int getBreakingStyle()
BREAKING_STYLE_CHARACTER,
BREAKING_STYLE_WORD,BREAKING_STYLE_HYPHEN.public void setAutoResizable(boolean resize)
resize - true allows automatic resizing to fit the current content, false will lead to truncation
if the content is too large for the TextArea.public boolean isAutoResizable()
public void setText(java.lang.String text)
setText in class YogiLabeltext - the text to fill the text area with.
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class YogiComponentx - the desired x value.y - the desired y value.width - the desired width, or -1 to restore to UI defaults.height - the desired height, or -1 to restore to UI defaults.
public void setSize(int width,
int height)
setSize in class YogiComponentwidth - the new width in pixels, or -1 to restore to UI defaults.height - the new height in pixels, or -1 to restore to UI defaults.public void setFont(Font font)
setFont in class YogiComponentfont - the new font to be used, or null to restore to the UI delegate's default font.public int getNumberOfLines()
public java.lang.String getLine(int lineNumber)
lineNumber - the line number that is requested.
|
Copyright 2002 Yospace Holdings Ltd. All Rights Reserved. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||