|
Chart FX for Java 6.5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object SoftwareFX.ChartFX.Annotation.AnnotationObject SoftwareFX.ChartFX.Annotation.AnnotationText
public final class AnnotationText
Provides access to the AnnotationText object.
The AnnotationText class allows you to add annotation text objects to your charting applications. This object is very similar to the AnnotationBalloon class, however the balloon objects have a tip for referencing a specific point.
Below is an example of an annotation text object:
SoftwareFX.ChartFX.Annotation.AnnotationX annot = new SoftwareFX.ChartFX.Annotation.AnnotationX();
chart1.getExtensions().add(annot);
SoftwareFX.ChartFX.Annotation.AnnotationText text = new SoftwareFX.ChartFX.Annotation.AnnotationText();
annot.getList().add(text);
text.setText("This is an Annotation Text");
text.setTextColor(java.awt.Color.WHITE);
text.attach(3,50);
Constructor Summary | |
---|---|
AnnotationText()
|
|
AnnotationText(java.lang.String text)
|
Method Summary | |
---|---|
int |
getAlign()
Gets the Align. |
java.awt.Font |
getFont()
Gets the Font. |
int |
getLineAlignment()
Gets the LineAlignment. |
int |
getOrientation()
Gets the Orientation. |
java.lang.String |
getText()
Gets the Text. |
java.awt.Color |
getTextColor()
Gets the TextColor. |
boolean |
isWordWrap()
Gets the WordWrap. |
void |
setAlign(int value)
Allows you to set the alignment for the selected annotation text object. |
void |
setFont(java.awt.Font value)
Allows you to change the font attributes for an annotation object. |
void |
setLineAlignment(int value)
Sets the vertical alignment for the lines of an annotation text object. |
void |
setOrientation(int value)
Used to set the text orientation for a annotation text object. |
void |
setText(java.lang.String value)
Used to set the text for an annotation text object. |
void |
setTextColor(java.awt.Color value)
Sets the color of the text for an annotation object. |
void |
setWordWrap(boolean value)
Gets or sets a value indicating whether the text of an annotation text object will be word wrapped. |
void |
sizeToFit()
Instructs Chart FX to resize a selected annotation text object to fit the configured text string. |
Methods inherited from class SoftwareFX.ChartFX.Annotation.AnnotationObject |
---|
attach, attach, attach, detach, flip, getAnchor, getBorder, getColor, getHeight, getLeft, getLink, getObjectBounds, getPattern, getTag, getTop, getURL, getURLTarget, getWidth, isAllowModify, isAllowMove, isDrawingArea, isPaintBefore, isVisible, refresh, rotate, setAllowModify, setAllowMove, setAnchor, setBorder, setColor, setDrawingArea, setHeight, setLeft, setObjectBounds, setPaintBefore, setPattern, setTag, setTop, setURL, setURLTarget, setVisible, setWidth |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AnnotationText()
public AnnotationText(java.lang.String text)
Method Detail |
---|
public int getAlign()
Gets the Align. For more detail see setAlign(int)
.
public java.awt.Font getFont()
Gets the Font. For more detail see setFont(java.awt.Font)
.
public int getLineAlignment()
Gets the LineAlignment. For more detail see setLineAlignment(int)
.
public int getOrientation()
Gets the Orientation. For more detail see setOrientation(int)
.
public java.lang.String getText()
Gets the Text. For more detail see setText(java.lang.String)
.
public java.awt.Color getTextColor()
Gets the TextColor. For more detail see setTextColor(java.awt.Color)
.
public boolean isWordWrap()
Gets the WordWrap. For more detail see setWordWrap(boolean)
.
public void setAlign(int value)
Allows you to set the alignment for the selected annotation text object.
StringAlignment :
The StringAlignment type specifies how a string is aligned in reference to the bounding rectangle. A bounding rectangle is used to define the area in which the text displays. Value | Description |
---|---|
StringAlignment.STRING_ALIGNMENT_NEAR | Specifies that alignment is towards the origin of the bounding rectangle. May be used for alignment of characters along the line or for alignment of lines within the rectangle. For a right to left bounding rectangle, the origin is at the upper right. |
StringAlignment.STRING_ALIGNMENT_CENTER | Specifies that alignment is centered between origin and extent (width) of the formatting rectangle. |
StringAlignment.STRING_ALIGNMENT_FAR | Specifies that alignment is to the far extent (right side) of the formatting rectangle. |
You can align the text in the text object using this property. You can adjust the alignment for the entire text line using the setLineAlignment(int)
property.
The text for the object can be set using the setText(java.lang.String)
property. You can also set the color using the setTextColor(java.awt.Color)
property.
The text orientation may be controlled by utilizing the setOrientation(int)
property.
To set the font associated with the text object, please refer to the setFont(java.awt.Font)
property.
The sizeToFit()
method instructs Chart FX to calculate the best fit for the selected Text Object.
setLineAlignment(int)
,
setText(java.lang.String)
,
setTextColor(java.awt.Color)
,
setOrientation(int)
,
setFont(java.awt.Font)
,
sizeToFit()
,
AnnotationObject
public void setFont(java.awt.Font value)
Allows you to change the font attributes for an annotation object.
When setting a font in Chart FX, you must create a new font object with the desired attributes and assign that object to the desired chart element every time you want to change the font.
You can set the text for the text object using the setText(java.lang.String)
property. You can modify the text color using the setTextColor(java.awt.Color)
property.
For more information regarding the Font type, please refer to the Java API Documentation.
setText(java.lang.String)
,
setTextColor(java.awt.Color)
public void setLineAlignment(int value)
Sets the vertical alignment for the lines of an annotation text object.
StringAlignment :
The StringAlignment type specifies how a string is aligned in reference to the bounding rectangle. A bounding rectangle is used to define the area in which the text displays. Value | Description |
---|---|
StringAlignment.STRING_ALIGNMENT_NEAR | Specifies that alignment is towards the origin of the bounding rectangle. May be used for alignment of characters along the line or for alignment of lines within the rectangle. For a right to left bounding rectangle, the origin is at the upper right. |
StringAlignment.STRING_ALIGNMENT_CENTER | Specifies that alignment is centered between origin and extent (width) of the formatting rectangle. |
StringAlignment.STRING_ALIGNMENT_FAR | Specifies that alignment is to the far extent (right side) of the formatting rectangle. |
The horizontal text alignment may be modified using the setAlign(int)
property.
You can set the text for the text object using the setText(java.lang.String)
property. You can modify the text color using the setTextColor(java.awt.Color)
property.
The sizeToFit()
method instructs Chart FX to calculate the best fit for the selected Text Object.
The text orientation may be controlled by utilizing the setOrientation(int)
property.
To set the font associated with the text object, please refer to the setFont(java.awt.Font)
property.
setAlign(int)
,
setText(java.lang.String)
,
setTextColor(java.awt.Color)
,
setOrientation(int)
,
setFont(java.awt.Font)
,
sizeToFit()
,
AnnotationObject
public void setOrientation(int value)
Used to set the text orientation for a annotation text object.
The text orientation and settings for this property are as follows:
0 = Sets the text orientation Left to Right
1 = Sets the text orientation Bottom to Top
2 = Sets the text orientation Right To Left
3 = Sets the text orientation Top to Bottom
When you AnnotationObject.rotate(boolean)
a Text Object this setting will be changed accordingly to the rotation angle selected for the Text object.
AnnotationObject.rotate(boolean)
public void setText(java.lang.String value)
Used to set the text for an annotation text object.
The setTextColor(java.awt.Color)
property allows you to change the text color of the annotation text object.
The horizontal text alignment may be modified using the setAlign(int)
property. You can adjust the alignment for the entire text line using the setLineAlignment(int)
property.
The text orientation may be controlled by utilizing the setOrientation(int)
property.
To set the font associated with the text object, please refer to the setFont(java.awt.Font)
property.
setTextColor(java.awt.Color)
,
setAlign(int)
,
setLineAlignment(int)
,
setOrientation(int)
,
setFont(java.awt.Font)
,
AnnotationObject
public void setTextColor(java.awt.Color value)
Sets the color of the text for an annotation object.
You can set the text for an annotation text object using the setText(java.lang.String)
property.
The horizontal text alignment may be modified using the setAlign(int)
property. You can adjust the alignment for the entire text line using the setLineAlignment(int)
property.
To set the font associated with the text object, please refer to the setFont(java.awt.Font)
property.
The text orientation may be controlled by utilizing the setOrientation(int)
property.
For more information regarding the Color type, please refer to the Java API Documentation.
setText(java.lang.String)
,
setAlign(int)
,
setLineAlignment(int)
,
setFont(java.awt.Font)
,
setOrientation(int)
,
AnnotationObject
public void setWordWrap(boolean value)
Gets or sets a value indicating whether the text of an annotation text object will be word wrapped.
The WordWrap property will allow developers to select whether text of an AnnotationText object will wrap or be displayed as one line.
AnnotationX
public void sizeToFit()
Instructs Chart FX to resize a selected annotation text object to fit the configured text string.
Calling this method will instruct Chart FX to recalculate the configured AnnotationObject.setHeight(int)
and AnnotationObject.setWidth(int)
.
You can set the text for the annotation text object using the setText(java.lang.String)
property. The text color may be modified using the setTextColor(java.awt.Color)
property.
AnnotationObject.setHeight(int)
,
AnnotationObject.setWidth(int)
,
setText(java.lang.String)
,
setTextColor(java.awt.Color)
,
AnnotationObject
|
http://www.softwarefx.com | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |