Package org.jfree.chart.renderer
Class BarRenderer3D
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.AbstractCategoryItemRenderer
org.jfree.chart.renderer.BarRenderer
org.jfree.chart.renderer.BarRenderer3D
- All Implemented Interfaces:
Serializable
,Cloneable
,Effect3D
,CategoryItemRenderer
,org.jfree.util.PublicCloneable
- Direct Known Subclasses:
StackedBarRenderer3D
public class BarRenderer3D extends BarRenderer implements Effect3D, Cloneable, org.jfree.util.PublicCloneable, Serializable
A renderer for bars with a 3D effect, for use with the
CategoryPlot
class.- Author:
- Serge V. Grachov
- See Also:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static 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, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO
-
Constructor Summary
Constructors Constructor Description BarRenderer3D()
Default constructor, creates a renderer with a ten pixel '3D effect'.BarRenderer3D(double xOffset, double yOffset)
Constructs a new renderer with the specified '3D effect'. -
Method Summary
Modifier and Type Method Description 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)
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
drawRangeMarker(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)
Draws a range marker.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(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.BarRenderer
equals, getGradientPaintTransformer, getItemMargin, getLowerClip, getMaxBarWidth, getMinimumBarLength, getNegativeItemLabelPositionFallback, getPositiveItemLabelPositionFallback, getUpperClip, initialise, isDrawBarOutline, setDrawBarOutline, setGradientPaintTransformer, setItemMargin, setMaxBarWidth, setMinimumBarLength, setNegativeItemLabelPositionFallback, setPositiveItemLabelPositionFallback
Methods inherited from class org.jfree.chart.renderer.AbstractCategoryItemRenderer
clone, getBaseItemURLGenerator, getBaseLabelGenerator, getBaseToolTipGenerator, getColumnCount, getDrawingSupplier, getItemURLGenerator, getLabelGenerator, getLegendItem, getPlot, getRangeExtent, getRowCount, getSeriesItemURLGenerator, getSeriesLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, hashCode, setBaseItemURLGenerator, setBaseLabelGenerator, setBaseToolTipGenerator, setItemURLGenerator, setLabelGenerator, setPlot, setSeriesItemURLGenerator, setSeriesLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, getBaseItemLabelAnchor, getBaseItemLabelAngle, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelRotationAnchor, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelAnchorOffset, getItemLabelAngle, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemLabelRotationAnchor, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelAngle, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelRotationAnchor, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, isItemLabelVisible, isSeriesItemLabelsVisible, notifyListeners, removeChangeListener, setBaseAngle, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelRotationAnchor, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setItemLabelAnchor, setItemLabelAnchorOffset, setItemLabelAngle, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelRotationAnchor, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesAngle, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelRotationAnchor, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setShape, setShape, setStroke, setStroke
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart.renderer.CategoryItemRenderer
addChangeListener, getBaseItemLabelAnchor, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, isItemLabelVisible, isSeriesItemLabelsVisible, removeChangeListener, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseStroke, setItemLabelAnchor, setItemLabelFont, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setShape, setStroke
Methods inherited from interface org.jfree.util.PublicCloneable
clone
-
Field Details
-
DEFAULT_X_OFFSET
public static final double DEFAULT_X_OFFSETThe default x-offset for the 3D effect.- See Also:
- Constant Field Values
-
DEFAULT_Y_OFFSET
public static final double DEFAULT_Y_OFFSETThe default y-offset for the 3D effect.- See Also:
- Constant Field Values
-
DEFAULT_WALL_PAINT
The default wall paint.
-
-
Constructor Details
-
BarRenderer3D
public BarRenderer3D()Default constructor, creates a renderer with a ten pixel '3D effect'. -
BarRenderer3D
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.
-
-
Method Details
-
getXOffset
public double getXOffset()Returns the x-offset for the 3D effect.- Specified by:
getXOffset
in interfaceEffect3D
- Returns:
- the 3D effect.
-
getYOffset
public double getYOffset()Returns the y-offset for the 3D effect.- Specified by:
getYOffset
in interfaceEffect3D
- Returns:
- the 3D effect.
-
getWallPaint
Returns the paint used to highlight the left and bottom wall in the plot background.- Returns:
- The paint.
-
setWallPaint
Sets the paint used to hightlight the left and bottom walls in the plot background.- Parameters:
paint
- the paint.
-
drawBackground
Draws the background for the plot.- Specified by:
drawBackground
in interfaceCategoryItemRenderer
- Overrides:
drawBackground
in classAbstractCategoryItemRenderer
- Parameters:
g2
- the graphics device.plot
- the plot.dataArea
- the area inside the axes.
-
drawOutline
Draws the outline for the plot.- Specified by:
drawOutline
in interfaceCategoryItemRenderer
- Overrides:
drawOutline
in classAbstractCategoryItemRenderer
- Parameters:
g2
- the graphics device.plot
- the plot.dataArea
- the area inside the axes.
-
drawDomainGridline
public void drawDomainGridline(Graphics2D g2, CategoryPlot plot, Rectangle2D dataArea, double value)Draws a grid line against the domain axis.- Specified by:
drawDomainGridline
in interfaceCategoryItemRenderer
- Overrides:
drawDomainGridline
in classAbstractCategoryItemRenderer
- 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(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Rectangle2D dataArea, double value)Draws a grid line against the range axis.- Specified by:
drawRangeGridline
in interfaceCategoryItemRenderer
- Overrides:
drawRangeGridline
in classAbstractCategoryItemRenderer
- 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(Graphics2D g2, CategoryPlot plot, ValueAxis axis, Marker marker, Rectangle2D dataArea)Draws a range marker.- Specified by:
drawRangeMarker
in interfaceCategoryItemRenderer
- Overrides:
drawRangeMarker
in classAbstractCategoryItemRenderer
- 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(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draws a 3D bar to represent one data item.- Specified by:
drawItem
in interfaceCategoryItemRenderer
- Overrides:
drawItem
in classBarRenderer
- 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).
-