org.jfree.chart.renderer
Class VerticalBarRenderer3D

java.lang.Object
  |
  +--org.jfree.chart.renderer.AbstractRenderer
        |
        +--org.jfree.chart.renderer.AbstractCategoryItemRenderer
              |
              +--org.jfree.chart.renderer.BarRenderer
                    |
                    +--org.jfree.chart.renderer.VerticalBarRenderer
                          |
                          +--org.jfree.chart.renderer.VerticalBarRenderer3D
All Implemented Interfaces:
CategoryItemRenderer, Effect3D, Renderer, java.io.Serializable
Direct Known Subclasses:
StackedVerticalBarRenderer3D

public class VerticalBarRenderer3D
extends VerticalBarRenderer
implements Effect3D, java.io.Serializable

A renderer for vertical bars with a 3D effect.

For use with the VerticalCategoryPlot class.

Author:
Serge V. Grachov
See Also:
Serialized Form

Field Summary
static java.awt.Paint DEFAULT_WALL_PAINT
          The default wall paint.
static double DEFAULT_X_OFFSET
          The default x-offset for the 3D effect.
static double DEFAULT_Y_OFFSET
          The default y-offset for the 3D effect.
 
Fields inherited from class org.jfree.chart.renderer.BarRenderer
BAR_OUTLINE_WIDTH_THRESHOLD, DEFAULT_ITEM_MARGIN
 
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
VerticalBarRenderer3D()
          Default constructor, creates a renderer with a ten pixel '3D effect'.
VerticalBarRenderer3D(CategoryToolTipGenerator toolTipGenerator, CategoryURLGenerator urlGenerator)
          Constructs a new renderer.
VerticalBarRenderer3D(double xOffset, double yOffset)
          Constructs a new renderer with the specified '3D effect'.
VerticalBarRenderer3D(double xOffset, double yOffset, CategoryToolTipGenerator toolTipGenerator, CategoryURLGenerator urlGenerator)
          Constructs a new renderer.
 
Method Summary
 void drawBackground(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)
          Draws the background for the plot.
 void drawDomainGridline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea, double value)
          Draws a grid line against the domain axis.
 void drawItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset data, int dataset, int row, int column)
          Draws a 3D bar to represent one data item.
 void drawOutline(java.awt.Graphics2D g2, CategoryPlot plot, java.awt.geom.Rectangle2D dataArea)
          Draws the outline for the plot.
 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 range marker.
 java.awt.Paint getWallPaint()
          Returns the paint used to highlight the left and bottom wall in the plot background.
 double getXOffset()
          Returns the x-offset for the 3D effect.
 double getYOffset()
          Returns the y-offset for the 3D effect.
 void setWallPaint(java.awt.Paint paint)
          Sets the paint used to hightlight the left and bottom walls in the plot background.
 
Methods inherited from class org.jfree.chart.renderer.VerticalBarRenderer
initialise
 
Methods inherited from class org.jfree.chart.renderer.BarRenderer
getBarWidth, getItemMargin, getLowerClip, getUpperClip, getZeroInJava2D, setBarWidth, setItemMargin
 
Methods inherited from class org.jfree.chart.renderer.AbstractCategoryItemRenderer
equals, getColumnCount, getLegendItem, getRangeType, getRowCount, getToolTipGenerator, getURLGenerator, setToolTipGenerator, setURLGenerator
 
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addPropertyChangeListener, createTransformedShape, firePropertyChanged, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultShape, getDefaultStroke, getDrawingSupplier, getInfo, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getPlot, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesShape, getSeriesStroke, isOutlinePaintTableActive, isOutlineStrokeTableActive, isPaintTableActive, isShapeTableActive, isStrokeTableActive, removePropertyChangeListener, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultPaint, setDefaultShape, setDefaultStroke, setDrawingSupplier, setInfo, setOutlinePaintTableActive, setOutlineStrokeTableActive, setPaintTableActive, setPlot, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setShapeTableActive, setStrokeTableActive
 
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
getItemOutlinePaint, getItemPaint, getItemShape, getItemStroke, getLegendItem, getRangeType, getSeriesOutlinePaint, getSeriesPaint, getSeriesShape, getSeriesStroke, getToolTipGenerator, setToolTipGenerator
 
Methods inherited from interface org.jfree.chart.renderer.Renderer
getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultShape, getDefaultStroke, getDrawingSupplier, getPlot, isOutlinePaintTableActive, isOutlineStrokeTableActive, isPaintTableActive, isShapeTableActive, isStrokeTableActive, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultPaint, setDefaultShape, setDefaultStroke, setDrawingSupplier, setOutlinePaintTableActive, setOutlineStrokeTableActive, setPaintTableActive, setPlot, setSeriesPaint, setSeriesPaint, setSeriesStroke, setSeriesStroke, setShapeTableActive, setStrokeTableActive
 

Field Detail

DEFAULT_X_OFFSET

public static final double DEFAULT_X_OFFSET
The default x-offset for the 3D effect.

See Also:
Constant Field Values

DEFAULT_Y_OFFSET

public static final double DEFAULT_Y_OFFSET
The default y-offset for the 3D effect.

See Also:
Constant Field Values

DEFAULT_WALL_PAINT

public static final java.awt.Paint DEFAULT_WALL_PAINT
The default wall paint.

Constructor Detail

VerticalBarRenderer3D

public VerticalBarRenderer3D()
Default constructor, creates a renderer with a ten pixel '3D effect'.


VerticalBarRenderer3D

public VerticalBarRenderer3D(double xOffset,
                             double yOffset)
Constructs a new renderer with the specified '3D effect'.

Parameters:
xOffset - the x-offset for the 3D effect.
yOffset - the y-offset for the 3D effect.

VerticalBarRenderer3D

public VerticalBarRenderer3D(CategoryToolTipGenerator toolTipGenerator,
                             CategoryURLGenerator urlGenerator)
Constructs a new renderer.

Parameters:
toolTipGenerator - the tool tip generator.
urlGenerator - the URL generator.

VerticalBarRenderer3D

public VerticalBarRenderer3D(double xOffset,
                             double yOffset,
                             CategoryToolTipGenerator toolTipGenerator,
                             CategoryURLGenerator urlGenerator)
Constructs a new renderer.

Parameters:
xOffset - the x-offset for the 3D effect.
yOffset - the y-offset for the 3D effect.
toolTipGenerator - the tool tip generator.
urlGenerator - the URL generator.
Method Detail

getXOffset

public double getXOffset()
Returns the x-offset for the 3D effect.

Specified by:
getXOffset in interface Effect3D
Returns:
the 3D effect.

getYOffset

public double getYOffset()
Returns the y-offset for the 3D effect.

Specified by:
getYOffset in interface Effect3D
Returns:
the 3D effect.

getWallPaint

public java.awt.Paint getWallPaint()
Returns the paint used to highlight the left and bottom wall in the plot background.

Returns:
The paint.

setWallPaint

public void setWallPaint(java.awt.Paint paint)
Sets the paint used to hightlight the left and bottom walls in the plot background.

Parameters:
paint - the paint.

drawBackground

public void drawBackground(java.awt.Graphics2D g2,
                           CategoryPlot plot,
                           java.awt.geom.Rectangle2D dataArea)
Draws the background for the plot.

Specified by:
drawBackground in interface CategoryItemRenderer
Overrides:
drawBackground in class AbstractCategoryItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
dataArea - the area inside the axes.

drawOutline

public void drawOutline(java.awt.Graphics2D g2,
                        CategoryPlot plot,
                        java.awt.geom.Rectangle2D dataArea)
Draws the outline for the plot.

Specified by:
drawOutline in interface CategoryItemRenderer
Overrides:
drawOutline in class AbstractCategoryItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
dataArea - the area inside the axes.

drawDomainGridline

public void drawDomainGridline(java.awt.Graphics2D g2,
                               CategoryPlot plot,
                               java.awt.geom.Rectangle2D dataArea,
                               double value)
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.

Specified by:
drawDomainGridline in interface CategoryItemRenderer
Overrides:
drawDomainGridline in class AbstractCategoryItemRenderer
Parameters:
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.

drawRangeGridline

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

Specified by:
drawRangeGridline in interface CategoryItemRenderer
Overrides:
drawRangeGridline in class AbstractCategoryItemRenderer
Parameters:
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.

drawRangeMarker

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

Specified by:
drawRangeMarker in interface CategoryItemRenderer
Overrides:
drawRangeMarker in class AbstractCategoryItemRenderer
Parameters:
g2 - the graphics device.
plot - the plot.
axis - the value axis.
marker - the marker.
dataArea - the area for plotting data (not including 3D effect).

drawItem

public void drawItem(java.awt.Graphics2D g2,
                     java.awt.geom.Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset data,
                     int dataset,
                     int row,
                     int column)
Draws a 3D bar to represent one data item.

Specified by:
drawItem in interface CategoryItemRenderer
Overrides:
drawItem in class VerticalBarRenderer
Parameters:
g2 - the graphics device.
dataArea - the area for plotting the data.
plot - the plot.
domainAxis - the domain axis.
rangeAxis - the range axis.
data - the dataset.
dataset - the dataset index (zero-based).
row - the row index (zero-based).
column - the column index (zero-based).