org.jfree.chart.renderer.xy
public abstract class AbstractXYItemRenderer extends AbstractRenderer implements XYItemRenderer, Cloneable, Serializable
Constructor Summary | |
---|---|
protected | AbstractXYItemRenderer()
Creates a renderer where the tooltip generator and the URL generator are
both null . |
Method Summary | |
---|---|
void | addAnnotation(XYAnnotation annotation)
Adds an annotation and sends a RendererChangeEvent to all
registered listeners. |
void | addAnnotation(XYAnnotation annotation, Layer layer)
Adds an annotation to the specified layer.
|
protected void | addEntity(EntityCollection entities, Shape area, XYDataset dataset, int series, int item, double entityX, double entityY)
Adds an entity to the collection.
|
protected Point2D | calculateDomainMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)
Calculates the (x, y) coordinates for drawing a marker label.
|
protected Object | clone()
Returns a clone of the renderer.
|
void | drawAnnotations(Graphics2D g2, Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer, PlotRenderingInfo info)
Draws all the annotations for the specified layer.
|
void | drawDomainGridLine(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)
Draws a grid line against the range axis.
|
void | drawDomainLine(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double value, Paint paint, Stroke stroke)
Draws a line perpendicular to the domain axis.
|
void | drawDomainMarker(Graphics2D g2, XYPlot plot, ValueAxis domainAxis, Marker marker, Rectangle2D dataArea)
Draws a vertical line on the chart to represent a 'range marker'.
|
protected void | drawItemLabel(Graphics2D g2, PlotOrientation orientation, XYDataset dataset, int series, int item, double x, double y, boolean negative)
Draws an item label.
|
void | drawRangeLine(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double value, Paint paint, Stroke stroke)
Draws a line perpendicular to the range axis.
|
void | drawRangeMarker(Graphics2D g2, XYPlot plot, ValueAxis rangeAxis, Marker marker, Rectangle2D dataArea)
Draws a horizontal line across the chart to represent a 'range marker'.
|
boolean | equals(Object obj)
Tests this renderer for equality with another object.
|
void | fillDomainGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end)
Fills a band between two values on the axis. |
void | fillRangeGridBand(Graphics2D g2, XYPlot plot, ValueAxis axis, Rectangle2D dataArea, double start, double end)
Fills a band between two values on the range axis. |
Range | findDomainBounds(XYDataset dataset)
Returns the lower and upper bounds (range) of the x-values in the
specified dataset.
|
Range | findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
XYItemLabelGenerator | getBaseItemLabelGenerator()
Returns the base item label generator.
|
XYToolTipGenerator | getBaseToolTipGenerator()
Returns the base tool tip generator.
|
int | getDefaultEntityRadius()
Returns the radius of the circle used for the default entity area
when no area is specified.
|
DrawingSupplier | getDrawingSupplier()
Returns the drawing supplier from the plot.
|
XYItemLabelGenerator | getItemLabelGenerator(int series, int item)
Returns the label generator for a data item. |
XYItemLabelGenerator | getItemLabelGenerator()
Returns the item label generator override.
|
LegendItem | getLegendItem(int datasetIndex, int series)
Returns a default legend item for the specified series. |
XYSeriesLabelGenerator | getLegendItemLabelGenerator()
Returns the legend item label generator.
|
LegendItemCollection | getLegendItems()
Returns a (possibly empty) collection of legend items for the series
that this renderer is responsible for drawing.
|
XYSeriesLabelGenerator | getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.
|
XYSeriesLabelGenerator | getLegendItemURLGenerator()
Returns the legend item URL generator.
|
int | getPassCount()
Returns the number of passes through the data that the renderer requires
in order to draw the chart. |
XYPlot | getPlot()
Returns the plot that the renderer is assigned to.
|
XYItemLabelGenerator | getSeriesItemLabelGenerator(int series)
Returns the item label generator for a series.
|
XYToolTipGenerator | getSeriesToolTipGenerator(int series)
Returns the tool tip generator for a series.
|
XYToolTipGenerator | getToolTipGenerator(int series, int item)
Returns the tool tip generator for a data item. |
XYToolTipGenerator | getToolTipGenerator()
Returns the override tool tip generator.
|
XYURLGenerator | getURLGenerator()
Returns the URL generator for HTML image maps.
|
XYItemRendererState | initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
Initialises the renderer and returns a state object that should be
passed to all subsequent calls to the drawItem() method.
|
boolean | removeAnnotation(XYAnnotation annotation)
Removes the specified annotation and sends a RendererChangeEvent
to all registered listeners.
|
void | removeAnnotations()
Removes all annotations and sends a RendererChangeEvent
to all registered listeners. |
void | setBaseItemLabelGenerator(XYItemLabelGenerator generator)
Sets the base item label generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setBaseToolTipGenerator(XYToolTipGenerator generator)
Sets the base tool tip generator and sends a RendererChangeEvent
to all registered listeners.
|
void | setDefaultEntityRadius(int radius)
Sets the radius of the circle used for the default entity area
when no area is specified.
|
void | setItemLabelGenerator(XYItemLabelGenerator generator)
Sets the item label generator for ALL series and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendItemLabelGenerator(XYSeriesLabelGenerator generator)
Sets the legend item label generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendItemURLGenerator(XYSeriesLabelGenerator generator)
Sets the legend item URL generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setPlot(XYPlot plot)
Sets the plot that the renderer is assigned to.
|
void | setSeriesItemLabelGenerator(int series, XYItemLabelGenerator generator)
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners.
|
void | setSeriesToolTipGenerator(int series, XYToolTipGenerator generator)
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered listeners.
|
void | setToolTipGenerator(XYToolTipGenerator generator)
Sets the tool tip generator for ALL series and sends a
RendererChangeEvent to all registered listeners.
|
void | setURLGenerator(XYURLGenerator urlGenerator)
Sets the URL generator for HTML image maps.
|
protected void | updateCrosshairValues(CrosshairState crosshairState, double x, double y, double transX, double transY, PlotOrientation orientation)
Considers the current (x, y) coordinate and updates the crosshair point
if it meets the criteria (usually means the (x, y) coordinate is the
closest to the anchor point so far).
|
protected void | updateCrosshairValues(CrosshairState crosshairState, double x, double y, int domainAxisIndex, int rangeAxisIndex, double transX, double transY, PlotOrientation orientation)
Considers the current (x, y) coordinate and updates the crosshair point
if it meets the criteria (usually means the (x, y) coordinate is the
closest to the anchor point so far).
|
null
.Parameters: annotation the annotation (null
not permitted).
Parameters: annotation the annotation (null
not permitted). layer the layer (null
not permitted).
Parameters: entities the entity collection being populated. area the entity area (if null
a default will be
used). dataset the dataset. series the series. item the item. entityX the entity's center x-coordinate in user space. entityY the entity's center y-coordinate in user space.
Parameters: g2 the graphics device. orientation the plot orientation. dataArea the data area. markerArea the rectangle surrounding the marker area. markerOffset the marker label offset. labelOffsetType the label offset type. anchor the label anchor.
Returns: The coordinates for drawing the marker label.
Returns: A clone.
Throws: CloneNotSupportedException if the renderer does not support cloning.
Parameters: g2 the graphics device. dataArea the data area. domainAxis the domain axis. rangeAxis the range axis. layer the layer. info the plot rendering info.
Parameters: g2 the graphics device. plot the plot. axis the value axis. dataArea the area for plotting data (not yet adjusted for any 3D effect). value the value at which the grid line should be drawn.
Parameters: g2 the graphics device. plot the plot. axis the value axis. dataArea the area for plotting data (not yet adjusted for any 3D effect). value the value at which the grid line should be drawn. paint the paint. stroke the stroke.
Since: 1.0.5
Parameters: g2 the graphics device. plot the plot. domainAxis the domain axis. marker the marker line. dataArea the axis data area.
Parameters: g2 the graphics device. orientation the orientation. dataset the dataset. series the series index (zero-based). item the item index (zero-based). x the x coordinate (in Java2D space). y the y coordinate (in Java2D space). negative indicates a negative value (which affects the item label position).
Parameters: g2 the graphics device. plot the plot. axis the value axis. dataArea the area for plotting data (not yet adjusted for any 3D effect). value the value at which the grid line should be drawn. paint the paint. stroke the stroke.
Parameters: g2 the graphics device. plot the plot. rangeAxis the range axis. marker the marker line. dataArea the axis data area.
Parameters: obj the object (null
permitted).
Returns: true
or false
.
Parameters: g2 the graphics device. plot the plot. axis the domain axis. dataArea the data area. start the start value. end the end value.
Parameters: g2 the graphics device. plot the plot. axis the range axis. dataArea the data area. start the start value. end the end value.
Parameters: dataset the dataset (null
permitted).
Returns: The range (null
if the dataset is null
or empty).
Parameters: dataset the dataset (null
permitted).
Returns: The range (null
if the dataset is null
or empty).
Returns: The generator (possibly null
).
Returns: The generator (possibly null
).
See Also: setBaseToolTipGenerator
Returns: A radius.
Returns: The drawing supplier (possibly null
).
Parameters: series the series index (zero based). item the item index (zero based).
Returns: The generator (possibly null
).
Returns: The generator (possibly null
).
Since: 1.0.5
See Also: setItemLabelGenerator
Parameters: datasetIndex the dataset index (zero-based). series the series index (zero-based).
Returns: A legend item for the series.
Returns: The label generator (never null
).
See Also: setLegendItemLabelGenerator
Returns: The legend item collection (never null
).
Returns: The tool tip generator (possibly null
).
See Also: setLegendItemToolTipGenerator
Returns: The URL generator (possibly null
).
See Also: setLegendItemURLGenerator
Returns: The pass count.
Returns: The plot (possibly null
).
Parameters: series the series index (zero based).
Returns: The generator (possibly null
).
Parameters: series the series index (zero based).
Returns: The generator (possibly null
).
Parameters: series the series index (zero based). item the item index (zero based).
Returns: The generator (possibly null
).
Returns: The tool tip generator (possible null
).
Since: 1.0.5
See Also: setToolTipGenerator
Returns: The URL generator (possibly null
).
This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.
Parameters: g2 the graphics device. dataArea the area inside the axes. plot the plot. data the data. info an optional info collection object to return data back to the caller.
Returns: The renderer state (never null
).
Parameters: annotation the annotation to remove (null
not
permitted).
Returns: A boolean to indicate whether or not the annotation was successfully removed.
Parameters: generator the generator (null
permitted).
Parameters: generator the generator (null
permitted).
See Also: getBaseToolTipGenerator
Parameters: radius the radius.
Parameters: generator the generator (null
permitted).
See Also: getItemLabelGenerator
Parameters: generator the generator (null
not permitted).
See Also: getLegendItemLabelGenerator
Parameters: generator the generator (null
permitted).
See Also: getLegendItemToolTipGenerator
Parameters: generator the generator (null
permitted).
See Also: getLegendItemURLGenerator
Parameters: plot the plot (null
permitted).
Parameters: series the series index (zero based). generator the generator (null
permitted).
Parameters: series the series index (zero based). generator the generator (null
permitted).
Parameters: generator the generator (null
permitted).
See Also: getToolTipGenerator
Parameters: urlGenerator the URL generator (null
permitted).
Deprecated: Use AbstractXYItemRenderer -- see bug report 1086307.
Considers the current (x, y) coordinate and updates the crosshair point if it meets the criteria (usually means the (x, y) coordinate is the closest to the anchor point so far).Parameters: crosshairState the crosshair state (null
permitted,
but the method does nothing in that case). x the x-value (in data space). y the y-value (in data space). transX the x-value translated to Java2D space. transY the y-value translated to Java2D space. orientation the plot orientation (null
not
permitted).
Parameters: crosshairState the crosshair state (null
permitted,
but the method does nothing in that case). x the x-value (in data space). y the y-value (in data space). domainAxisIndex the index of the domain axis for the point. rangeAxisIndex the index of the range axis for the point. transX the x-value translated to Java2D space. transY the y-value translated to Java2D space. orientation the plot orientation (null
not
permitted).
Since: 1.0.4