Class XYTimeSeriesElements

java.lang.Object
com.jfcbuilder.types.XYTimeSeriesElements

public class XYTimeSeriesElements extends Object
Helper class for storing and accessing properties common to different kinds of XY TimeSeries builders. Intended for use in composition-type implementations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Color
    A default color to use when rendering if none is specified.
    static final Stroke
    A default line style to use when rendering if none is specified.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks to see if all preconditions for building the series are satisfied and throws an exception if not.
    Gets the color that will be used to render the series.
    void
    color(Color color)
    Sets the desired color to be used when rendering the series.
    double[]
    Gets the data that will be used for generating the series.
    void
    data(double[] data)
    Sets the data that will be used for generating the series.
    Gets the zero-based index range to be used when generating the series.
    void
    Sets the zero-based index range to be used when generating the series.
    Gets the series name.
    void
    name(String name)
    Sets the series name.
    boolean
    Gets whether to render time gaps.
    void
    showTimeGaps(boolean showTimeGaps)
    Sets whether or not time gaps should be rendered.
    Gets the line style to be used when rendering the series.
    void
    style(Stroke style)
    Sets the desired line style to be used when rendering the series.
    long[]
    Gets the time data that will be used for generating the series.
    void
    timeData(long[] timeData)
    Sets the time data that will be used for generating the series.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_STYLE

      public static final Stroke DEFAULT_STYLE
      A default line style to use when rendering if none is specified.
    • DEFAULT_COLOR

      public static final Color DEFAULT_COLOR
      A default color to use when rendering if none is specified.
  • Constructor Details

    • XYTimeSeriesElements

      public XYTimeSeriesElements()
      Constructor.
  • Method Details

    • name

      public String name()
      Gets the series name.
      Returns:
      The series name
    • name

      public void name(String name)
      Sets the series name.
      Parameters:
      name - The name to be set
    • indexRange

      public ZeroBasedIndexRange indexRange()
      Gets the zero-based index range to be used when generating the series.
      Returns:
      The zero-based index range that will be used
    • indexRange

      public void indexRange(ZeroBasedIndexRange indexRange)
      Sets the zero-based index range to be used when generating the series.
      Parameters:
      indexRange - The zero-based index range to be set
    • data

      public double[] data()
      Gets the data that will be used for generating the series.
      Returns:
      The series data
    • data

      public void data(double[] data)
      Sets the data that will be used for generating the series.
      Parameters:
      data - The data to set
    • timeData

      public long[] timeData()
      Gets the time data that will be used for generating the series.
      Returns:
      The time data that will be used
    • timeData

      public void timeData(long[] timeData)
      Sets the time data that will be used for generating the series. Values should be in ascending time and represent milliseconds since the epoch start.
      Parameters:
      timeData - The time data to be used
    • showTimeGaps

      public boolean showTimeGaps()
      Gets whether to render time gaps.
      Returns:
      True if time gaps should be rendered, false otherwise
    • showTimeGaps

      public void showTimeGaps(boolean showTimeGaps)
      Sets whether or not time gaps should be rendered.
      Parameters:
      showTimeGaps - True to render time gaps, false otherwise
    • color

      public Color color()
      Gets the color that will be used to render the series.
      Returns:
      The series rendering color
    • color

      public void color(Color color)
      Sets the desired color to be used when rendering the series. If set to null the default color will be used.
      Parameters:
      color - The color to be set
    • style

      public Stroke style()
      Gets the line style to be used when rendering the series.
      Returns:
      The series rendering line style
    • style

      public void style(Stroke style)
      Sets the desired line style to be used when rendering the series. If set to null the default style will be used.
      Parameters:
      style - The style to be set
    • checkBuildPreconditions

      public void checkBuildPreconditions() throws IllegalStateException
      Checks to see if all preconditions for building the series are satisfied and throws an exception if not.
      Throws:
      IllegalStateException - If values data or timeData are null or empty, if values data and timeData lengths aren't equal, or if indexRange defines a range outside of the available data.