Chart FX for Java 6.5

SoftwareFX.ChartFX.Annotation
Class AnnotationText

java.lang.Object
  extended by SoftwareFX.ChartFX.Annotation.AnnotationObject
      extended by SoftwareFX.ChartFX.Annotation.AnnotationText
Direct Known Subclasses:
AnnotationBalloon

public final class AnnotationText
extends AnnotationObject

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

AnnotationText

public AnnotationText()

AnnotationText

public AnnotationText(java.lang.String text)
Method Detail

getAlign

public int getAlign()

Gets the Align. For more detail see setAlign(int).


getFont

public java.awt.Font getFont()

Gets the Font. For more detail see setFont(java.awt.Font).


getLineAlignment

public int getLineAlignment()

Gets the LineAlignment. For more detail see setLineAlignment(int).


getOrientation

public int getOrientation()

Gets the Orientation. For more detail see setOrientation(int).


getText

public java.lang.String getText()

Gets the Text. For more detail see setText(java.lang.String).


getTextColor

public java.awt.Color getTextColor()

Gets the TextColor. For more detail see setTextColor(java.awt.Color).


isWordWrap

public boolean isWordWrap()

Gets the WordWrap. For more detail see setWordWrap(boolean).


setAlign

public void setAlign(int value)

Allows you to set the alignment for the selected annotation text object.

Values:
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.
ValueDescription
StringAlignment.STRING_ALIGNMENT_NEARSpecifies 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_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
StringAlignment.STRING_ALIGNMENT_FARSpecifies that alignment is to the far extent (right side) of the formatting rectangle.

Remarks:
  • 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.

  • See Also:
    setLineAlignment(int), setText(java.lang.String), setTextColor(java.awt.Color), setOrientation(int), setFont(java.awt.Font), sizeToFit(), AnnotationObject

    setFont

    public void setFont(java.awt.Font value)

    Allows you to change the font attributes for an annotation object.

    Remarks:
  • 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.

  • See Also:
    setText(java.lang.String), setTextColor(java.awt.Color)

    setLineAlignment

    public void setLineAlignment(int value)

    Sets the vertical alignment for the lines of an annotation text object.

    Values:
    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.
    ValueDescription
    StringAlignment.STRING_ALIGNMENT_NEARSpecifies 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_CENTERSpecifies that alignment is centered between origin and extent (width) of the formatting rectangle.
    StringAlignment.STRING_ALIGNMENT_FARSpecifies that alignment is to the far extent (right side) of the formatting rectangle.

    Remarks:
  • 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.

  • See Also:
    setAlign(int), setText(java.lang.String), setTextColor(java.awt.Color), setOrientation(int), setFont(java.awt.Font), sizeToFit(), AnnotationObject

    setOrientation

    public void setOrientation(int value)

    Used to set the text orientation for a annotation text object.

    Remarks:
  • 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.

  • See Also:
    AnnotationObject.rotate(boolean)

    setText

    public void setText(java.lang.String value)

    Used to set the text for an annotation text object.

    Remarks:
  • 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.

  • See Also:
    setTextColor(java.awt.Color), setAlign(int), setLineAlignment(int), setOrientation(int), setFont(java.awt.Font), AnnotationObject

    setTextColor

    public void setTextColor(java.awt.Color value)

    Sets the color of the text for an annotation object.

    Remarks:
  • 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.

  • See Also:
    setText(java.lang.String), setAlign(int), setLineAlignment(int), setFont(java.awt.Font), setOrientation(int), AnnotationObject

    setWordWrap

    public void setWordWrap(boolean value)

    Gets or sets a value indicating whether the text of an annotation text object will be word wrapped.

    Remarks:
  • The WordWrap property will allow developers to select whether text of an AnnotationText object will wrap or be displayed as one line.

  • See Also:
    AnnotationX

    sizeToFit

    public void sizeToFit()

    Instructs Chart FX to resize a selected annotation text object to fit the configured text string.

    Remarks:
  • 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.

  • See Also:
    AnnotationObject.setHeight(int), AnnotationObject.setWidth(int), setText(java.lang.String), setTextColor(java.awt.Color), AnnotationObject

    http://www.softwarefx.com

    2007 Software FX, Inc. All Rights Reserved. Chart FX is a registered trademark of Software FX, Inc
    All other names are trademarks or registered trademarks of their respective owners.