|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jfree.chart.renderer.AbstractRenderer | +--org.jfree.chart.renderer.AbstractCategoryItemRenderer
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.
Field Summary |
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer |
DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE |
Fields inherited from interface org.jfree.chart.renderer.CategoryItemRenderer |
STACKED, STANDARD |
Constructor Summary | |
protected |
AbstractCategoryItemRenderer()
Creates a new renderer with no tool tip generator and no URL generator. |
protected |
AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator)
Creates a new renderer with the specified tooltip generator but no URL generator. |
protected |
AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator,
CategoryURLGenerator urlGenerator)
Creates a new renderer with the specified tooltip generator and URL generator. |
protected |
AbstractCategoryItemRenderer(CategoryURLGenerator urlGenerator)
Creates a new renderer with the specified URL generator but no tooltip generator. |
Method Summary | |
void |
drawBackground(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea)
Draws a background for the data area. |
void |
drawDomainGridline(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea,
double value)
Draws a grid line against the domain axis. |
void |
drawOutline(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D dataArea)
Draws an outline for the data area. |
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. |
void |
drawRangeMarker(java.awt.Graphics2D g2,
CategoryPlot plot,
ValueAxis axis,
Marker marker,
java.awt.geom.Rectangle2D dataArea)
Draws a marker for the range axis. |
boolean |
equals(java.lang.Object obj)
Tests this renderer for equality with another object. |
int |
getColumnCount()
Returns the number of columns in the dataset. |
LegendItem |
getLegendItem(int datasetIndex,
int series)
Returns a legend item for a series. |
int |
getRangeType()
Returns the range type for the renderer. |
int |
getRowCount()
Returns the number of rows in the dataset. |
CategoryToolTipGenerator |
getToolTipGenerator()
Returns the tool tip generator. |
CategoryURLGenerator |
getURLGenerator()
Returns the URL generator for HTML image maps. |
void |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
ChartRenderingInfo info)
Initialises the renderer. |
void |
setToolTipGenerator(CategoryToolTipGenerator generator)
Sets the tool tip generator. |
void |
setURLGenerator(CategoryURLGenerator urlGenerator)
Sets the URL generator for HTML image maps. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.jfree.chart.renderer.CategoryItemRenderer |
drawItem, getItemOutlinePaint, getItemPaint, getItemShape, getItemStroke, getSeriesOutlinePaint, getSeriesPaint, getSeriesShape, getSeriesStroke |
Constructor Detail |
protected AbstractCategoryItemRenderer()
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.
protected AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator)
toolTipGenerator
- the tool tip generator.protected AbstractCategoryItemRenderer(CategoryURLGenerator urlGenerator)
urlGenerator
- the URL generator.protected AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator, CategoryURLGenerator urlGenerator)
toolTipGenerator
- the tool tip generator.urlGenerator
- the URL generator.Method Detail |
public int getRowCount()
initialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, org.jfree.chart.ChartRenderingInfo)
method.
public int getColumnCount()
initialise(java.awt.Graphics2D, java.awt.geom.Rectangle2D, org.jfree.chart.plot.CategoryPlot, org.jfree.chart.ChartRenderingInfo)
method.
public CategoryToolTipGenerator getToolTipGenerator()
getToolTipGenerator
in interface CategoryItemRenderer
public void setToolTipGenerator(CategoryToolTipGenerator generator)
setToolTipGenerator
in interface CategoryItemRenderer
generator
- the tool tip generator.public CategoryURLGenerator getURLGenerator()
public void setURLGenerator(CategoryURLGenerator urlGenerator)
urlGenerator
- the URL generator.public void initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, ChartRenderingInfo info)
Stores a reference to the ChartRenderingInfo
object (which might be
null
), and then sets the useCategoriesPaint flag according to the special case
conditions a) there is only one series and b) the categoriesPaint array is not null.
initialise
in interface CategoryItemRenderer
g2
- the graphics device.dataArea
- the data area.plot
- the plot.info
- an object for returning information about the structure of the chart
(null
permitted).public int getRangeType()
The default implementation returns STANDARD
, subclasses may override this
behaviour.
The CategoryPlot
uses this information when auto-calculating the range for the axis.
getRangeType
in interface CategoryItemRenderer
public void drawBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)
drawBackground
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.dataArea
- the data area.public void drawOutline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)
drawOutline
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.dataArea
- the data area.public void drawDomainGridline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, double value)
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.
drawDomainGridline
in interface CategoryItemRenderer
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.public void drawRangeGridline(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, java.awt.geom.Rectangle2D dataArea, double value)
drawRangeGridline
in interface CategoryItemRenderer
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.public void drawRangeMarker(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D dataArea)
A marker is a constant value, usually represented by a line.
drawRangeMarker
in interface CategoryItemRenderer
g2
- the graphics device.plot
- the plot.axis
- the range axis.marker
- the marker to be drawn.dataArea
- the area inside the axes.public LegendItem getLegendItem(int datasetIndex, int series)
getLegendItem
in interface CategoryItemRenderer
datasetIndex
- the dataset index (zero-based).series
- the series index (zero-based).
public boolean equals(java.lang.Object obj)
equals
in class AbstractRenderer
obj
- the object.
true
or false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |