org.jfree.chart.renderer.category
public abstract class AbstractCategoryItemRenderer extends AbstractRenderer implements CategoryItemRenderer, Cloneable, PublicCloneable, Serializable
Constructor Summary | |
---|---|
protected | AbstractCategoryItemRenderer()
Creates a new renderer with no tool tip generator and no URL generator.
|
Method Summary | |
---|---|
protected void | addItemEntity(EntityCollection entities, CategoryDataset dataset, int row, int column, Shape hotspot)
Adds an entity with the specified hotspot.
|
protected Point2D | calculateDomainMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)
Calculates the (x, y) coordinates for drawing the label for a marker on
the range axis.
|
protected Point2D | calculateRangeMarkerTextAnchorPoint(Graphics2D g2, PlotOrientation orientation, Rectangle2D dataArea, Rectangle2D markerArea, RectangleInsets markerOffset, LengthAdjustmentType labelOffsetType, RectangleAnchor anchor)
Calculates the (x, y) coordinates for drawing a marker label.
|
Object | clone()
Returns an independent copy of the renderer. |
protected CategoryItemRendererState | createState(PlotRenderingInfo info)
Creates a new state instance---this method is called from the
AbstractCategoryItemRenderer method. |
void | drawBackground(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
Draws a background for the data area. |
void | drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)
Draws a grid line against the domain axis.
|
void | drawDomainMarker(Graphics2D g2, CategoryPlot plot, CategoryAxis axis, CategoryMarker marker, Rectangle2D dataArea)
Draws a marker for the domain axis.
|
protected void | drawItemLabel(Graphics2D g2, PlotOrientation orientation, CategoryDataset dataset, int row, int column, double x, double y, boolean negative)
Draws an item label.
|
void | drawOutline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
Draws an outline for the data area. |
void | drawRangeGridline(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)
Draws a grid line against the range axis.
|
void | drawRangeMarker(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)
Draws a marker for the range axis.
|
boolean | equals(Object obj)
Tests this renderer for equality with another object.
|
Range | findRangeBounds(CategoryDataset dataset)
Returns the range of values the renderer requires to display all the
items from the specified dataset.
|
CategoryItemLabelGenerator | getBaseItemLabelGenerator()
Returns the base item label generator.
|
CategoryURLGenerator | getBaseItemURLGenerator()
Returns the base item URL generator.
|
CategoryToolTipGenerator | getBaseToolTipGenerator()
Returns the base tool tip generator (the "layer 2" generator).
|
int | getColumnCount()
Returns the number of columns in the dataset. |
protected CategoryAxis | getDomainAxis(CategoryPlot plot, int index)
Returns a domain axis for a plot.
|
DrawingSupplier | getDrawingSupplier()
Returns the drawing supplier from the plot.
|
CategoryItemLabelGenerator | getItemLabelGenerator(int row, int column)
Returns the item label generator for a data item. |
CategoryURLGenerator | getItemURLGenerator(int row, int column)
Returns the URL generator for a data item. |
LegendItem | getLegendItem(int datasetIndex, int series)
Returns a legend item for a series.
|
CategorySeriesLabelGenerator | 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.
|
CategorySeriesLabelGenerator | getLegendItemToolTipGenerator()
Returns the legend item tool tip generator.
|
CategorySeriesLabelGenerator | getLegendItemURLGenerator()
Returns the legend item URL generator.
|
int | getPassCount()
Returns the number of passes through the dataset required by the
renderer. |
CategoryPlot | getPlot()
Returns the plot that the renderer has been assigned to (where
null indicates that the renderer is not currently assigned
to a plot).
|
protected ValueAxis | getRangeAxis(CategoryPlot plot, int index)
Returns a range axis for a plot.
|
int | getRowCount()
Returns the number of rows in the dataset. |
CategoryItemLabelGenerator | getSeriesItemLabelGenerator(int series)
Returns the item label generator for a series.
|
CategoryURLGenerator | getSeriesItemURLGenerator(int series)
Returns the URL generator for a series.
|
CategoryToolTipGenerator | getSeriesToolTipGenerator(int series)
Returns the tool tip generator for the specified series (a "layer 1"
generator).
|
CategoryToolTipGenerator | getToolTipGenerator(int row, int column)
Returns the tool tip generator that should be used for the specified
item. |
CategoryToolTipGenerator | getToolTipGenerator()
Returns the tool tip generator that will be used for ALL items in the
dataset (the "layer 0" generator).
|
int | hashCode()
Returns a hash code for the renderer.
|
CategoryItemRendererState | initialise(Graphics2D g2, 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. |
void | setBaseItemLabelGenerator(CategoryItemLabelGenerator generator)
Sets the base item label generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setBaseItemURLGenerator(CategoryURLGenerator generator)
Sets the base item URL generator.
|
void | setBaseToolTipGenerator(CategoryToolTipGenerator generator)
Sets the base tool tip generator and sends a RendererChangeEvent
to all registered listeners.
|
void | setItemLabelGenerator(CategoryItemLabelGenerator generator)
Sets the item label generator for ALL series and sends a
RendererChangeEvent to all registered listeners.
|
void | setItemURLGenerator(CategoryURLGenerator generator)
Sets the item URL generator for ALL series.
|
void | setLegendItemLabelGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item label generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendItemToolTipGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item tool tip generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setLegendItemURLGenerator(CategorySeriesLabelGenerator generator)
Sets the legend item URL generator and sends a
RendererChangeEvent to all registered listeners.
|
void | setPlot(CategoryPlot plot)
Sets the plot that the renderer has been assigned to. |
void | setSeriesItemLabelGenerator(int series, CategoryItemLabelGenerator generator)
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners.
|
void | setSeriesItemURLGenerator(int series, CategoryURLGenerator generator)
Sets the URL generator for a series.
|
void | setSeriesToolTipGenerator(int series, CategoryToolTipGenerator generator)
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered
listeners.
|
void | setToolTipGenerator(CategoryToolTipGenerator generator)
Sets the tool tip generator for ALL series and sends a
RendererChangeEvent to all registered
listeners.
|
Parameters: entities the entity collection. dataset the dataset. row the row index. column the column index. hotspot the hotspot.
Parameters: g2 the graphics device. orientation the plot orientation. dataArea the data area. markerArea the rectangle surrounding the marker. markerOffset the marker offset. labelOffsetType the label offset type. anchor the label anchor.
Returns: The coordinates for drawing the marker label.
Parameters: g2 the graphics device. orientation the plot orientation. dataArea the data area. markerArea the rectangle surrounding the marker. markerOffset the marker offset. labelOffsetType the label offset type. anchor the label anchor.
Returns: The coordinates for drawing the marker label.
plot
reference is shallow copied.
Returns: A clone.
Throws: CloneNotSupportedException can be thrown if one of the objects belonging to the renderer does not support cloning (for example, an item label generator).
Parameters: info collects plot rendering info (null
permitted).
Returns: The new state instance (never null
).
Since: 1.0.5
Parameters: g2 the graphics device. plot the plot. dataArea the data area.
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.
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: AbstractCategoryItemRenderer
Parameters: g2 the graphics device (not null
). plot the plot (not null
). axis the range axis (not null
). marker the marker to be drawn (not null
). dataArea the area inside the axes (not null
).
See Also: AbstractCategoryItemRenderer
Parameters: g2 the graphics device. orientation the orientation. dataset the dataset. row the row. column the column. x the x coordinate (in Java2D space). y the y coordinate (in Java2D space). negative indicates a negative value (which affects the item label position).
Parameters: g2 the graphics device. plot the plot. dataArea the data area.
Parameters: g2 the graphics device. plot the plot. axis the value axis. dataArea the area for plotting data (not yet adjusted for any 3D effect). value the value at which the grid line should be drawn.
Parameters: g2 the graphics device (not null
). plot the plot (not null
). axis the range axis (not null
). marker the marker to be drawn (not null
). dataArea the area inside the axes (not null
).
See Also: AbstractCategoryItemRenderer
Parameters: obj the object.
Returns: true
or false
.
Parameters: dataset the dataset (null
permitted).
Returns: The range (or null
if the dataset is
null
or empty).
Returns: The generator (possibly null
).
See Also: setBaseItemLabelGenerator
Returns: The item URL generator.
See Also: setBaseItemURLGenerator
Returns: The tool tip generator (possibly null
).
See Also: setBaseToolTipGenerator
Returns: The column count.
Parameters: plot the plot. index the axis index.
Returns: A domain axis.
Returns: The drawing supplier (possibly null
).
Parameters: row the row index (zero based). column the column index (zero based).
Returns: The generator (possibly null
).
Parameters: row the row index (zero based). column the column index (zero based).
Returns: The URL generator.
Parameters: datasetIndex the dataset index (zero-based). series the series index (zero-based).
Returns: The legend item.
See Also: getLegendItems
Returns: The label generator (never null
).
See Also: setLegendItemLabelGenerator
Returns: The legend item collection (never null
).
See Also: AbstractCategoryItemRenderer
Returns: The tool tip generator (possibly null
).
See Also: setLegendItemToolTipGenerator
Returns: The URL generator (possibly null
).
See Also: setLegendItemURLGenerator
1
, subclasses should
override if they need more passes.
Returns: The pass count.
null
indicates that the renderer is not currently assigned
to a plot).
Returns: The plot (possibly null
).
See Also: setPlot
Parameters: plot the plot. index the axis index.
Returns: A range axis.
Returns: The row count.
Parameters: series the series index (zero based).
Returns: The generator (possibly null
).
See Also: AbstractCategoryItemRenderer
Parameters: series the series index (zero based).
Returns: The URL generator for the series.
See Also: AbstractCategoryItemRenderer
Parameters: series the series index (zero-based).
Returns: The tool tip generator (possibly null
).
See Also: AbstractCategoryItemRenderer
Parameters: row the row index (zero-based). column the column index (zero-based).
Returns: The generator (possibly null
).
Returns: A tool tip generator (possibly null
).
See Also: setToolTipGenerator
Returns: The hash code.
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 (null
permitted).
Returns: The renderer state.
Parameters: generator the generator (null
permitted).
See Also: getBaseItemLabelGenerator
Parameters: generator the item URL generator.
See Also: getBaseItemURLGenerator
Parameters: generator the generator (null
permitted).
See Also: getBaseToolTipGenerator
Parameters: generator the generator (null
permitted).
Parameters: generator the generator.
Parameters: generator the generator (null
not permitted).
See Also: getLegendItemLabelGenerator
Parameters: generator the generator (null
permitted).
See Also: setLegendItemToolTipGenerator
Parameters: generator the generator (null
permitted).
See Also: getLegendItemURLGenerator
Parameters: plot the plot (null
not permitted).
See Also: getPlot
Parameters: series the series index (zero based). generator the generator (null
permitted).
See Also: AbstractCategoryItemRenderer
Parameters: series the series index (zero based). generator the generator.
See Also: AbstractCategoryItemRenderer
Parameters: series the series index (zero-based). generator the generator (null
permitted).
See Also: AbstractCategoryItemRenderer
Parameters: generator the generator (null
permitted).
See Also: getToolTipGenerator