|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.AbstractRenderer | +--com.jrefinery.chart.AbstractCategoryItemRenderer
Abstract base class for category item renderers.
Constructor Summary | |
protected |
AbstractCategoryItemRenderer()
Creates a renderer with no tool tip generator and no URL generator. |
protected |
AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator)
Constructs a new renderer with the specified tooltip generator. |
protected |
AbstractCategoryItemRenderer(CategoryToolTipGenerator toolTipGenerator,
CategoryURLGenerator urlGenerator)
Constructs a new renderer with the specified tooltip generator. |
protected |
AbstractCategoryItemRenderer(CategoryURLGenerator urlGenerator)
Constructs a new renderer with the specified URL generator. |
Method Summary | |
void |
drawPlotBackground(java.awt.Graphics2D g2,
CategoryPlot plot,
java.awt.geom.Rectangle2D axisDataArea,
java.awt.Shape dataClipArea)
Draws the background for the plot. |
java.awt.geom.Rectangle2D |
getAxisArea(java.awt.geom.Rectangle2D plotArea)
Returns the area that the axes (and data) must fit into. |
java.awt.Paint[] |
getCategoriesPaint()
Returns the paint to use for the categories when there is just one series. |
java.awt.Paint |
getCategoryPaint(int index)
Returns the paint for a specific category (possibly null). |
java.awt.Shape |
getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
Returns the clip region... |
LegendItem |
getLegendItem(int series)
Returns a legend item for a series. |
CategoryPlot |
getPlot()
Returns the plot. |
CategoryToolTipGenerator |
getToolTipGenerator()
Returns the tool tip generator. |
CategoryURLGenerator |
getURLGenerator()
Returns the URL generator for HTML image maps. |
boolean |
getUseCategoriesPaint()
Returns the flag that controls whether or not the renderer uses the category paint settings. |
void |
initialise(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D dataArea,
CategoryPlot plot,
ValueAxis axis,
CategoryDataset data,
ChartRenderingInfo info)
Initialises the renderer. |
boolean |
isStacked()
Returns a flag indicating whether the items within one category are stacked up when represented by the renderer. |
void |
setCategoriesPaint(java.awt.Paint[] paint)
Sets the paint to be used for categories under special circumstances. |
void |
setPlot(CategoryPlot plot)
Sets the plot. |
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 com.jrefinery.chart.AbstractRenderer |
addPropertyChangeListener, firePropertyChanged, getInfo, removePropertyChangeListener, setInfo |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.jrefinery.chart.CategoryItemRenderer |
drawCategoryItem, drawRangeMarker |
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 CategoryPlot getPlot()
getPlot
in interface CategoryItemRenderer
public void setPlot(CategoryPlot plot)
setPlot
in interface CategoryItemRenderer
plot
- the plot.public boolean getUseCategoriesPaint()
public java.awt.Paint[] getCategoriesPaint()
If this is null, the categories will all have the same color (that of the series).
public void setCategoriesPaint(java.awt.Paint[] paint)
This attribute is provided for the situation where there is just one series, and you want each category item to be plotted using a different color (ordinarily, the series color is used for all the items in the series).
May not be observed by all subclasses yet.
paint
- The colors.public java.awt.Paint getCategoryPaint(int index)
index
- The category index.public CategoryToolTipGenerator getToolTipGenerator()
public void setToolTipGenerator(CategoryToolTipGenerator generator)
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, ValueAxis axis, CategoryDataset data, 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.axis
- The axis.data
- The data.info
- An object for returning information about the structure of the chart.public boolean isStacked()
isStacked
in interface CategoryItemRenderer
public java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D plotArea)
Often this is the same as the plotArea, but sometimes a smaller region should be used (for example, the 3D charts require the axes to use less space in order to leave room for the 'depth' part of the chart).
getAxisArea
in interface CategoryItemRenderer
plotArea
- The plot area.public java.awt.Shape getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
getDataClipRegion
in interface CategoryItemRenderer
dataArea
- The data area.public void drawPlotBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D axisDataArea, java.awt.Shape dataClipArea)
For most charts, the axisDataArea and the dataClipArea are the same.
drawPlotBackground
in interface CategoryItemRenderer
g2
- The graphics device.plot
- The plot.axisDataArea
- The area inside the axes.dataClipArea
- The data clip area.public LegendItem getLegendItem(int series)
getLegendItem
in interface CategoryItemRenderer
series
- the series (zero-based index).
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |