org.jfree.chart.renderer.xy
Class AbstractXYItemRenderer
- java.lang.Object
-
- org.jfree.chart.renderer.AbstractRenderer
-
- org.jfree.chart.renderer.xy.AbstractXYItemRenderer
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, java.util.EventListener, AnnotationChangeListener, LegendItemSource, XYItemRenderer
- Direct Known Subclasses:
- CandlestickRenderer, HighLowRenderer, SamplingXYLineRenderer, StandardXYItemRenderer, VectorRenderer, WindItemRenderer, XYAreaRenderer, XYAreaRenderer2, XYBarRenderer, XYBlockRenderer, XYBoxAndWhiskerRenderer, XYBubbleRenderer, XYDifferenceRenderer, XYDotRenderer, XYLineAndShapeRenderer, XYShapeRenderer, XYStatisticalLineAndShapeRenderer, XYStepAreaRenderer, YIntervalRenderer
public abstract class AbstractXYItemRenderer extends AbstractRenderer implements XYItemRenderer, AnnotationChangeListener, java.lang.Cloneable, java.io.Serializable
A base class that can be used to create newXYItemRendererimplementations.- 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
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidaddAnnotation(XYAnnotation annotation)Adds an annotation and sends aRendererChangeEventto all registered listeners.voidaddAnnotation(XYAnnotation annotation, org.jfree.ui.Layer layer)Adds an annotation to the specified layer and sends aRendererChangeEventto all registered listeners.voidannotationChanged(AnnotationChangeEvent event)Receives notification of a change to anAnnotationadded to this renderer.voiddrawAnnotations(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, org.jfree.ui.Layer layer, PlotRenderingInfo info)Draws all the annotations for the specified layer.voiddrawDomainGridLine(java.awt.Graphics2D g2, XYPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)Draws a grid line against the range axis.voiddrawDomainLine(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 domain axis.voiddrawDomainMarker(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'.voiddrawRangeLine(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.voiddrawRangeMarker(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'.booleanequals(java.lang.Object obj)Tests this renderer for equality with another object.voidfillDomainGridBand(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.voidfillRangeGridBand(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.RangefindDomainBounds(XYDataset dataset)Returns the lower and upper bounds (range) of the x-values in the specified dataset.RangefindRangeBounds(XYDataset dataset)Returns the range of values the renderer requires to display all the items from the specified dataset.java.util.CollectiongetAnnotations()Returns a collection of the annotations that are assigned to the renderer.XYItemLabelGeneratorgetBaseItemLabelGenerator()Returns the base item label generator.XYToolTipGeneratorgetBaseToolTipGenerator()Returns the base tool tip generator.DrawingSuppliergetDrawingSupplier()Returns the drawing supplier from the plot.XYItemLabelGeneratorgetItemLabelGenerator()Deprecated.As of version 1.0.6, this override setting should not be used. You can use the base setting instead (getBaseItemLabelGenerator()).XYItemLabelGeneratorgetItemLabelGenerator(int series, int item)Returns the label generator for a data item.LegendItemgetLegendItem(int datasetIndex, int series)Returns a default legend item for the specified series.XYSeriesLabelGeneratorgetLegendItemLabelGenerator()Returns the legend item label generator.LegendItemCollectiongetLegendItems()Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing.XYSeriesLabelGeneratorgetLegendItemToolTipGenerator()Returns the legend item tool tip generator.XYSeriesLabelGeneratorgetLegendItemURLGenerator()Returns the legend item URL generator.intgetPassCount()Returns the number of passes through the data that the renderer requires in order to draw the chart.XYPlotgetPlot()Returns the plot that the renderer is assigned to.XYItemLabelGeneratorgetSeriesItemLabelGenerator(int series)Returns the item label generator for a series.XYToolTipGeneratorgetSeriesToolTipGenerator(int series)Returns the tool tip generator for a series.XYToolTipGeneratorgetToolTipGenerator()Deprecated.As of version 1.0.6, this override setting should not be used. You can use the base setting instead (getBaseToolTipGenerator()).XYToolTipGeneratorgetToolTipGenerator(int series, int item)Returns the tool tip generator for a data item.XYURLGeneratorgetURLGenerator()Returns the URL generator for HTML image maps.XYItemRendererStateinitialise(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.static booleanisPointInRect(java.awt.geom.Rectangle2D rect, double x, double y)Returnstrueif the specified point (x, y) falls within or on the boundary of the specified rectangle.booleanremoveAnnotation(XYAnnotation annotation)Removes the specified annotation and sends aRendererChangeEventto all registered listeners.voidremoveAnnotations()Removes all annotations and sends aRendererChangeEventto all registered listeners.voidsetBaseItemLabelGenerator(XYItemLabelGenerator generator)Sets the base item label generator and sends aRendererChangeEventto all registered listeners.voidsetBaseToolTipGenerator(XYToolTipGenerator generator)Sets the base tool tip generator and sends aRendererChangeEventto all registered listeners.voidsetItemLabelGenerator(XYItemLabelGenerator generator)Deprecated.As of version 1.0.6, this override setting should not be used. You can use the base setting instead (setBaseItemLabelGenerator(XYItemLabelGenerator)).voidsetLegendItemLabelGenerator(XYSeriesLabelGenerator generator)Sets the legend item label generator and sends aRendererChangeEventto all registered listeners.voidsetLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)Sets the legend item tool tip generator and sends aRendererChangeEventto all registered listeners.voidsetLegendItemURLGenerator(XYSeriesLabelGenerator generator)Sets the legend item URL generator and sends aRendererChangeEventto all registered listeners.voidsetPlot(XYPlot plot)Sets the plot that the renderer is assigned to.voidsetSeriesItemLabelGenerator(int series, XYItemLabelGenerator generator)Sets the item label generator for a series and sends aRendererChangeEventto all registered listeners.voidsetSeriesToolTipGenerator(int series, XYToolTipGenerator generator)Sets the tool tip generator for a series and sends aRendererChangeEventto all registered listeners.voidsetToolTipGenerator(XYToolTipGenerator generator)Deprecated.As of version 1.0.6, this override setting should not be used. You can use the base setting instead (setBaseToolTipGenerator(XYToolTipGenerator)).voidsetURLGenerator(XYURLGenerator urlGenerator)Sets the URL generator for HTML image maps and sends aRendererChangeEventto all registered listeners.-
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, clearSeriesPaints, clearSeriesStrokes, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseLegendShape, getBaseLegendTextFont, getBaseLegendTextPaint, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDataBoundsIncludesVisibleSeriesOnly, getDefaultEntityRadius, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hashCode, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseLegendShape, setBaseLegendTextFont, setBaseLegendTextPaint, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setDataBoundsIncludesVisibleSeriesOnly, setDefaultEntityRadius, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendShape, setLegendTextFont, setLegendTextPaint, 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
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, isSeriesVisible, 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
-
-
-
-
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:
getPassCountin interfaceXYItemRenderer- Returns:
- The pass count.
-
getPlot
public XYPlot getPlot()
Returns the plot that the renderer is assigned to.- Specified by:
getPlotin interfaceXYItemRenderer- Returns:
- The plot (possibly
null).
-
setPlot
public void setPlot(XYPlot plot)
Sets the plot that the renderer is assigned to.- Specified by:
setPlotin interfaceXYItemRenderer- Parameters:
plot- the plot (nullpermitted).
-
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:
initialisein interfaceXYItemRenderer- 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).
-
getItemLabelGenerator
public XYItemLabelGenerator getItemLabelGenerator(int series, int item)
Returns the label generator for a data item. This implementation simply passes control to thegetSeriesItemLabelGenerator(int)method. If, for some reason, you want a different generator for individual items, you can override this method.- Specified by:
getItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).item- the item index (zero based).- Returns:
- The generator (possibly
null).
-
getSeriesItemLabelGenerator
public XYItemLabelGenerator getSeriesItemLabelGenerator(int series)
Returns the item label generator for a series.- Specified by:
getSeriesItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).- Returns:
- The generator (possibly
null). - See Also:
XYItemRenderer.setSeriesItemLabelGenerator(int, XYItemLabelGenerator)
-
setSeriesItemLabelGenerator
public void setSeriesItemLabelGenerator(int series, XYItemLabelGenerator generator)Sets the item label generator for a series and sends aRendererChangeEventto all registered listeners.- Specified by:
setSeriesItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).generator- the generator (nullpermitted).- See Also:
XYItemRenderer.getSeriesItemLabelGenerator(int)
-
getBaseItemLabelGenerator
public XYItemLabelGenerator getBaseItemLabelGenerator()
Returns the base item label generator.- Specified by:
getBaseItemLabelGeneratorin interfaceXYItemRenderer- Returns:
- The generator (possibly
null). - See Also:
XYItemRenderer.setBaseItemLabelGenerator(XYItemLabelGenerator)
-
setBaseItemLabelGenerator
public void setBaseItemLabelGenerator(XYItemLabelGenerator generator)
Sets the base item label generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setBaseItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
XYItemRenderer.getBaseItemLabelGenerator()
-
getToolTipGenerator
public XYToolTipGenerator getToolTipGenerator(int series, int item)
Returns the tool tip generator for a data item. If, for some reason, you want a different generator for individual items, you can override this method.- Specified by:
getToolTipGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).item- the item index (zero based).- Returns:
- The generator (possibly
null).
-
getSeriesToolTipGenerator
public XYToolTipGenerator getSeriesToolTipGenerator(int series)
Returns the tool tip generator for a series.- Specified by:
getSeriesToolTipGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).- Returns:
- The generator (possibly
null). - See Also:
XYItemRenderer.setSeriesToolTipGenerator(int, XYToolTipGenerator)
-
setSeriesToolTipGenerator
public void setSeriesToolTipGenerator(int series, XYToolTipGenerator generator)Sets the tool tip generator for a series and sends aRendererChangeEventto all registered listeners.- Specified by:
setSeriesToolTipGeneratorin interfaceXYItemRenderer- Parameters:
series- the series index (zero based).generator- the generator (nullpermitted).- See Also:
XYItemRenderer.getSeriesToolTipGenerator(int)
-
getBaseToolTipGenerator
public XYToolTipGenerator getBaseToolTipGenerator()
Returns the base tool tip generator.- Specified by:
getBaseToolTipGeneratorin interfaceXYItemRenderer- Returns:
- The generator (possibly
null). - See Also:
setBaseToolTipGenerator(XYToolTipGenerator)
-
setBaseToolTipGenerator
public void setBaseToolTipGenerator(XYToolTipGenerator generator)
Sets the base tool tip generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setBaseToolTipGeneratorin interfaceXYItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getBaseToolTipGenerator()
-
getURLGenerator
public XYURLGenerator getURLGenerator()
Returns the URL generator for HTML image maps.- Specified by:
getURLGeneratorin interfaceXYItemRenderer- Returns:
- The URL generator (possibly
null).
-
setURLGenerator
public void setURLGenerator(XYURLGenerator urlGenerator)
Sets the URL generator for HTML image maps and sends aRendererChangeEventto all registered listeners.- Specified by:
setURLGeneratorin interfaceXYItemRenderer- Parameters:
urlGenerator- the URL generator (nullpermitted).
-
addAnnotation
public void addAnnotation(XYAnnotation annotation)
Adds an annotation and sends aRendererChangeEventto all registered listeners. The annotation is added to the foreground layer.- Specified by:
addAnnotationin interfaceXYItemRenderer- Parameters:
annotation- the annotation (nullnot permitted).
-
addAnnotation
public void addAnnotation(XYAnnotation annotation, org.jfree.ui.Layer layer)
Adds an annotation to the specified layer and sends aRendererChangeEventto all registered listeners.- Specified by:
addAnnotationin interfaceXYItemRenderer- Parameters:
annotation- the annotation (nullnot permitted).layer- the layer (nullnot permitted).
-
removeAnnotation
public boolean removeAnnotation(XYAnnotation annotation)
Removes the specified annotation and sends aRendererChangeEventto all registered listeners.- Specified by:
removeAnnotationin interfaceXYItemRenderer- Parameters:
annotation- the annotation to remove (nullnot permitted).- Returns:
- A boolean to indicate whether or not the annotation was successfully removed.
-
removeAnnotations
public void removeAnnotations()
Removes all annotations and sends aRendererChangeEventto all registered listeners.- Specified by:
removeAnnotationsin interfaceXYItemRenderer
-
annotationChanged
public void annotationChanged(AnnotationChangeEvent event)
Receives notification of a change to anAnnotationadded to this renderer.- Specified by:
annotationChangedin interfaceAnnotationChangeListener- Parameters:
event- information about the event (not used here).- Since:
- 1.0.14
-
getAnnotations
public java.util.Collection getAnnotations()
Returns a collection of the annotations that are assigned to the renderer.- Returns:
- A collection of annotations (possibly empty but never
null). - Since:
- 1.0.13
-
getLegendItemLabelGenerator
public XYSeriesLabelGenerator getLegendItemLabelGenerator()
Returns the legend item label generator.- Specified by:
getLegendItemLabelGeneratorin interfaceXYItemRenderer- Returns:
- The label generator (never
null). - See Also:
setLegendItemLabelGenerator(XYSeriesLabelGenerator)
-
setLegendItemLabelGenerator
public void setLegendItemLabelGenerator(XYSeriesLabelGenerator generator)
Sets the legend item label generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setLegendItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
generator- the generator (nullnot permitted).- See Also:
getLegendItemLabelGenerator()
-
getLegendItemToolTipGenerator
public XYSeriesLabelGenerator getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.- Returns:
- The tool tip generator (possibly
null). - See Also:
setLegendItemToolTipGenerator(XYSeriesLabelGenerator)
-
setLegendItemToolTipGenerator
public void setLegendItemToolTipGenerator(XYSeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends aRendererChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
getLegendItemToolTipGenerator()
-
getLegendItemURLGenerator
public XYSeriesLabelGenerator getLegendItemURLGenerator()
Returns the legend item URL generator.- Returns:
- The URL generator (possibly
null). - See Also:
setLegendItemURLGenerator(XYSeriesLabelGenerator)
-
setLegendItemURLGenerator
public void setLegendItemURLGenerator(XYSeriesLabelGenerator generator)
Sets the legend item URL generator and sends aRendererChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
getLegendItemURLGenerator()
-
findDomainBounds
public Range findDomainBounds(XYDataset dataset)
Returns the lower and upper bounds (range) of the x-values in the specified dataset.- Specified by:
findDomainBoundsin interfaceXYItemRenderer- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The range (
nullif the dataset isnullor empty). - See Also:
findRangeBounds(XYDataset)
-
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:
findRangeBoundsin interfaceXYItemRenderer- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The range (
nullif the dataset isnullor empty). - See Also:
findDomainBounds(XYDataset)
-
getLegendItems
public LegendItemCollection getLegendItems()
Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing.- Specified by:
getLegendItemsin interfaceLegendItemSource- 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:
getLegendItemin interfaceXYItemRenderer- 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:
fillDomainGridBandin interfaceXYItemRenderer- 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:
fillRangeGridBandin interfaceXYItemRenderer- 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:
drawDomainGridLinein interfaceXYItemRenderer- 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.
-
drawDomainLine
public void drawDomainLine(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 domain axis.- 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 (nullnot permitted).stroke- the stroke (nullnot permitted).- Since:
- 1.0.5
-
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:
drawRangeLinein interfaceXYItemRenderer- 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:
drawDomainMarkerin interfaceXYItemRenderer- Parameters:
g2- the graphics device.plot- the plot.domainAxis- the domain axis.marker- the marker line.dataArea- the axis data area.
-
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:
drawRangeMarkerin interfaceXYItemRenderer- Parameters:
g2- the graphics device.plot- the plot.rangeAxis- the range axis.marker- the marker line.dataArea- the axis data area.
-
equals
public boolean equals(java.lang.Object obj)
Tests this renderer for equality with another object.- Overrides:
equalsin classAbstractRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
trueorfalse.
-
getDrawingSupplier
public DrawingSupplier getDrawingSupplier()
Returns the drawing supplier from the plot.- Specified by:
getDrawingSupplierin classAbstractRenderer- Returns:
- The drawing supplier (possibly
null).
-
drawAnnotations
public void drawAnnotations(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, ValueAxis domainAxis, ValueAxis rangeAxis, org.jfree.ui.Layer layer, PlotRenderingInfo info)Draws all the annotations for the specified layer.- Specified by:
drawAnnotationsin interfaceXYItemRenderer- 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.
-
isPointInRect
public static boolean isPointInRect(java.awt.geom.Rectangle2D rect, double x, double y)Returnstrueif the specified point (x, y) falls within or on the boundary of the specified rectangle.- Parameters:
rect- the rectangle (nullnot permitted).x- the x-coordinate.y- the y-coordinate.- Returns:
- A boolean.
- Since:
- 1.0.10
-
getItemLabelGenerator
public XYItemLabelGenerator getItemLabelGenerator()
Deprecated. As of version 1.0.6, this override setting should not be used. You can use the base setting instead (getBaseItemLabelGenerator()).Returns the item label generator override.- Returns:
- The generator (possibly
null). - Since:
- 1.0.5
- See Also:
setItemLabelGenerator(XYItemLabelGenerator)
-
setItemLabelGenerator
public void setItemLabelGenerator(XYItemLabelGenerator generator)
Deprecated. As of version 1.0.6, this override setting should not be used. You can use the base setting instead (setBaseItemLabelGenerator(XYItemLabelGenerator)).Sets the item label generator for ALL series and sends aRendererChangeEventto all registered listeners.- Specified by:
setItemLabelGeneratorin interfaceXYItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getItemLabelGenerator()
-
getToolTipGenerator
public XYToolTipGenerator getToolTipGenerator()
Deprecated. As of version 1.0.6, this override setting should not be used. You can use the base setting instead (getBaseToolTipGenerator()).Returns the override tool tip generator.- Returns:
- The tool tip generator (possible
null). - Since:
- 1.0.5
- See Also:
setToolTipGenerator(XYToolTipGenerator)
-
setToolTipGenerator
public void setToolTipGenerator(XYToolTipGenerator generator)
Deprecated. As of version 1.0.6, this override setting should not be used. You can use the base setting instead (setBaseToolTipGenerator(XYToolTipGenerator)).Sets the tool tip generator for ALL series and sends aRendererChangeEventto all registered listeners.- Specified by:
setToolTipGeneratorin interfaceXYItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getToolTipGenerator()
-
-
DMelt 3.0 © DataMelt by jWork.ORG