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.XYAnnotationbuild()Builds the XYAnnotation from all configured data and properties.Gets the fill color of the shape.Sets the fill color of the shape.static XYShapeBuilderget()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.voidmapXToTimeIndex(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 theShapeto be annotated.Sets theShapeto 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 theShapeto be annotated.- Returns:
- The shape
-
shape
Sets theShapeto be annotated.- Parameters:
shape- TheShapeto 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:IXYAnnotationBuilderBuilds the XYAnnotation from all configured data and properties.- Specified by:
buildin 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:IXYAnnotationBuilderHelper 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:
mapXToTimeIndexin 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
-