com.jrefinery.chart
Interface CategoryItemRenderer

All Known Implementing Classes:
AbstractCategoryItemRenderer, AreaCategoryItemRenderer, BarRenderer, HorizontalBarRenderer, HorizontalBarRenderer3D, HorizontalIntervalBarRenderer, LineAndShapeRenderer, StackedHorizontalBarRenderer, StackedVerticalBarRenderer, StackedVerticalBarRenderer3D, VerticalBarRenderer, VerticalBarRenderer3D, VerticalIntervalBarRenderer

public interface CategoryItemRenderer

Defines the interface for a category item renderer.


Method Summary
 void drawCategoryItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, ValueAxis axis, CategoryDataset data, int series, java.lang.Object category, int categoryIndex, java.lang.Object previousCategory)
          Draw a single data item.
 void drawPlotBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D axisDataArea, java.awt.Shape dataClipRegion)
          Draws the background for the plot.
 void drawRangeMarker(java.awt.Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, java.awt.geom.Rectangle2D axisDataArea, java.awt.Shape dataClipRegion)
          Draws a line (or some other marker) to indicate a certain value on the range axis.
 java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D plotArea)
          Returns the area that the axes must fit into.
 java.awt.Shape getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
          Returns the clip region...usually returns the dataArea, but some charts (e.g.
 void initialise(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryDataset data, ChartRenderingInfo info)
          Initialises the renderer.
 boolean isStacked()
          Returns true if the data values are stacked, and false otherwise.
 

Method Detail

initialise

void initialise(java.awt.Graphics2D g2,
                java.awt.geom.Rectangle2D dataArea,
                CategoryPlot plot,
                CategoryDataset data,
                ChartRenderingInfo info)
Initialises the renderer. This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.

Parameters:
g2 - The graphics device.
dataArea - The area inside the axes.
plot - The plot.
data - The data.
info - Collects chart rendering information for return to caller.

isStacked

boolean isStacked()
Returns true if the data values are stacked, and false otherwise.

If the data values are stacked, this affects the axis range required to display all the data items.

Returns:
A flag indicating whether or not the data values are stacked.

getAxisArea

java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D plotArea)
Returns the area that the axes must fit into. 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).


getDataClipRegion

java.awt.Shape getDataClipRegion(java.awt.geom.Rectangle2D dataArea)
Returns the clip region...usually returns the dataArea, but some charts (e.g. 3D) have non rectangular clip regions.


drawPlotBackground

void drawPlotBackground(java.awt.Graphics2D g2,
                        CategoryPlot plot,
                        java.awt.geom.Rectangle2D axisDataArea,
                        java.awt.Shape dataClipRegion)
Draws the background for the plot.

For most charts, the axisDataArea and the dataClipArea are the same. One case where they are different is the 3D-effect bar charts...here the data clip area extends above and to the right of the axisDataArea.

Parameters:
g2 - The graphics device.
plot - The plot.
axisDataArea - The area inside the axes.
dataClipArea - The data clip area.

drawRangeMarker

void drawRangeMarker(java.awt.Graphics2D g2,
                     CategoryPlot plot,
                     ValueAxis axis,
                     Marker marker,
                     java.awt.geom.Rectangle2D axisDataArea,
                     java.awt.Shape dataClipRegion)
Draws a line (or some other marker) to indicate a certain value on the range axis.

Parameters:
g2 - The graphics device.
plot - The plot.
axis - The value axis.
marker - The marker.
axisDataArea - The area defined by the axes.
dataClipRegion - The data clip region.

drawCategoryItem

void drawCategoryItem(java.awt.Graphics2D g2,
                      java.awt.geom.Rectangle2D dataArea,
                      CategoryPlot plot,
                      ValueAxis axis,
                      CategoryDataset data,
                      int series,
                      java.lang.Object category,
                      int categoryIndex,
                      java.lang.Object previousCategory)
Draw a single data item.

Parameters:
g2 - The graphics device.
plotArea - The data plot area.
plot - The plot.
axis - The range axis.
data - The data.
series - The series number (zero-based index).
category - The category.
categoryIndex - The category number (zero-based index).
previousCategory - The previous category (will be null when the first category is drawn).


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.