Package com.jfcbuilder.builders
Class XYShapeBuilder
java.lang.Object
com.jfcbuilder.builders.XYShapeBuilder
- All Implemented Interfaces:
IXYAnnotationBuilder<XYShapeBuilder>
Builder for producing
XYShapeAnnotation
objects.
Note: Limited to working with DateAxis
(i.e. with time gaps) mode
only. See related comments in mapXToTimeIndex(long[], int, int)
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.chart.annotations.XYAnnotation
build()
Builds the XYAnnotation from all configured data and properties.Gets the fill color of the shape.Sets the fill color of the shape.static XYShapeBuilder
get()
Factory method for obtaining new instances of this class.Gets the line color of the shape.Sets the line color of the shape.Gets the line style of the shape.Sets the line style of the shape.void
mapXToTimeIndex
(long[] timeData, int indexRangeStartIndex, int indexRangeEndIndex) Helper mutation method for replacing the configured x-axis date values with corresponding source array element index value.shape()
Gets theShape
to be annotated.Sets theShape
to be annotated.
-
Field Details
-
DEFAULT_LINE_COLOR
The default line color to use if none is specified. -
DEFAULT_LINE_STYLE
The default line style to use if none is specified. -
DEFAULT_FILL_COLOR
The default fill color to use if none is specified.
-
-
Method Details
-
get
Factory method for obtaining new instances of this class.- Returns:
- New instance of this class
-
shape
Gets theShape
to be annotated.- Returns:
- The shape
-
shape
Sets theShape
to be annotated.- Parameters:
shape
- TheShape
to be set- Returns:
- Reference to this builder instance for method chaining
-
lineStyle
Gets the line style of the shape.- Returns:
- The line style
-
lineStyle
Sets the line style of the shape.- Parameters:
style
- The style to be set- Returns:
- Reference to this builder instance for method chaining
-
lineColor
Gets the line color of the shape.- Returns:
- The color
-
lineColor
Sets the line color of the shape.- Parameters:
color
- The color to be set- Returns:
- Reference to this builder instance for method chaining
-
fillColor
Gets the fill color of the shape.- Returns:
- The color
-
fillColor
Sets the fill color of the shape.- Parameters:
color
- The color to be set- Returns:
- Reference to this builder instance for method chaining
-
build
Description copied from interface:IXYAnnotationBuilder
Builds the XYAnnotation from all configured data and properties.- Specified by:
build
in interfaceIXYAnnotationBuilder<XYShapeBuilder>
- Returns:
- New instance of an XYAnnotation corresponding to all configured data and properties
- Throws:
IllegalStateException
- If the builder is missing properties whenbuild()
is called
-
mapXToTimeIndex
public void mapXToTimeIndex(long[] timeData, int indexRangeStartIndex, int indexRangeEndIndex) Description copied from interface:IXYAnnotationBuilder
Helper mutation method for replacing the configured x-axis date values with corresponding source array element index value.Meant to be called internally by the framework itself, not by framework clients.
For facilitating the removal of visible time gaps on charts.
Different implementations may use different methods to map configured x value(s) to numeric indices, including search algorithms that may have higher order Big-O complexity.
- Specified by:
mapXToTimeIndex
in interfaceIXYAnnotationBuilder<XYShapeBuilder>
- Parameters:
timeData
- The array of source time valuesindexRangeStartIndex
- The start index of the series index rangeindexRangeEndIndex
- The end index of the series index range
-