org.jfree.chart.renderer.category
Class AbstractCategoryItemRenderer
- java.lang.Object
-
- org.jfree.chart.renderer.AbstractRenderer
-
- org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, LegendItemSource, CategoryItemRenderer, org.jfree.util.PublicCloneable
- Direct Known Subclasses:
- AreaRenderer, BarRenderer, BoxAndWhiskerRenderer, CategoryStepRenderer, LevelRenderer, LineAndShapeRenderer, MinMaxCategoryRenderer, ScatterRenderer
public abstract class AbstractCategoryItemRenderer extends AbstractRenderer implements CategoryItemRenderer, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable
An abstract base class that you can use to implement a newCategoryItemRenderer. When you create a newCategoryItemRendereryou are not required to extend this class, but it makes the job easier.- 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 Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description java.lang.Objectclone()Returns an independent copy of the renderer.voiddrawBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)Draws a background for the data area.voiddrawDomainGridline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, double value)Draws a grid line against the domain axis.voiddrawDomainMarker(java.awt.Graphics2D g2, CategoryPlot plot, CategoryAxis axis, CategoryMarker marker, java.awt.geom.Rectangle2D dataArea)Draws a marker for the domain axis.voiddrawOutline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)Draws an outline for the data area.voiddrawRangeGridline(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)Draws a grid line against the range axis.voiddrawRangeLine(java.awt.Graphics2D g2, CategoryPlot 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, CategoryPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)Draws a marker for the range axis.booleanequals(java.lang.Object obj)Tests this renderer for equality with another object.RangefindRangeBounds(CategoryDataset dataset)Returns the range of values the renderer requires to display all the items from the specified dataset.CategoryItemLabelGeneratorgetBaseItemLabelGenerator()Returns the base item label generator.CategoryURLGeneratorgetBaseItemURLGenerator()Returns the base item URL generator.CategoryToolTipGeneratorgetBaseToolTipGenerator()Returns the base tool tip generator (the "layer 2" generator).intgetColumnCount()Returns the number of columns in the dataset.DrawingSuppliergetDrawingSupplier()Returns the drawing supplier from the plot.CategoryItemLabelGeneratorgetItemLabelGenerator(int row, int column)Returns the item label generator for a data item.doublegetItemMiddle(java.lang.Comparable rowKey, java.lang.Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, java.awt.geom.Rectangle2D area, org.jfree.ui.RectangleEdge edge)Returns the Java2D coordinate for the middle of the specified data item.CategoryURLGeneratorgetItemURLGenerator(int row, int column)Returns the URL generator for a data item.LegendItemgetLegendItem(int datasetIndex, int series)Returns a legend item for a series.CategorySeriesLabelGeneratorgetLegendItemLabelGenerator()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.CategorySeriesLabelGeneratorgetLegendItemToolTipGenerator()Returns the legend item tool tip generator.CategorySeriesLabelGeneratorgetLegendItemURLGenerator()Returns the legend item URL generator.intgetPassCount()Returns the number of passes through the dataset required by the renderer.CategoryPlotgetPlot()Returns the plot that the renderer has been assigned to (wherenullindicates that the renderer is not currently assigned to a plot).intgetRowCount()Returns the number of rows in the dataset.CategoryItemLabelGeneratorgetSeriesItemLabelGenerator(int series)Returns the item label generator for a series.CategoryURLGeneratorgetSeriesItemURLGenerator(int series)Returns the URL generator for a series.CategoryToolTipGeneratorgetSeriesToolTipGenerator(int series)Returns the tool tip generator for the specified series (a "layer 1" generator).CategoryToolTipGeneratorgetToolTipGenerator()Deprecated.This method should no longer be used (as of version 1.0.6). It is sufficient to rely ongetSeriesToolTipGenerator(int)andgetBaseToolTipGenerator().CategoryToolTipGeneratorgetToolTipGenerator(int row, int column)Returns the tool tip generator that should be used for the specified item.inthashCode()Returns a hash code for the renderer.CategoryItemRendererStateinitialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)Initialises the renderer and returns a state object that will be used for the remainder of the drawing process for a single chart.voidsetBaseItemLabelGenerator(CategoryItemLabelGenerator generator)Sets the base item label generator and sends aRendererChangeEventto all registered listeners.voidsetBaseItemURLGenerator(CategoryURLGenerator generator)Sets the base item URL generator and sends aRendererChangeEventto all registered listeners.voidsetBaseToolTipGenerator(CategoryToolTipGenerator generator)Sets the base tool tip generator and sends aRendererChangeEventto all registered listeners.voidsetItemLabelGenerator(CategoryItemLabelGenerator generator)Deprecated.This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)andsetBaseItemLabelGenerator(CategoryItemLabelGenerator).voidsetItemURLGenerator(CategoryURLGenerator generator)Deprecated.This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesItemURLGenerator(int, CategoryURLGenerator)andsetBaseItemURLGenerator(CategoryURLGenerator).voidsetLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)Sets the legend item label generator and sends aRendererChangeEventto all registered listeners.voidsetLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)Sets the legend item tool tip generator and sends aRendererChangeEventto all registered listeners.voidsetLegendItemURLGenerator(CategorySeriesLabelGenerator generator)Sets the legend item URL generator and sends aRendererChangeEventto all registered listeners.voidsetPlot(CategoryPlot plot)Sets the plot that the renderer has been assigned to.voidsetSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator)Sets the item label generator for a series and sends aRendererChangeEventto all registered listeners.voidsetSeriesItemURLGenerator(int series, CategoryURLGenerator generator)Sets the URL generator for a series and sends aRendererChangeEventto all registered listeners.voidsetSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator)Sets the tool tip generator for a series and sends aRendererChangeEventto all registered listeners.voidsetToolTipGenerator(CategoryToolTipGenerator generator)Deprecated.This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesToolTipGenerator(int, CategoryToolTipGenerator)andsetBaseToolTipGenerator(CategoryToolTipGenerator).-
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, 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.category.CategoryItemRenderer
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 dataset required by the renderer. This method returns1, subclasses should override if they need more passes.- Specified by:
getPassCountin interfaceCategoryItemRenderer- Returns:
- The pass count.
-
getPlot
public CategoryPlot getPlot()
Returns the plot that the renderer has been assigned to (wherenullindicates that the renderer is not currently assigned to a plot).- Specified by:
getPlotin interfaceCategoryItemRenderer- Returns:
- The plot (possibly
null). - See Also:
setPlot(CategoryPlot)
-
setPlot
public void setPlot(CategoryPlot plot)
Sets the plot that the renderer has been assigned to. This method is usually called by theCategoryPlot, in normal usage you shouldn't need to call this method directly.- Specified by:
setPlotin interfaceCategoryItemRenderer- Parameters:
plot- the plot (nullnot permitted).- See Also:
getPlot()
-
getItemLabelGenerator
public CategoryItemLabelGenerator getItemLabelGenerator(int row, int column)
Returns the item 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 interfaceCategoryItemRenderer- Parameters:
row- the row index (zero based).column- the column index (zero based).- Returns:
- The generator (possibly
null).
-
getSeriesItemLabelGenerator
public CategoryItemLabelGenerator getSeriesItemLabelGenerator(int series)
Returns the item label generator for a series.- Specified by:
getSeriesItemLabelGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero based).- Returns:
- The generator (possibly
null). - See Also:
setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
-
setSeriesItemLabelGenerator
public void setSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator)Sets the item label generator for a series and sends aRendererChangeEventto all registered listeners.- Specified by:
setSeriesItemLabelGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero based).generator- the generator (nullpermitted).- See Also:
getSeriesItemLabelGenerator(int)
-
getBaseItemLabelGenerator
public CategoryItemLabelGenerator getBaseItemLabelGenerator()
Returns the base item label generator.- Specified by:
getBaseItemLabelGeneratorin interfaceCategoryItemRenderer- Returns:
- The generator (possibly
null). - See Also:
setBaseItemLabelGenerator(CategoryItemLabelGenerator)
-
setBaseItemLabelGenerator
public void setBaseItemLabelGenerator(CategoryItemLabelGenerator generator)
Sets the base item label generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setBaseItemLabelGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getBaseItemLabelGenerator()
-
getToolTipGenerator
public CategoryToolTipGenerator getToolTipGenerator(int row, int column)
Returns the tool tip generator that should be used for the specified item. This method looks up the generator using the "three-layer" approach outlined in the general description of this interface. You can override this method if you want to return a different generator per item.- Specified by:
getToolTipGeneratorin interfaceCategoryItemRenderer- Parameters:
row- the row index (zero-based).column- the column index (zero-based).- Returns:
- The generator (possibly
null).
-
getSeriesToolTipGenerator
public CategoryToolTipGenerator getSeriesToolTipGenerator(int series)
Returns the tool tip generator for the specified series (a "layer 1" generator).- Specified by:
getSeriesToolTipGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero-based).- Returns:
- The tool tip generator (possibly
null). - See Also:
setSeriesToolTipGenerator(int, CategoryToolTipGenerator)
-
setSeriesToolTipGenerator
public void setSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator)Sets the tool tip generator for a series and sends aRendererChangeEventto all registered listeners.- Specified by:
setSeriesToolTipGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero-based).generator- the generator (nullpermitted).- See Also:
getSeriesToolTipGenerator(int)
-
getBaseToolTipGenerator
public CategoryToolTipGenerator getBaseToolTipGenerator()
Returns the base tool tip generator (the "layer 2" generator).- Specified by:
getBaseToolTipGeneratorin interfaceCategoryItemRenderer- Returns:
- The tool tip generator (possibly
null). - See Also:
setBaseToolTipGenerator(CategoryToolTipGenerator)
-
setBaseToolTipGenerator
public void setBaseToolTipGenerator(CategoryToolTipGenerator generator)
Sets the base tool tip generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setBaseToolTipGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getBaseToolTipGenerator()
-
getItemURLGenerator
public CategoryURLGenerator getItemURLGenerator(int row, int column)
Returns the URL generator for a data item. This method just calls the getSeriesItemURLGenerator method, but you can override this behaviour if you want to.- Specified by:
getItemURLGeneratorin interfaceCategoryItemRenderer- Parameters:
row- the row index (zero based).column- the column index (zero based).- Returns:
- The URL generator.
-
getSeriesItemURLGenerator
public CategoryURLGenerator getSeriesItemURLGenerator(int series)
Returns the URL generator for a series.- Specified by:
getSeriesItemURLGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero based).- Returns:
- The URL generator for the series.
- See Also:
setSeriesItemURLGenerator(int, CategoryURLGenerator)
-
setSeriesItemURLGenerator
public void setSeriesItemURLGenerator(int series, CategoryURLGenerator generator)Sets the URL generator for a series and sends aRendererChangeEventto all registered listeners.- Specified by:
setSeriesItemURLGeneratorin interfaceCategoryItemRenderer- Parameters:
series- the series index (zero based).generator- the generator.- See Also:
getSeriesItemURLGenerator(int)
-
getBaseItemURLGenerator
public CategoryURLGenerator getBaseItemURLGenerator()
Returns the base item URL generator.- Specified by:
getBaseItemURLGeneratorin interfaceCategoryItemRenderer- Returns:
- The item URL generator.
- See Also:
setBaseItemURLGenerator(CategoryURLGenerator)
-
setBaseItemURLGenerator
public void setBaseItemURLGenerator(CategoryURLGenerator generator)
Sets the base item URL generator and sends aRendererChangeEventto all registered listeners.- Specified by:
setBaseItemURLGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the item URL generator (nullpermitted).- See Also:
getBaseItemURLGenerator()
-
getRowCount
public int getRowCount()
Returns the number of rows in the dataset. This value is updated in theinitialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, int, org.jfree.chart.plot.PlotRenderingInfo)method.- Returns:
- The row count.
-
getColumnCount
public int getColumnCount()
Returns the number of columns in the dataset. This value is updated in theinitialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, int, org.jfree.chart.plot.PlotRenderingInfo)method.- Returns:
- The column count.
-
initialise
public CategoryItemRendererState initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)
Initialises the renderer and returns a state object that will be used for the remainder of the drawing process for a single chart. The state object allows for the fact that the renderer may be used simultaneously by multiple threads (each thread will work with a separate state object).- Specified by:
initialisein interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.dataArea- the data area.plot- the plot.rendererIndex- the renderer index.info- an object for returning information about the structure of the plot (nullpermitted).- Returns:
- The renderer state.
-
findRangeBounds
public Range findRangeBounds(CategoryDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset.- Specified by:
findRangeBoundsin interfaceCategoryItemRenderer- Parameters:
dataset- the dataset (nullpermitted).- Returns:
- The range (or
nullif the dataset isnullor empty).
-
getItemMiddle
public double getItemMiddle(java.lang.Comparable rowKey, java.lang.Comparable columnKey, CategoryDataset dataset, CategoryAxis axis, java.awt.geom.Rectangle2D area, org.jfree.ui.RectangleEdge edge)Returns the Java2D coordinate for the middle of the specified data item.- Specified by:
getItemMiddlein interfaceCategoryItemRenderer- Parameters:
rowKey- the row key.columnKey- the column key.dataset- the dataset.axis- the axis.area- the data area.edge- the edge along which the axis lies.- Returns:
- The Java2D coordinate for the middle of the item.
- Since:
- 1.0.11
-
drawBackground
public void drawBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)Draws a background for the data area. The default implementation just gets the plot to draw the background, but some renderers will override this behaviour.- Specified by:
drawBackgroundin interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.plot- the plot.dataArea- the data area.
-
drawOutline
public void drawOutline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)Draws an outline for the data area. The default implementation just gets the plot to draw the outline, but some renderers will override this behaviour.- Specified by:
drawOutlinein interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.plot- the plot.dataArea- the data area.
-
drawDomainGridline
public void drawDomainGridline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, double value)Draws a grid line against the domain axis.Note that this default implementation assumes that the horizontal axis is the domain axis. If this is not the case, you will need to override this method.
- Specified by:
drawDomainGridlinein interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.plot- the plot.dataArea- the area for plotting data (not yet adjusted for any 3D effect).value- the Java2D value at which the grid line should be drawn.- See Also:
drawRangeGridline(Graphics2D, CategoryPlot, ValueAxis, Rectangle2D, double)
-
drawRangeGridline
public void drawRangeGridline(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)Draws a grid line against the range axis.- Specified by:
drawRangeGridlinein interfaceCategoryItemRenderer- 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.- See Also:
drawDomainGridline(Graphics2D, CategoryPlot, Rectangle2D, double)
-
drawRangeLine
public void drawRangeLine(java.awt.Graphics2D g2, CategoryPlot 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.- 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.13
- See Also:
drawRangeGridline(java.awt.Graphics2D, org.jfree.chart.plot.CategoryPlot, org.jfree.chart.axis.ValueAxis, java.awt.geom.Rectangle2D, double)
-
drawDomainMarker
public void drawDomainMarker(java.awt.Graphics2D g2, CategoryPlot plot, CategoryAxis axis, CategoryMarker marker, java.awt.geom.Rectangle2D dataArea)Draws a marker for the domain axis.- Specified by:
drawDomainMarkerin interfaceCategoryItemRenderer- Parameters:
g2- the graphics device (notnull).plot- the plot (notnull).axis- the range axis (notnull).marker- the marker to be drawn (notnull).dataArea- the area inside the axes (notnull).- See Also:
drawRangeMarker(Graphics2D, CategoryPlot, ValueAxis, Marker, Rectangle2D)
-
drawRangeMarker
public void drawRangeMarker(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)Draws a marker for the range axis.- Specified by:
drawRangeMarkerin interfaceCategoryItemRenderer- Parameters:
g2- the graphics device (notnull).plot- the plot (notnull).axis- the range axis (notnull).marker- the marker to be drawn (notnull).dataArea- the area inside the axes (notnull).- See Also:
drawDomainMarker(Graphics2D, CategoryPlot, CategoryAxis, CategoryMarker, Rectangle2D)
-
getLegendItem
public LegendItem getLegendItem(int datasetIndex, int series)
Returns a legend item for a series. This default implementation will returnnullifAbstractRenderer.isSeriesVisible(int)orAbstractRenderer.isSeriesVisibleInLegend(int)returnsfalse.- Specified by:
getLegendItemin interfaceCategoryItemRenderer- Parameters:
datasetIndex- the dataset index (zero-based).series- the series index (zero-based).- Returns:
- The legend item (possibly
null). - See Also:
getLegendItems()
-
equals
public boolean equals(java.lang.Object obj)
Tests this renderer for equality with another object.- Overrides:
equalsin classAbstractRenderer- Parameters:
obj- the object.- Returns:
trueorfalse.
-
hashCode
public int hashCode()
Returns a hash code for the renderer.- Overrides:
hashCodein classAbstractRenderer- Returns:
- The hash code.
-
getDrawingSupplier
public DrawingSupplier getDrawingSupplier()
Returns the drawing supplier from the plot.- Specified by:
getDrawingSupplierin classAbstractRenderer- Returns:
- The drawing supplier (possibly
null).
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns an independent copy of the renderer. Theplotreference is shallow copied.- Specified by:
clonein interfaceorg.jfree.util.PublicCloneable- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- can be thrown if one of the objects belonging to the renderer does not support cloning (for example, an item label generator).
-
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). - See Also:
getLegendItem(int, int)
-
getLegendItemLabelGenerator
public CategorySeriesLabelGenerator getLegendItemLabelGenerator()
Returns the legend item label generator.- Returns:
- The label generator (never
null). - See Also:
setLegendItemLabelGenerator(CategorySeriesLabelGenerator)
-
setLegendItemLabelGenerator
public void setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item label generator and sends aRendererChangeEventto all registered listeners.- Parameters:
generator- the generator (nullnot permitted).- See Also:
getLegendItemLabelGenerator()
-
getLegendItemToolTipGenerator
public CategorySeriesLabelGenerator getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.- Returns:
- The tool tip generator (possibly
null). - See Also:
setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
-
setLegendItemToolTipGenerator
public void setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends aRendererChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
setLegendItemToolTipGenerator(CategorySeriesLabelGenerator)
-
getLegendItemURLGenerator
public CategorySeriesLabelGenerator getLegendItemURLGenerator()
Returns the legend item URL generator.- Returns:
- The URL generator (possibly
null). - See Also:
setLegendItemURLGenerator(CategorySeriesLabelGenerator)
-
setLegendItemURLGenerator
public void setLegendItemURLGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item URL generator and sends aRendererChangeEventto all registered listeners.- Parameters:
generator- the generator (nullpermitted).- See Also:
getLegendItemURLGenerator()
-
setItemLabelGenerator
public void setItemLabelGenerator(CategoryItemLabelGenerator generator)
Deprecated. This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)andsetBaseItemLabelGenerator(CategoryItemLabelGenerator).Sets the item label generator for ALL series and sends aRendererChangeEventto all registered listeners.- Specified by:
setItemLabelGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the generator (nullpermitted).
-
getToolTipGenerator
public CategoryToolTipGenerator getToolTipGenerator()
Deprecated. This method should no longer be used (as of version 1.0.6). It is sufficient to rely ongetSeriesToolTipGenerator(int)andgetBaseToolTipGenerator().Returns the tool tip generator that will be used for ALL items in the dataset (the "layer 0" generator).- Specified by:
getToolTipGeneratorin interfaceCategoryItemRenderer- Returns:
- A tool tip generator (possibly
null). - See Also:
setToolTipGenerator(CategoryToolTipGenerator)
-
setToolTipGenerator
public void setToolTipGenerator(CategoryToolTipGenerator generator)
Deprecated. This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesToolTipGenerator(int, CategoryToolTipGenerator)andsetBaseToolTipGenerator(CategoryToolTipGenerator).Sets the tool tip generator for ALL series and sends aRendererChangeEventto all registered listeners.- Specified by:
setToolTipGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the generator (nullpermitted).- See Also:
getToolTipGenerator()
-
setItemURLGenerator
public void setItemURLGenerator(CategoryURLGenerator generator)
Deprecated. This method should no longer be used (as of version 1.0.6). It is sufficient to rely onsetSeriesItemURLGenerator(int, CategoryURLGenerator)andsetBaseItemURLGenerator(CategoryURLGenerator).Sets the item URL generator for ALL series and sends aRendererChangeEventto all registered listeners.- Specified by:
setItemURLGeneratorin interfaceCategoryItemRenderer- Parameters:
generator- the generator.- See Also:
CategoryItemRenderer.getSeriesItemURLGenerator(int)
-
-
DMelt 3.0 © DataMelt by jWork.ORG