com.jrefinery.chart
Class VerticalBarRenderer3D

java.lang.Object
  extended by com.jrefinery.chart.AbstractCategoryItemRenderer
      extended by com.jrefinery.chart.BarRenderer
          extended by com.jrefinery.chart.VerticalBarRenderer
              extended by com.jrefinery.chart.VerticalBarRenderer3D
All Implemented Interfaces:
CategoryItemRenderer
Direct Known Subclasses:
StackedVerticalBarRenderer3D

public class VerticalBarRenderer3D
extends VerticalBarRenderer

A renderer for 3D-effect bars...


Field Summary
protected  double effect3d
          The size of the 3D effect (in pixels).
 
Fields inherited from class com.jrefinery.chart.BarRenderer
BAR_OUTLINE_WIDTH_THRESHOLD, categoryGapSpan, categorySpan, itemGapSpan, itemSpan, itemWidth, zeroInJava2D
 
Fields inherited from class com.jrefinery.chart.AbstractCategoryItemRenderer
info, toolTipGenerator
 
Constructor Summary
VerticalBarRenderer3D()
          Default constructor, creates a renderer with a standard tool tip generator and a ten pixel '3D effect'.
VerticalBarRenderer3D(com.jrefinery.chart.tooltips.CategoryToolTipGenerator toolTipGenerator, double effect3d)
          Constructs a new renderer with a specific tool tip generator and '3D effect'.
 
Method Summary
 int barWidthsPerCategory(CategoryDataset data)
          This will be a method in the renderer that tells whether there is one bar width per category or onebarwidth per series per category.
 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)
          Renders an individual bar.
 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 range marker.
 java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D dataArea)
          Returns the area that the axes (and data) 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.
 boolean hasItemGaps()
          Returns true, since there are (potentially) gaps between bars in this representation.
 
Methods inherited from class com.jrefinery.chart.VerticalBarRenderer
initialise
 
Methods inherited from class com.jrefinery.chart.BarRenderer
calculateCategoryAndItemSpans, isStacked
 
Methods inherited from class com.jrefinery.chart.AbstractCategoryItemRenderer
getToolTipGenerator, setToolTipGenerator
 
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
isStacked
 

Field Detail

effect3d

protected double effect3d
The size of the 3D effect (in pixels).

Constructor Detail

VerticalBarRenderer3D

public VerticalBarRenderer3D()
Default constructor, creates a renderer with a standard tool tip generator and a ten pixel '3D effect'.


VerticalBarRenderer3D

public VerticalBarRenderer3D(com.jrefinery.chart.tooltips.CategoryToolTipGenerator toolTipGenerator,
                             double effect3d)
Constructs a new renderer with a specific tool tip generator and '3D effect'.

Parameters:
toolTipGenerator - The tool tip generator.
effect3d - The size of the 3D effect (in pixels).
Method Detail

hasItemGaps

public boolean hasItemGaps()
Returns true, since there are (potentially) gaps between bars in this representation.

Overrides:
hasItemGaps in class VerticalBarRenderer
Returns:
Always true.

barWidthsPerCategory

public int barWidthsPerCategory(CategoryDataset data)
This will be a method in the renderer that tells whether there is one bar width per category or onebarwidth per series per category.

Overrides:
barWidthsPerCategory in class VerticalBarRenderer
Parameters:
data - The dataset.
Returns:
The number of bar widths per category.

getAxisArea

public java.awt.geom.Rectangle2D getAxisArea(java.awt.geom.Rectangle2D dataArea)
Returns the area that the axes (and data) 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).

Specified by:
getAxisArea in interface CategoryItemRenderer
Overrides:
getAxisArea in class AbstractCategoryItemRenderer
Parameters:
dataArea - The full area available for the data.
Returns:
A reduced area allowing space for the 3D effect.

getDataClipRegion

public 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.

Specified by:
getDataClipRegion in interface CategoryItemRenderer
Overrides:
getDataClipRegion in class AbstractCategoryItemRenderer
Parameters:
dataArea - The data area.

drawPlotBackground

public 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.

Specified by:
drawPlotBackground in interface CategoryItemRenderer
Overrides:
drawPlotBackground in class AbstractCategoryItemRenderer
Parameters:
g2 - The graphics device.
plot - The plot.
axisDataArea - The area inside the axes.
dataClipArea - The data clip area.

drawRangeMarker

public void drawRangeMarker(java.awt.Graphics2D g2,
                            CategoryPlot plot,
                            ValueAxis axis,
                            Marker marker,
                            java.awt.geom.Rectangle2D axisDataArea,
                            java.awt.Shape dataClipRegion)
Draws a range marker.

Specified by:
drawRangeMarker in interface CategoryItemRenderer
Overrides:
drawRangeMarker in class VerticalBarRenderer
Parameters:
g2 - The graphics device.
plot - The plot.
axis - The range axis.
marker - The marker.
axisDataArea - The area inside the axes.
dataClipArea - The clipping region for the data.

drawCategoryItem

public 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)
Renders an individual bar.

Specified by:
drawCategoryItem in interface CategoryItemRenderer
Overrides:
drawCategoryItem in class VerticalBarRenderer
Parameters:
g2 - The graphics device.
dataArea - The area for plotting the data.
plot - The plot.
axis - The range axis.
data - The dataset.
series - The series (zero-based index).
category - The category.
categoryIndex - The category index (zero-based).
previousCategory - The previous category.


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.