Package com.jfcbuilder.types
Class XYTextAnnotationElements
java.lang.Object
com.jfcbuilder.types.XYTextAnnotationElements
Helper class for storing and accessing properties common to different kinds of XYAnnotation builders. Intended for
use in composition-type implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
angle()
Gets the angular orientation of the annotation in degrees.void
angle
(double degrees) Sets the angular orientation of the annotation in degrees.void
Checks to see if all preconditions for building the annotation are satisfied and throws an exception if not.color()
Gets the color of the annotationvoid
Sets the annotation's color.Helper method to build the left/right padded text to be displayed.text()
Gets the annotation text.void
Sets the annotation text.void
textAlign
(org.jfree.chart.ui.TextAnchor alignment) Sets the annotation's text alignment relative to the anchored XY coordinate.org.jfree.chart.ui.TextAnchor
Gets the annotation's text alignment relative to the anchored XY coordinate.int
Gets the number of padding spaces to left side of the text.void
textPaddingLeft
(int n) Sets the number of padding spaces to left side of the text.int
Gets the number of padding spaces to right side of the text.void
textPaddingRight
(int n) Sets the number of padding spaces to right side of the text.double
x()
Gets the x-coordinate of the annotation.void
x
(double x) Sets the x-coordinate of the annotation.double
y()
Gets the y-coordinate of the annotation.void
y
(double y) Sets the y-coordinate of the annotation.
-
Constructor Details
-
XYTextAnnotationElements
public XYTextAnnotationElements()Constructor.
-
-
Method Details
-
x
public void x(double x) Sets the x-coordinate of the annotation.- Parameters:
x
- The x-coordinate
-
x
public double x()Gets the x-coordinate of the annotation.- Returns:
- The x-coordinate
-
y
public void y(double y) Sets the y-coordinate of the annotation.- Parameters:
y
- The y-coordinate
-
y
public double y()Gets the y-coordinate of the annotation.- Returns:
- The y-coordinate
-
angle
public void angle(double degrees) Sets the angular orientation of the annotation in degrees.- Parameters:
degrees
- The annotation orientation angle
-
angle
public double angle()Gets the angular orientation of the annotation in degrees.- Returns:
- The annotation orientation angle
-
text
Sets the annotation text.- Parameters:
text
- The text to be set
-
text
Gets the annotation text.- Returns:
- The annotation's text
-
textPaddingLeft
public void textPaddingLeft(int n) Sets the number of padding spaces to left side of the text. Use this to offset the text a desired distance from the anchored XY coordinate.- Parameters:
n
- Number of space characters to insert at left of text
-
textPaddingLeft
public int textPaddingLeft()Gets the number of padding spaces to left side of the text.- Returns:
- The number of left side padding spaces
-
textPaddingRight
public void textPaddingRight(int n) Sets the number of padding spaces to right side of the text. Use this to offset the text a desired distance from the anchored XY coordinate.- Parameters:
n
- Number of space characters to insert at right of text
-
textPaddingRight
public int textPaddingRight()Gets the number of padding spaces to right side of the text.- Returns:
- The number of right side padding spaces
-
textAlign
public void textAlign(org.jfree.chart.ui.TextAnchor alignment) Sets the annotation's text alignment relative to the anchored XY coordinate.- Parameters:
alignment
- The annotation's text alignment
-
textAlignment
public org.jfree.chart.ui.TextAnchor textAlignment()Gets the annotation's text alignment relative to the anchored XY coordinate.- Returns:
- The annotation's text alignment
-
color
Sets the annotation's color.- Parameters:
color
- The color to be set
-
color
Gets the color of the annotation- Returns:
- The annotation's color
-
checkBuildPreconditions
Checks to see if all preconditions for building the annotation are satisfied and throws an exception if not.- Throws:
IllegalStateException
- If x or y have not been configured.
-
paddedText
Helper method to build the left/right padded text to be displayed.- Returns:
- The text including the configured left and right padding spaces
-