public class

BarRenderer3D

extends BarRenderer
implements Serializable Cloneable Effect3D
java.lang.Object
   ↳ org.jfree.chart.renderer.AbstractRenderer
     ↳ org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
       ↳ org.jfree.chart.renderer.category.BarRenderer
         ↳ org.jfree.chart.renderer.category.BarRenderer3D
Known Direct Subclasses

Class Overview

A renderer for bars with a 3D effect, for use with the CategoryPlot class. The example shown here is generated by the BarChart3DDemo1.java program included in the JFreeChart Demo Collection:

BarRenderer3DSample.png

Summary

Constants
double DEFAULT_X_OFFSET The default x-offset for the 3D effect.
double DEFAULT_Y_OFFSET The default y-offset for the 3D effect.
[Expand]
Inherited Constants
From class org.jfree.chart.renderer.category.BarRenderer
Fields
public static final Paint DEFAULT_WALL_PAINT The default wall paint.
[Expand]
Inherited Fields
From class org.jfree.chart.renderer.AbstractRenderer
Public Constructors
BarRenderer3D()
Default constructor, creates a renderer with a default '3D effect'.
BarRenderer3D(double xOffset, double yOffset)
Constructs a new renderer with the specified '3D effect'.
Public Methods
void drawBackground(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
Draws the background for the plot.
void drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)
Draws a grid line against the domain axis.
void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
Draws a 3D bar to represent one data item.
void drawOutline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)
Draws the outline for the plot.
void drawRangeGridline(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)
Draws a grid line against the range axis.
void drawRangeLine(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value, Paint paint, Stroke stroke)
Draws a line perpendicular to the range axis.
void drawRangeMarker(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)
Draws a range marker.
boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.
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.
CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)
Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method.
void setWallPaint(Paint paint)
Sets the paint used to hightlight the left and bottom walls in the plot background, and sends a RendererChangeEvent to all registered listeners.
[Expand]
Inherited Methods
From class org.jfree.chart.renderer.category.BarRenderer
From class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
From class org.jfree.chart.renderer.AbstractRenderer
From class java.lang.Object
From interface org.jfree.chart.Effect3D
From interface org.jfree.chart.LegendItemSource
From interface org.jfree.chart.renderer.category.CategoryItemRenderer

Constants

public static final double DEFAULT_X_OFFSET

The default x-offset for the 3D effect.

Constant Value: 12.0

public static final double DEFAULT_Y_OFFSET

The default y-offset for the 3D effect.

Constant Value: 8.0

Fields

public static final Paint DEFAULT_WALL_PAINT

The default wall paint.

Public Constructors

public BarRenderer3D ()

Default constructor, creates a renderer with a default '3D effect'.

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

Public Methods

public void drawBackground (Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)

Draws the background for the plot.

Parameters
g2 the graphics device.
plot the plot.
dataArea the area inside the axes.

public void drawDomainGridline (Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)

Draws a grid line against the domain axis.

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.

public void drawItem (Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)

Draws a 3D bar to represent one data item.

Parameters
g2 the graphics device.
state the renderer state.
dataArea the area for plotting the data.
plot the plot.
domainAxis the domain axis.
rangeAxis the range axis.
dataset the dataset.
row the row index (zero-based).
column the column index (zero-based).
pass the pass index.

public void drawOutline (Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea)

Draws the outline for the plot.

Parameters
g2 the graphics device.
plot the plot.
dataArea the area inside the axes.

public void drawRangeGridline (Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)

Draws a grid line against the range axis.

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.

public void drawRangeLine (Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value, Paint paint, Stroke stroke)

Draws a line perpendicular to the range axis.

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.
paint the paint.
stroke the stroke.

public void drawRangeMarker (Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)

Draws a range marker.

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

public boolean equals (Object obj)

Tests this renderer for equality with an arbitrary object.

Parameters
obj the object (null permitted).
Returns
  • A boolean.

public Paint getWallPaint ()

Returns the paint used to highlight the left and bottom wall in the plot background.

Returns
  • The paint.

public double getXOffset ()

Returns the x-offset for the 3D effect.

Returns
  • The 3D effect.
See Also

public double getYOffset ()

Returns the y-offset for the 3D effect.

Returns
  • The 3D effect.

public CategoryItemRendererState initialise (Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)

Initialises the renderer and returns a state object that will be passed to subsequent calls to the drawItem method. This method gets called once at the start of the process of drawing a chart.

Parameters
g2 the graphics device.
dataArea the area in which the data is to be plotted.
plot the plot.
rendererIndex the renderer index.
info collects chart rendering information for return to caller.
Returns
  • The renderer state.

public void setWallPaint (Paint paint)

Sets the paint used to hightlight the left and bottom walls in the plot background, and sends a RendererChangeEvent to all registered listeners.

Parameters
paint the paint (null not permitted).
See Also