Class XYTimeSeriesPlotBuilderElements

java.lang.Object
com.jfcbuilder.types.XYTimeSeriesPlotBuilderElements

public class XYTimeSeriesPlotBuilderElements extends Object
Helper class for storing and accessing properties common to different kinds of XY plot builders. Intended for use in composition-type implementations.
  • Constructor Details

    • XYTimeSeriesPlotBuilderElements

      public XYTimeSeriesPlotBuilderElements()
      Constructor.
  • Method Details

    • indexRange

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

      public ZeroBasedIndexRange indexRange()
      Gets the zero-based index range to be used with all data series.
      Returns:
      The zero-based index range that will be used
    • xAxis

      public void xAxis(org.jfree.chart.axis.ValueAxis xAxis)
      Sets the x-axis to be used with all data series.
      Parameters:
      xAxis - The x-axis to be set
    • xAxis

      public org.jfree.chart.axis.ValueAxis xAxis()
      Gets the x-axis to be used with all data series.
      Returns:
      The x-axis that will be used
    • timeData

      public void timeData(long[] timeData)
      Sets the time data to be used with all data series. Values should be in ascending order and representing milliseconds since the epoch start.
      Parameters:
      timeData - The time data to be set
    • timeData

      public long[] timeData()
      Gets the time data to be used with all data series.
      Returns:
      The time data array that was configured
    • showTimeGaps

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

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

      public void series(IXYTimeSeriesBuilder<?> series)
      Registers an XY time series builder to be used for building the plot.
      Parameters:
      series - The builder to be registered
    • unmodifiableSeries

      public List<IXYTimeSeriesBuilder<?>> unmodifiableSeries()
      Gets an unmodifiable list of the series builders to be used for building the plot.
      Returns:
      The unmodifiable list of series builders
    • dataset

      public void dataset(IXYTimeSeriesDatasetBuilder<?> dataset)
      Registers an XYDataset builder to be used for building the plot.
      Parameters:
      dataset - The builder to be registered
    • unmodifiableDatasets

      public List<IXYTimeSeriesDatasetBuilder<?>> unmodifiableDatasets()
      Gets an unmodifiable list of the dataset builders to be used for building the plot.
      Returns:
      The unmodifiable list of dataset builders
    • marker

      public void marker(MarkerBuilder marker)
      Registers a fixed marker builder to be used for building the plot.
      Parameters:
      marker - The builder to be registered
    • unmodifiableLines

      public List<MarkerBuilder> unmodifiableLines()
      Gets an unmodifiable list of the marker builders to be used for building the plot.
      Returns:
      The unmodifiable list of marker builders
    • annotation

      public void annotation(IXYAnnotationBuilder<?> annotation)
      Registers an IXYAnnotationBuilder to be used for building the plot.
      Parameters:
      annotation - The builder to be registered
    • unmodifiableAnnotations

      public List<IXYAnnotationBuilder<?>> unmodifiableAnnotations()
      Gets an unmodifiable list of the annotation builders to be used for building the plot.
      Returns:
      The unmodifiable list of annotation builders
    • plotWeight

      public void plotWeight(int weight)
      Sets the layout weight to be used when rendering the plot.
      Parameters:
      weight - The plot's layout weight to be used
    • plotWeight

      public int plotWeight()
      Gets the layout weight to be used when rendering the plot.
      Returns:
      The plot's layout weight
    • yAxisName

      public void yAxisName(String name)
      Sets the y-axis name to be used when building the plot.
      Parameters:
      name - The plot's y-axis name to be set
    • yAxisName

      public String yAxisName()
      Gets the y-axis name to be used when building the plot.
      Returns:
      The plot's y-axis name
    • yAxisRange

      public void yAxisRange(double lower, double upper)
      Sets the main y-axis Range to be used when building the plot.
      Parameters:
      lower - The plot's y-axis lower range bound to use
      upper - The plot's y-axis upper range bound to use
    • yAxisRange

      public org.jfree.data.Range yAxisRange()
      Gets the main y-axis Range to be used when building the plot.
      Returns:
      The plot's y-axis Range
    • yAxisTickSize

      public void yAxisTickSize(double size)
      Sets the main y-axis tick size to be used when building the plot.
      Parameters:
      size - The plot's y-axis tick size to use
    • yAxisTickSize

      public double yAxisTickSize()
      Gets the main y-axis tick size to be used when building the plot.
      Returns:
      The plot's y-axis tick size
    • usingDefaultYAxisTickSize

      public boolean usingDefaultYAxisTickSize()
      Checks if the builder is configured to use the default y-axis tick size.
      Returns:
      True if the default y-axis tick size will be used, false otherwise
    • yTickFormat

      public void yTickFormat(NumberFormat format)
      Sets the main y-axis tick format to be used when building the plot.
      Parameters:
      format - The plot's y-axis tick format to use
    • yAxisTickFormat

      public NumberFormat yAxisTickFormat()
      Gets the main y-axis tick number format to be used when building the plot.
      Returns:
      The plot's y-axis tick format to use
    • backgroundColor

      public void backgroundColor(Paint color)
      Sets the plot background color to use when building the plot.
      Parameters:
      color - The color to set
    • backgroundColor

      public Paint backgroundColor()
      Gets the plot background color to use when building the plot.
      Returns:
      The color
    • axisFontColor

      public void axisFontColor(Paint color)
      Sets the axis font color to use when building the plot.
      Parameters:
      color - The color to set
    • axisFontColor

      public Paint axisFontColor()
      Gets the axis font color to use when building the plot.
      Returns:
      The color
    • axisColor

      public void axisColor(Paint color)
      Sets the axis color to use when building the plot.
      Parameters:
      color - The color to set
    • axisColor

      public Paint axisColor()
      Gets the axis color to use when building the plot.
      Returns:
      The color
    • majorGrid

      public void majorGrid(boolean enabled)
      Toggle displaying major grid lines ON or OFF.
      Parameters:
      enabled - True to set displaying ON, false for OFF
    • majorGrid

      public boolean majorGrid()
      Returns true if displaying major grid lines is set ON or OFF.
      Returns:
      True if ON, false if OFF.
    • majorGridColor

      public void majorGridColor(Paint color)
      Sets the major grid color to use when building the plot.
      Parameters:
      color - The color to set
    • majorGridColor

      public Paint majorGridColor()
      Gets the configured major grid color.
      Returns:
      The color
    • majorGridStyle

      public void majorGridStyle(Stroke style)
      Sets the major grid line style to use when building the plot.
      Parameters:
      style - The style to set
    • majorGridStyle

      public Stroke majorGridStyle()
      Gets the configured major grid style.
      Returns:
      The style
    • minorGrid

      public void minorGrid(boolean enabled)
      Toggle displaying minor grid lines ON or OFF.
      Parameters:
      enabled - True to set displaying ON, false for OFF
    • minorGrid

      public boolean minorGrid()
      Returns true if displaying minor grid lines is set ON or OFF.
      Returns:
      True if ON, false if OFF.
    • minorGridColor

      public void minorGridColor(Paint color)
      Sets the minor grid color to use when building the plot.
      Parameters:
      color - The color to set
    • minorGridColor

      public Paint minorGridColor()
      Gets the configured minor grid color.
      Returns:
      The color
    • minorGridStyle

      public void minorGridStyle(Stroke style)
      Sets the minor grid line style to use when building the plot.
      Parameters:
      style - The style to set
    • minorGridStyle

      public Stroke minorGridStyle()
      Gets the configured minor grid style.
      Returns:
      The style
    • checkBuildPreconditions

      public void checkBuildPreconditions() throws IllegalStateException
      Helper method to check if the preconditions for invoking build() have been satisfied. That is, that the x-axis and time data shared by all plots have been configured.
      Throws:
      IllegalStateException - if any of the preconditions are not met