Class XYTextAnnotationElements

java.lang.Object
com.jfcbuilder.types.XYTextAnnotationElements

public class XYTextAnnotationElements extends Object
Helper class for storing and accessing properties common to different kinds of XYAnnotation builders. Intended for use in composition-type implementations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    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.
    Gets the color of the annotation
    void
    color(Color color)
    Sets the annotation's color.
    Helper method to build the left/right padded text to be displayed.
    Gets the annotation text.
    void
    text(String text)
    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
    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
    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.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void text(String text)
      Sets the annotation text.
      Parameters:
      text - The text to be set
    • text

      public String 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

      public void color(Color color)
      Sets the annotation's color.
      Parameters:
      color - The color to be set
    • color

      public Color color()
      Gets the color of the annotation
      Returns:
      The annotation's color
    • checkBuildPreconditions

      public void checkBuildPreconditions() throws IllegalStateException
      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

      public String paddedText()
      Helper method to build the left/right padded text to be displayed.
      Returns:
      The text including the configured left and right padding spaces