org.jfree.chart.renderer.xy

Class XYLine3DRenderer

Implemented Interfaces:
Cloneable, Effect3D, PublicCloneable, Serializable, LegendItemSource, XYItemRenderer

public class XYLine3DRenderer
extends XYLineAndShapeRenderer
implements Effect3D, Serializable

A XYLineAndShapeRenderer that adds a shadow line to the graph to emulate a 3D-effect.

Nested Class Summary

Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

XYLineAndShapeRenderer.State

Field Summary

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

DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, DEFAULT_PAINT, DEFAULT_SHAPE, DEFAULT_STROKE, DEFAULT_VALUE_LABEL_FONT, DEFAULT_VALUE_LABEL_PAINT, ZERO

Constructor Summary

XYLine3DRenderer()
Creates a new renderer.

Method Summary

protected void
drawFirstPassShape(Graphics2D g2, int pass, int series, int item, Shape shape)
Overrides the method in the subclass to draw a shadow in the first pass.
int
getPassCount()
Returns the number of passes through the data that the renderer requires in order to draw the chart.
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.
protected boolean
isItemPass(int pass)
Returns true if the specified pass involves drawing items.
protected boolean
isLinePass(int pass)
Returns true if the specified pass involves drawing lines.
protected boolean
isShadowPass(int pass)
Returns true if the specified pass involves drawing shadows.
void
setWallPaint(Paint paint)
Sets the paint used to hightlight the left and bottom walls in the plot background.
void
setXOffset(double xOffset)
Sets the x-offset and sends a RendererChangeEvent to all registered listeners.
void
setYOffset(double yOffset)
Sets the y-offset and sends a RendererChangeEvent to all registered listeners.

Methods inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer

clone, drawFirstPassShape, drawItem, drawPrimaryLine, drawPrimaryLineAsPath, drawSecondaryPass, equals, getBaseLinesVisible, getBaseShapesFilled, getBaseShapesVisible, getDrawOutlines, getDrawSeriesLineAsPath, getItemLineVisible, getItemShapeFilled, getItemShapeVisible, getLegendItem, getLegendLine, getLinesVisible, getPassCount, getSeriesLinesVisible, getSeriesShapesFilled, getSeriesShapesVisible, getShapesVisible, getUseFillPaint, getUseOutlinePaint, initialise, isItemPass, isLinePass, setBaseLinesVisible, setBaseShapesFilled, setBaseShapesVisible, setDrawOutlines, setDrawSeriesLineAsPath, setLegendLine, setLinesVisible, setLinesVisible, setSeriesLinesVisible, setSeriesLinesVisible, setSeriesShapesFilled, setSeriesShapesFilled, setSeriesShapesVisible, setSeriesShapesVisible, setShapesFilled, setShapesFilled, setShapesVisible, setShapesVisible, setUseFillPaint, setUseOutlinePaint

Methods inherited from class org.jfree.chart.renderer.xy.AbstractXYItemRenderer

addAnnotation, addAnnotation, addEntity, calculateDomainMarkerTextAnchorPoint, clone, drawAnnotations, drawDomainGridLine, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, equals, fillDomainGridBand, fillRangeGridBand, findDomainBounds, findRangeBounds, getBaseItemLabelGenerator, getBaseToolTipGenerator, getDefaultEntityRadius, getDrawingSupplier, getItemLabelGenerator, getItemLabelGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getLegendItems, getPassCount, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, getURLGenerator, initialise, removeAnnotation, removeAnnotations, setBaseItemLabelGenerator, setBaseToolTipGenerator, setDefaultEntityRadius, setItemLabelGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator, updateCrosshairValues, updateCrosshairValues

Methods inherited from class org.jfree.chart.renderer.AbstractRenderer

addChangeListener, calculateLabelAnchorPoint, clone, equals, fireChangeEvent, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDrawingSupplier, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hasListener, hashCode, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, notifyListeners, removeChangeListener, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setShape, setStroke, setStroke

Field Details

DEFAULT_WALL_PAINT

public static final Paint DEFAULT_WALL_PAINT
The default wall paint.

DEFAULT_X_OFFSET

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

DEFAULT_Y_OFFSET

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

Constructor Details

XYLine3DRenderer

public XYLine3DRenderer()
Creates a new renderer.

Method Details

drawFirstPassShape

protected void drawFirstPassShape(Graphics2D g2,
                                  int pass,
                                  int series,
                                  int item,
                                  Shape shape)
Overrides the method in the subclass to draw a shadow in the first pass.
Overrides:
drawFirstPassShape in interface XYLineAndShapeRenderer
Parameters:
g2 - the graphics device.
pass - the pass.
series - the series index (zero-based).
item - the item index (zero-based).
shape - the shape.

getPassCount

public int getPassCount()
Returns the number of passes through the data that the renderer requires in order to draw the chart. Most charts will require a single pass, but some require two passes.
Specified by:
getPassCount in interface XYItemRenderer
Overrides:
getPassCount in interface XYLineAndShapeRenderer
Returns:
The pass count.

getWallPaint

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

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.

isItemPass

protected boolean isItemPass(int pass)
Returns true if the specified pass involves drawing items.
Overrides:
isItemPass in interface XYLineAndShapeRenderer
Parameters:
pass - the pass.
Returns:
A boolean.

isLinePass

protected boolean isLinePass(int pass)
Returns true if the specified pass involves drawing lines.
Overrides:
isLinePass in interface XYLineAndShapeRenderer
Parameters:
pass - the pass.
Returns:
A boolean.

isShadowPass

protected boolean isShadowPass(int pass)
Returns true if the specified pass involves drawing shadows.
Parameters:
pass - the pass.
Returns:
A boolean.

setWallPaint

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

setXOffset

public void setXOffset(double xOffset)
Sets the x-offset and sends a RendererChangeEvent to all registered listeners.
Parameters:
xOffset - the x-offset.

setYOffset

public void setYOffset(double yOffset)
Sets the y-offset and sends a RendererChangeEvent to all registered listeners.
Parameters:
yOffset - the y-offset.