java.lang.Object | ||
↳ | org.jfree.chart.renderer.AbstractRenderer | |
↳ | org.jfree.chart.renderer.category.AbstractCategoryItemRenderer |
Known Direct Subclasses |
Known Indirect Subclasses |
An abstract base class that you can use to implement a new
CategoryItemRenderer
. When you create a new
CategoryItemRenderer
you are not required to extend this class,
but it makes the job easier.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.jfree.chart.renderer.AbstractRenderer
|
Protected Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new renderer with no tool tip generator and no URL generator.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Returns an independent copy of the renderer.
| |||||||||||
Draws a background for the data area.
| |||||||||||
Draws a grid line against the domain axis.
| |||||||||||
Draws a marker for the domain axis.
| |||||||||||
Draws an outline for the data area.
| |||||||||||
Draws a grid line against the range axis.
| |||||||||||
Draws a line perpendicular to the range axis.
| |||||||||||
Draws a marker for the range axis.
| |||||||||||
Tests this renderer for equality with another object.
| |||||||||||
Returns the range of values the renderer requires to display all the
items from the specified dataset.
| |||||||||||
Returns the base item label generator.
| |||||||||||
Returns the base item URL generator.
| |||||||||||
Returns the base tool tip generator (the "layer 2" generator).
| |||||||||||
Returns the number of columns in the dataset.
| |||||||||||
Returns the drawing supplier from the plot.
| |||||||||||
Returns the item label generator for a data item.
| |||||||||||
Returns the Java2D coordinate for the middle of the specified data item.
| |||||||||||
Returns the URL generator for a data item.
| |||||||||||
Returns a legend item for a series.
| |||||||||||
Returns the legend item label generator.
| |||||||||||
Returns the legend item tool tip generator.
| |||||||||||
Returns the legend item URL generator.
| |||||||||||
Returns a (possibly empty) collection of legend items for the series
that this renderer is responsible for drawing.
| |||||||||||
Returns the number of passes through the dataset required by the
renderer.
| |||||||||||
Returns the plot that the renderer has been assigned to (where
null indicates that the renderer is not currently assigned
to a plot). | |||||||||||
Returns the number of rows in the dataset.
| |||||||||||
Returns the item label generator for a series.
| |||||||||||
Returns the URL generator for a series.
| |||||||||||
Returns the tool tip generator for the specified series (a "layer 1"
generator).
| |||||||||||
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on
getSeriesToolTipGenerator(int)
and getBaseToolTipGenerator() .
| |||||||||||
Returns the tool tip generator that should be used for the specified
item.
| |||||||||||
Returns a hash code for the renderer.
| |||||||||||
Initialises the renderer and returns a state object that will be used
for the remainder of the drawing process for a single chart.
| |||||||||||
Sets the base item label generator and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the base item URL generator and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the base tool tip generator and sends a
RendererChangeEvent
to all registered listeners. | |||||||||||
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on
setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator) and
setBaseItemLabelGenerator(CategoryItemLabelGenerator) .
| |||||||||||
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on
setSeriesItemURLGenerator(int, CategoryURLGenerator) and
setBaseItemURLGenerator(CategoryURLGenerator) .
| |||||||||||
Sets the legend item label generator and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the legend item tool tip generator and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the legend item URL generator and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the plot that the renderer has been assigned to.
| |||||||||||
Sets the item label generator for a series and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the URL generator for a series and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
Sets the tool tip generator for a series and sends a
RendererChangeEvent to all registered listeners. | |||||||||||
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on
setSeriesToolTipGenerator(int, CategoryToolTipGenerator) and
setBaseToolTipGenerator(CategoryToolTipGenerator) .
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds an entity to the collection.
| |||||||||||
Adds an entity with the specified hotspot.
| |||||||||||
Calculates the (x, y) coordinates for drawing the label for a marker on
the range axis.
| |||||||||||
Calculates the (x, y) coordinates for drawing a marker label.
| |||||||||||
Creates a new state instance---this method is called from the
initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo) method. | |||||||||||
Draws an item label.
| |||||||||||
Returns the range of values the renderer requires to display all the
items from the specified dataset.
| |||||||||||
Returns a domain axis for a plot.
| |||||||||||
Returns a range axis for a plot.
| |||||||||||
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).
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.jfree.chart.renderer.AbstractRenderer
| |||||||||||
From class
java.lang.Object
| |||||||||||
From interface
org.jfree.chart.LegendItemSource
| |||||||||||
From interface
org.jfree.chart.renderer.category.CategoryItemRenderer
|
Creates a new renderer with no tool tip generator and no URL generator. The defaults (no tool tip or URL generators) have been chosen to minimise the processing required to generate a default chart. If you require tool tips or URLs, then you can easily add the required generators.
Returns an independent copy of the renderer. The plot
reference is shallow copied.
CloneNotSupportedException | can be thrown if one of the objects belonging to the renderer does not support cloning (for example, an item label generator). |
---|
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.
g2 | the graphics device. |
---|---|
plot | the plot. |
dataArea | the data area. |
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.
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. |
Draws a marker for the domain axis.
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 ). |
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.
g2 | the graphics device. |
---|---|
plot | the plot. |
dataArea | the data area. |
Draws a grid line against the range axis.
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. |
Draws a line perpendicular to the range axis.
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 (null not permitted). |
stroke | the stroke (null not permitted). |
Draws a marker for the range axis.
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 ). |
Tests this renderer for equality with another object.
obj | the object. |
---|
true
or false
.
Returns the range of values the renderer requires to display all the items from the specified dataset.
dataset | the dataset (null permitted). |
---|
null
if the dataset is
null
or empty).
Returns the base item label generator.
null
).Returns the base item URL generator.
Returns the base tool tip generator (the "layer 2" generator).
null
).Returns the number of columns in the dataset. This value is updated in
the initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo)
method.
Returns the drawing supplier from the plot.
null
).
Returns the item label generator for a data item. This implementation
simply passes control to the getSeriesItemLabelGenerator(int)
method. If, for some reason, you want a different generator for
individual items, you can override this method.
row | the row index (zero based). |
---|---|
column | the column index (zero based). |
null
).
Returns the Java2D coordinate for the middle of the specified data item.
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 URL generator for a data item. This method just calls the getSeriesItemURLGenerator method, but you can override this behaviour if you want to.
row | the row index (zero based). |
---|---|
column | the column index (zero based). |
Returns a legend item for a series. This default implementation will
return null
if isSeriesVisible(int)
or
isSeriesVisibleInLegend(int)
returns false
.
datasetIndex | the dataset index (zero-based). |
---|---|
series | the series index (zero-based). |
null
).Returns the legend item label generator.
null
).Returns the legend item tool tip generator.
null
).Returns the legend item URL generator.
null
).Returns a (possibly empty) collection of legend items for the series that this renderer is responsible for drawing.
null
).Returns the number of passes through the dataset required by the
renderer. This method returns 1
, subclasses should
override if they need more passes.
Returns the plot that the renderer has been assigned to (where
null
indicates that the renderer is not currently assigned
to a plot).
null
).Returns the number of rows in the dataset. This value is updated in the
initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo)
method.
Returns the item label generator for a series.
series | the series index (zero based). |
---|
null
).Returns the URL generator for a series.
series | the series index (zero based). |
---|
Returns the tool tip generator for the specified series (a "layer 1" generator).
series | the series index (zero-based). |
---|
null
).
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on getSeriesToolTipGenerator(int)
and getBaseToolTipGenerator()
.
Returns the tool tip generator that will be used for ALL items in the dataset (the "layer 0" generator).
null
).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.
row | the row index (zero-based). |
---|---|
column | the column index (zero-based). |
null
).
Returns a hash code for the renderer.
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).
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). |
Sets the base item label generator and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
Sets the base item URL generator and sends a
RendererChangeEvent
to all registered listeners.
generator | the item URL generator (null permitted). |
---|
Sets the base tool tip generator and sends a RendererChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on setSeriesItemLabelGenerator(int, CategoryItemLabelGenerator)
and
setBaseItemLabelGenerator(CategoryItemLabelGenerator)
.
Sets the item label generator for ALL series and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on setSeriesItemURLGenerator(int, CategoryURLGenerator)
and
setBaseItemURLGenerator(CategoryURLGenerator)
.
Sets the item URL generator for ALL series and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator. |
---|
Sets the legend item label generator and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator (null not permitted). |
---|
Sets the legend item tool tip generator and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
Sets the legend item URL generator and sends a
RendererChangeEvent
to all registered listeners.
generator | the generator (null permitted). |
---|
Sets the plot that the renderer has been assigned to. This method is
usually called by the CategoryPlot
, in normal usage you
shouldn't need to call this method directly.
plot | the plot (null not permitted). |
---|
Sets the item label generator for a series and sends a
RendererChangeEvent
to all registered listeners.
series | the series index (zero based). |
---|---|
generator | the generator (null permitted). |
Sets the URL generator for a series and sends a
RendererChangeEvent
to all registered listeners.
series | the series index (zero based). |
---|---|
generator | the generator. |
Sets the tool tip generator for a series and sends a
RendererChangeEvent
to all registered listeners.
series | the series index (zero-based). |
---|---|
generator | the generator (null permitted). |
This method is deprecated.
This method should no longer be used (as of version 1.0.6).
It is sufficient to rely on setSeriesToolTipGenerator(int, CategoryToolTipGenerator)
and
setBaseToolTipGenerator(CategoryToolTipGenerator)
.
Sets the tool tip generator for ALL series and sends a
RendererChangeEvent
to all registered
listeners.
generator | the generator (null permitted). |
---|
Adds an entity to the collection.
entities | the entity collection being populated. |
---|---|
hotspot | the entity area (if null a default will be
used). |
dataset | the dataset. |
row | the series. |
column | the item. |
entityX | the entity's center x-coordinate in user space (only
used if area is null ). |
entityY | the entity's center y-coordinate in user space (only
used if area is null ). |
Adds an entity with the specified hotspot.
entities | the entity collection. |
---|---|
dataset | the dataset. |
row | the row index. |
column | the column index. |
hotspot | the hotspot (null not permitted).
|
Calculates the (x, y) coordinates for drawing the label for a marker on the range axis.
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. |
Calculates the (x, y) coordinates for drawing a marker label.
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. |
Creates a new state instance---this method is called from the
initialise(Graphics2D, Rectangle2D, CategoryPlot, int, PlotRenderingInfo)
method. Subclasses can override this method if
they need to use a subclass of CategoryItemRendererState
.
info | collects plot rendering info (null permitted). |
---|
null
).Draws an item label.
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). |
Returns the range of values the renderer requires to display all the items from the specified dataset.
dataset | the dataset (null permitted). |
---|---|
includeInterval | include the y-interval if the dataset has one. |
null
if the dataset is null
or empty).Returns a domain axis for a plot.
plot | the plot. |
---|---|
index | the axis index. |
Returns a range axis for a plot.
plot | the plot. |
---|---|
index | the axis index. |
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).
crosshairState | the crosshair state (null permitted,
but the method does nothing in that case). |
---|---|
rowKey | the row key. |
columnKey | the column key. |
value | the data value. |
datasetIndex | the dataset index. |
transX | the x-value translated to Java2D space. |
transY | the y-value translated to Java2D space. |
orientation | the plot orientation (null not
permitted). |