Package com.jfcbuilder.types
Class XYTimeSeriesPlotBuilderElements
java.lang.Object
com.jfcbuilder.types.XYTimeSeriesPlotBuilderElements
Helper class for storing and accessing properties common to different kinds of XY plot builders.
Intended for use in composition-type implementations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
annotation
(IXYAnnotationBuilder<?> annotation) Registers an IXYAnnotationBuilder to be used for building the plot.Gets the axis color to use when building the plot.void
Sets the axis color to use when building the plot.Gets the axis font color to use when building the plot.void
axisFontColor
(Paint color) Sets the axis font color to use when building the plot.Gets the plot background color to use when building the plot.void
backgroundColor
(Paint color) Sets the plot background color to use when building the plot.void
Helper method to check if the preconditions for invokingbuild()
have been satisfied.void
dataset
(IXYTimeSeriesDatasetBuilder<?> dataset) Registers an XYDataset builder to be used for building the plot.Gets the zero-based index range to be used with all data series.void
indexRange
(ZeroBasedIndexRange indexRange) Sets the zero-based index range to be used with all data series.boolean
Returns true if displaying major grid lines is set ON or OFF.void
majorGrid
(boolean enabled) Toggle displaying major grid lines ON or OFF.Gets the configured major grid color.void
majorGridColor
(Paint color) Sets the major grid color to use when building the plot.Gets the configured major grid style.void
majorGridStyle
(Stroke style) Sets the major grid line style to use when building the plot.void
marker
(MarkerBuilder marker) Registers a fixed marker builder to be used for building the plot.boolean
Returns true if displaying minor grid lines is set ON or OFF.void
minorGrid
(boolean enabled) Toggle displaying minor grid lines ON or OFF.Gets the configured minor grid color.void
minorGridColor
(Paint color) Sets the minor grid color to use when building the plot.Gets the configured minor grid style.void
minorGridStyle
(Stroke style) Sets the minor grid line style to use when building the plot.int
Gets the layout weight to be used when rendering the plot.void
plotWeight
(int weight) Sets the layout weight to be used when rendering the plot.void
series
(IXYTimeSeriesBuilder<?> series) Registers an XY time series builder to be used for building the plot.boolean
Gets whether to render time gaps.void
showTimeGaps
(boolean showTimeGaps) Sets whether or not time gaps should be rendered.long[]
timeData()
Gets the time data to be used with all data series.void
timeData
(long[] timeData) Sets the time data to be used with all data series.Gets an unmodifiable list of the annotation builders to be used for building the plot.Gets an unmodifiable list of the dataset builders to be used for building the plot.Gets an unmodifiable list of the marker builders to be used for building the plot.Gets an unmodifiable list of the series builders to be used for building the plot.boolean
Checks if the builder is configured to use the default y-axis tick size.org.jfree.chart.axis.ValueAxis
xAxis()
Gets the x-axis to be used with all data series.void
xAxis
(org.jfree.chart.axis.ValueAxis xAxis) Sets the x-axis to be used with all data series.Gets the y-axis name to be used when building the plot.void
Sets the y-axis name to be used when building the plot.org.jfree.data.Range
Gets the main y-axis Range to be used when building the plot.void
yAxisRange
(double lower, double upper) Sets the main y-axis Range to be used when building the plot.Gets the main y-axis tick number format to be used when building the plot.double
Gets the main y-axis tick size to be used when building the plot.void
yAxisTickSize
(double size) Sets the main y-axis tick size to be used when building the plot.void
yTickFormat
(NumberFormat format) Sets the main y-axis tick format to be used when building the plot.
-
Constructor Details
-
XYTimeSeriesPlotBuilderElements
public XYTimeSeriesPlotBuilderElements()Constructor.
-
-
Method Details
-
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
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
Registers an XY time series builder to be used for building the plot.- Parameters:
series
- The builder to be registered
-
unmodifiableSeries
Gets an unmodifiable list of the series builders to be used for building the plot.- Returns:
- The unmodifiable list of series builders
-
dataset
Registers an XYDataset builder to be used for building the plot.- Parameters:
dataset
- The builder to be registered
-
unmodifiableDatasets
Gets an unmodifiable list of the dataset builders to be used for building the plot.- Returns:
- The unmodifiable list of dataset builders
-
marker
Registers a fixed marker builder to be used for building the plot.- Parameters:
marker
- The builder to be registered
-
unmodifiableLines
Gets an unmodifiable list of the marker builders to be used for building the plot.- Returns:
- The unmodifiable list of marker builders
-
annotation
Registers an IXYAnnotationBuilder to be used for building the plot.- Parameters:
annotation
- The builder to be registered
-
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
Sets the y-axis name to be used when building the plot.- Parameters:
name
- The plot's y-axis name to be set
-
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 useupper
- 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
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
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
Sets the plot background color to use when building the plot.- Parameters:
color
- The color to set
-
backgroundColor
Gets the plot background color to use when building the plot.- Returns:
- The color
-
axisFontColor
Sets the axis font color to use when building the plot.- Parameters:
color
- The color to set
-
axisFontColor
Gets the axis font color to use when building the plot.- Returns:
- The color
-
axisColor
Sets the axis color to use when building the plot.- Parameters:
color
- The color to set
-
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
Sets the major grid color to use when building the plot.- Parameters:
color
- The color to set
-
majorGridColor
Gets the configured major grid color.- Returns:
- The color
-
majorGridStyle
Sets the major grid line style to use when building the plot.- Parameters:
style
- The style to set
-
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
Sets the minor grid color to use when building the plot.- Parameters:
color
- The color to set
-
minorGridColor
Gets the configured minor grid color.- Returns:
- The color
-
minorGridStyle
Sets the minor grid line style to use when building the plot.- Parameters:
style
- The style to set
-
minorGridStyle
Gets the configured minor grid style.- Returns:
- The style
-
checkBuildPreconditions
Helper method to check if the preconditions for invokingbuild()
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
-