org.jfree.chart.renderer.xy
Class AbstractXYItemRenderer

java.lang.Object
  extended byorg.jfree.chart.renderer.AbstractRenderer
      extended byorg.jfree.chart.renderer.xy.AbstractXYItemRenderer
All Implemented Interfaces:
java.lang.Cloneable, LegendItemSource, java.io.Serializable, XYItemRenderer
Direct Known Subclasses:
CandlestickRenderer, HighLowRenderer, SignalRenderer, StandardXYItemRenderer, WindItemRenderer, XYAreaRenderer, XYAreaRenderer2, XYBarRenderer, XYBoxAndWhiskerRenderer, XYBubbleRenderer, XYDifferenceRenderer, XYDotRenderer, XYLineAndShapeRenderer, XYStepAreaRenderer, XYStepRenderer, YIntervalRenderer

public abstract class AbstractXYItemRenderer
extends AbstractRenderer
implements XYItemRenderer, java.lang.Cloneable, java.io.Serializable

A base class that can be used to create new XYItemRenderer implementations.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
 
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, java.awt.Shape area, XYDataset dataset, int series, int item, double entityX, double entityY)
          Adds an entity to the collection.
protected  java.awt.geom.Point2D calculateDomainMarkerTextAnchorPoint(java.awt.Graphics2D g2, PlotOrientation orientation, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetForDomain, LengthAdjustmentType labelOffsetForRange, RectangleAnchor anchor)
          Calculates the (x, y) coordinates for drawing a marker label.
protected  java.lang.Object clone()
          Returns a clone of the renderer.
 void drawAnnotations(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, Layer layer, PlotRenderingInfo info)
          Draws all the annotations for the specified layer.
 void drawDomainGridLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)
          Draws a grid line against the range axis.
 void drawDomainMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis domainAxis, Marker marker, java.awt.geom.Rectangle2D dataArea)
          Draws a vertical line on the chart to represent a 'range marker'.
protected  void drawItemLabel(java.awt.Graphics2D g2, PlotOrientation orientation, XYDataset dataset, int series, int item, double x, double y, boolean negative)
          Draws an item label.
 void drawRangeLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value, java.awt.Paint paint, java.awt.Stroke stroke)
          Draws a line perpendicular to the range axis.
 void drawRangeMarker(java.awt.Graphics2D g2, XYPlot plot, ValueAxis rangeAxis, Marker marker, java.awt.geom.Rectangle2D dataArea)
          Draws a horizontal line across the chart to represent a 'range marker'.
 boolean equals(java.lang.Object obj)
          Tests this renderer for equality with another object.
 void fillDomainGridBand(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double start, double end)
          Fills a band between two values on the axis.
 void fillRangeGridBand(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.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.
 XYLabelGenerator getBaseLabelGenerator()
          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.
 XYLabelGenerator getLabelGenerator(int row, int column)
          Returns the label generator for a data item.
 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.
 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.
 XYLabelGenerator getSeriesLabelGenerator(int series)
          Returns the label generator for a series.
 XYToolTipGenerator getSeriesToolTipGenerator(int series)
          Returns the tool tip generator for a series.
 XYToolTipGenerator getToolTipGenerator(int row, int column)
          Returns the tool tip generator for a data item.
 XYURLGenerator getURLGenerator()
          Returns the URL generator for HTML image maps.
 XYItemRendererState initialise(java.awt.Graphics2D g2, java.awt.geom.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 setBaseLabelGenerator(XYLabelGenerator 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 setLabelGenerator(XYLabelGenerator 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.
 void setPlot(XYPlot plot)
          Sets the plot that the renderer is assigned to.
 void setSeriesLabelGenerator(int series, XYLabelGenerator generator)
          Sets the 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).
 
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, calculateLabelAnchorPoint, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hashCode, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisibleInLegend, notifyListeners, removeChangeListener, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setShape, setStroke, setStroke
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.chart.renderer.xy.XYItemRenderer
addChangeListener, drawItem, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisibleInLegend, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseStroke, setItemLabelFont, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setStroke
 

Constructor Detail

AbstractXYItemRenderer

protected AbstractXYItemRenderer()
Creates a renderer where the tooltip generator and the URL generator are both null.

Method Detail

getPassCount

public int getPassCount()
Returns the number of passes through the data that the renderer requires in order to draw the chart. Most charts will require a single pass, but some require two passes.

Specified by:
getPassCount in interface XYItemRenderer
Returns:
The pass count.

getPlot

public XYPlot getPlot()
Returns the plot that the renderer is assigned to.

Specified by:
getPlot in interface XYItemRenderer
Returns:
The plot.

setPlot

public void setPlot(XYPlot plot)
Sets the plot that the renderer is assigned to.

Specified by:
setPlot in interface XYItemRenderer
Parameters:
plot - the plot.

initialise

public XYItemRendererState initialise(java.awt.Graphics2D g2,
                                      java.awt.geom.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.

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.

Specified by:
initialise in interface XYItemRenderer
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).

getLabelGenerator

public XYLabelGenerator getLabelGenerator(int row,
                                          int column)
Returns the label generator for a data item. This implementation simply passes control to the getSeriesLabelGenerator(int) method. If, for some reason, you want a different generator for individual items, you can override this method.

Specified by:
getLabelGenerator in interface XYItemRenderer
Parameters:
row - the row index (zero based).
column - the column index (zero based).
Returns:
The generator (possibly null).

getSeriesLabelGenerator

public XYLabelGenerator getSeriesLabelGenerator(int series)
Returns the label generator for a series.

Specified by:
getSeriesLabelGenerator in interface XYItemRenderer
Parameters:
series - the series index (zero based).
Returns:
the generator (possibly null).

setLabelGenerator

public void setLabelGenerator(XYLabelGenerator generator)
Sets the item label generator for ALL series and sends a RendererChangeEvent to all registered listeners.

Specified by:
setLabelGenerator in interface XYItemRenderer
Parameters:
generator - the generator (null permitted).

setSeriesLabelGenerator

public void setSeriesLabelGenerator(int series,
                                    XYLabelGenerator generator)
Sets the label generator for a series and sends a RendererChangeEvent to all registered listeners.

Specified by:
setSeriesLabelGenerator in interface XYItemRenderer
Parameters:
series - the series index (zero based).
generator - the generator (null permitted).

getBaseLabelGenerator

public XYLabelGenerator getBaseLabelGenerator()
Returns the base item label generator.

Specified by:
getBaseLabelGenerator in interface XYItemRenderer
Returns:
the generator (possibly null).

setBaseLabelGenerator

public void setBaseLabelGenerator(XYLabelGenerator generator)
Sets the base item label generator and sends a RendererChangeEvent to all registered listeners.

Specified by:
setBaseLabelGenerator in interface XYItemRenderer
Parameters:
generator - the generator (null permitted).

getToolTipGenerator

public XYToolTipGenerator getToolTipGenerator(int row,
                                              int column)
Returns the tool tip generator for a data item. This implementation simply passes control to the getSeriesToolTipGenerator() method. If, for some reason, you want a different generator for individual items, you can override this method.

Specified by:
getToolTipGenerator in interface XYItemRenderer
Parameters:
row - the row index (zero based).
column - the column index (zero based).
Returns:
The generator (possibly null).

getSeriesToolTipGenerator

public XYToolTipGenerator getSeriesToolTipGenerator(int series)
Returns the tool tip generator for a series.

Specified by:
getSeriesToolTipGenerator in interface XYItemRenderer
Parameters:
series - the series index (zero based).
Returns:
The generator (possibly null).

setToolTipGenerator

public void setToolTipGenerator(XYToolTipGenerator generator)
Sets the tool tip generator for ALL series and sends a RendererChangeEvent to all registered listeners.

Specified by:
setToolTipGenerator in interface XYItemRenderer
Parameters:
generator - the generator (null permitted).

setSeriesToolTipGenerator

public void setSeriesToolTipGenerator(int series,
                                      XYToolTipGenerator generator)
Sets the tool tip generator for a series and sends a RendererChangeEvent to all registered listeners.

Specified by:
setSeriesToolTipGenerator in interface XYItemRenderer
Parameters:
series - the series index (zero based).
generator - the generator (null permitted).

getBaseToolTipGenerator

public XYToolTipGenerator getBaseToolTipGenerator()
Returns the base tool tip generator.

Specified by:
getBaseToolTipGenerator in interface XYItemRenderer
Returns:
The generator (possibly null).

setBaseToolTipGenerator

public void setBaseToolTipGenerator(XYToolTipGenerator generator)
Sets the base tool tip generator and sends a RendererChangeEvent to all registered listeners.

Specified by:
setBaseToolTipGenerator in interface XYItemRenderer
Parameters:
generator - the generator (null permitted).

getURLGenerator

public XYURLGenerator getURLGenerator()
Returns the URL generator for HTML image maps.

Specified by:
getURLGenerator in interface XYItemRenderer
Returns:
the URL generator (possibly null).

setURLGenerator

public void setURLGenerator(XYURLGenerator urlGenerator)
Sets the URL generator for HTML image maps.

Specified by:
setURLGenerator in interface XYItemRenderer
Parameters:
urlGenerator - the URL generator (null permitted).

addAnnotation

public void addAnnotation(XYAnnotation annotation)
Adds an annotation and sends a RendererChangeEvent to all registered listeners. The annotation is added to the foreground layer.

Specified by:
addAnnotation in interface XYItemRenderer
Parameters:
annotation - the annotation (null not permitted).

addAnnotation

public void addAnnotation(XYAnnotation annotation,
                          Layer layer)
Adds an annotation to the specified layer.

Specified by:
addAnnotation in interface XYItemRenderer
Parameters:
annotation - the annotation (null not permitted).
layer - the layer (null not permitted).

removeAnnotation

public boolean removeAnnotation(XYAnnotation annotation)
Removes the specified annotation and sends a RendererChangeEvent to all registered listeners.

Specified by:
removeAnnotation in interface XYItemRenderer
Parameters:
annotation - the annotation to remove (null not permitted).
Returns:
A boolean to indicate whether or not the annotation was successfully removed.

removeAnnotations

public void removeAnnotations()
Removes all annotations and sends a RendererChangeEvent to all registered listeners.

Specified by:
removeAnnotations in interface XYItemRenderer

getDefaultEntityRadius

public int getDefaultEntityRadius()
Returns the radius of the circle used for the default entity area when no area is specified.

Returns:
A radius.

setDefaultEntityRadius

public void setDefaultEntityRadius(int radius)
Sets the radius of the circle used for the default entity area when no area is specified.

Parameters:
radius - the radius.

getLegendItemLabelGenerator

public XYSeriesLabelGenerator getLegendItemLabelGenerator()
Returns the legend item label generator.

Returns:
The label generator (never null).

setLegendItemLabelGenerator

public void setLegendItemLabelGenerator(XYSeriesLabelGenerator generator)
Sets the legend item label generator.

Parameters:
generator - the generator (null not permitted).

findDomainBounds

public Range findDomainBounds(XYDataset dataset)
Returns the lower and upper bounds (range) of the x-values in the specified dataset.

Specified by:
findDomainBounds in interface XYItemRenderer
Parameters:
dataset - the dataset (null permitted).
Returns:
The range (null if the dataset is null or empty).

findRangeBounds

public Range findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset.

Specified by:
findRangeBounds in interface XYItemRenderer
Parameters:
dataset - the dataset (null permitted).
Returns:
The range (null if the dataset is null or empty).

getLegendItems

public LegendItemCollection getLegendItems()
Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing.

Specified by:
getLegendItems in interface LegendItemSource
Returns:
The legend item collection (never null).

getLegendItem

public LegendItem getLegendItem(int datasetIndex,
                                int series)
Returns a default legend item for the specified series. Subclasses should override this method to generate customised items.

Specified by:
getLegendItem in interface XYItemRenderer
Parameters:
datasetIndex - the dataset index (zero-based).
series - the series index (zero-based).
Returns:
A legend item for the series.

fillDomainGridBand

public void fillDomainGridBand(java.awt.Graphics2D g2,
                               XYPlot plot,
                               ValueAxis axis,
                               java.awt.geom.Rectangle2D dataArea,
                               double start,
                               double end)
Fills a band between two values on the axis. This can be used to color bands between the grid lines.

Specified by:
fillDomainGridBand in interface XYItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
axis - the domain axis.
dataArea - the data area.
start - the start value.
end - the end value.

fillRangeGridBand

public void fillRangeGridBand(java.awt.Graphics2D g2,
                              XYPlot plot,
                              ValueAxis axis,
                              java.awt.geom.Rectangle2D dataArea,
                              double start,
                              double end)
Fills a band between two values on the range axis. This can be used to color bands between the grid lines.

Specified by:
fillRangeGridBand in interface XYItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
axis - the range axis.
dataArea - the data area.
start - the start value.
end - the end value.

drawDomainGridLine

public void drawDomainGridLine(java.awt.Graphics2D g2,
                               XYPlot plot,
                               ValueAxis axis,
                               java.awt.geom.Rectangle2D dataArea,
                               double value)
Draws a grid line against the range axis.

Specified by:
drawDomainGridLine in interface XYItemRenderer
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.

drawRangeLine

public void drawRangeLine(java.awt.Graphics2D g2,
                          XYPlot plot,
                          ValueAxis axis,
                          java.awt.geom.Rectangle2D dataArea,
                          double value,
                          java.awt.Paint paint,
                          java.awt.Stroke stroke)
Draws a line perpendicular to the range axis.

Specified by:
drawRangeLine in interface XYItemRenderer
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.

drawDomainMarker

public void drawDomainMarker(java.awt.Graphics2D g2,
                             XYPlot plot,
                             ValueAxis domainAxis,
                             Marker marker,
                             java.awt.geom.Rectangle2D dataArea)
Draws a vertical line on the chart to represent a 'range marker'.

Specified by:
drawDomainMarker in interface XYItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
domainAxis - the domain axis.
marker - the marker line.
dataArea - the axis data area.

calculateDomainMarkerTextAnchorPoint

protected java.awt.geom.Point2D calculateDomainMarkerTextAnchorPoint(java.awt.Graphics2D g2,
                                                                     PlotOrientation orientation,
                                                                     java.awt.geom.Rectangle2D dataArea,
                                                                     java.awt.geom.Rectangle2D markerArea,
                                                                     RectangleInsets markerOffset,
                                                                     LengthAdjustmentType labelOffsetForDomain,
                                                                     LengthAdjustmentType labelOffsetForRange,
                                                                     RectangleAnchor anchor)
Calculates the (x, y) coordinates for drawing a marker label.

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.
labelOffsetForDomain - the domain offset type.
labelOffsetForRange - the range offset type.
anchor - the label anchor.
Returns:
The coordinates for drawing the marker label.

drawRangeMarker

public void drawRangeMarker(java.awt.Graphics2D g2,
                            XYPlot plot,
                            ValueAxis rangeAxis,
                            Marker marker,
                            java.awt.geom.Rectangle2D dataArea)
Draws a horizontal line across the chart to represent a 'range marker'.

Specified by:
drawRangeMarker in interface XYItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
rangeAxis - the range axis.
marker - the marker line.
dataArea - the axis data area.

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Returns a clone of the renderer.

Overrides:
clone in class AbstractRenderer
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if the renderer does not support cloning.

equals

public boolean equals(java.lang.Object obj)
Tests this renderer for equality with another object.

Overrides:
equals in class AbstractRenderer
Parameters:
obj - the object.
Returns:
true or false.

getDrawingSupplier

public DrawingSupplier getDrawingSupplier()
Returns the drawing supplier from the plot.

Specified by:
getDrawingSupplier in class AbstractRenderer
Returns:
The drawing supplier (possibly null).

updateCrosshairValues

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).

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).

drawItemLabel

protected void drawItemLabel(java.awt.Graphics2D g2,
                             PlotOrientation orientation,
                             XYDataset dataset,
                             int series,
                             int item,
                             double x,
                             double y,
                             boolean negative)
Draws an item label.

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).

drawAnnotations

public void drawAnnotations(java.awt.Graphics2D g2,
                            java.awt.geom.Rectangle2D dataArea,
                            ValueAxis domainAxis,
                            ValueAxis rangeAxis,
                            Layer layer,
                            PlotRenderingInfo info)
Draws all the annotations for the specified layer.

Specified by:
drawAnnotations in interface XYItemRenderer
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.

addEntity

protected void addEntity(EntityCollection entities,
                         java.awt.Shape area,
                         XYDataset dataset,
                         int series,
                         int item,
                         double entityX,
                         double entityY)
Adds an entity to the collection.

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.