Package com.jfcbuilder.builders
Class XYDataImageBuilder
java.lang.Object
com.jfcbuilder.builders.XYDataImageBuilder
- All Implemented Interfaces:
IXYAnnotationBuilder<XYDataImageBuilder>
Builder for producing
XYDataImageAnnotation
objects.
Note: Limited to working with DateAxis
(i.e. with time gaps) mode
only. See related comments in mapXToTimeIndex(long[], int, int)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.jfree.chart.annotations.XYAnnotation
build()
Builds the XYAnnotation from all configured data and properties.static XYDataImageBuilder
get()
Factory method for obtaining new instances of this class.double
height()
Gets the data-space height of the image's drawing rectangle.height
(double h) Sets the data-space height of the image's drawing rectangle.image()
Gets theImage
to be annotated.Sets theImage
to be annotated.boolean
Gets the "include in data bounds" flag.includeInDataBounds
(boolean include) Sets the "include in data bounds" flag.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.double
width()
Gets the data-space width of the image's drawing rectangle.width
(double w) Sets the data-space width of the image's drawing rectangle.double
x()
Gets the x-axis data coordinate that is set.x
(double x) Sets the data image's x-axis data coordinate.double
y()
Gets the y-axis data coordinate that is set.y
(double y) Sets the data image's y-axis data coordinate.
-
Method Details
-
get
Factory method for obtaining new instances of this class.- Returns:
- New instance of this class
-
x
Sets the data image's x-axis data coordinate.- Parameters:
x
- The data coordinate to set- Returns:
- Reference to this builder instance for method chaining
-
x
public double x()Gets the x-axis data coordinate that is set.- Returns:
- The data coordinate value
-
y
Sets the data image's y-axis data coordinate.- Parameters:
y
- The data coordinate to set- Returns:
- Reference to this builder instance for method chaining
-
y
public double y()Gets the y-axis data coordinate that is set.- Returns:
- The data coordinate value
-
image
Sets theImage
to be annotated.- Parameters:
image
- The image object to annotate- Returns:
- Reference to this builder instance for method chaining
-
image
Gets theImage
to be annotated.- Returns:
- The image object to annotate
-
width
Sets the data-space width of the image's drawing rectangle.- Parameters:
w
- The width to be set- Returns:
- Reference to this builder instance for method chaining
-
width
public double width()Gets the data-space width of the image's drawing rectangle.- Returns:
- The width
-
height
Sets the data-space height of the image's drawing rectangle.- Parameters:
h
- The width to be set- Returns:
- Reference to this builder instance for method chaining
-
height
public double height()Gets the data-space height of the image's drawing rectangle.- Returns:
- The height
-
includeInDataBounds
Sets the "include in data bounds" flag.- Parameters:
include
- True to enable the inclusion, false to disable it.- Returns:
- Reference to this builder instance for method chaining
- See Also:
-
XYDataImageAnnotation.getIncludeInDataBounds()
-
includeInDataBounds
public boolean includeInDataBounds()Gets the "include in data bounds" flag.- Returns:
- True if including is enabled, false otherwise.
- See Also:
-
XYDataImageAnnotation.getIncludeInDataBounds()
-
build
Description copied from interface:IXYAnnotationBuilder
Builds the XYAnnotation from all configured data and properties.- Specified by:
build
in interfaceIXYAnnotationBuilder<XYDataImageBuilder>
- 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<XYDataImageBuilder>
- Parameters:
timeData
- The array of source time valuesindexRangeStartIndex
- The start index of the series index rangeindexRangeEndIndex
- The end index of the series index range
-