public class

DeviationRenderer

extends XYLineAndShapeRenderer
java.lang.Object
   ↳ org.jfree.chart.renderer.AbstractRenderer
     ↳ org.jfree.chart.renderer.xy.AbstractXYItemRenderer
       ↳ org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
         ↳ org.jfree.chart.renderer.xy.DeviationRenderer

Class Overview

A specialised subclass of the XYLineAndShapeRenderer that requires an IntervalXYDataset and represents the y-interval by shading an area behind the y-values on the chart. The example shown here is generated by the DeviationRendererDemo1.java program included in the JFreeChart demo collection:

DeviationRendererSample.png

Summary

Nested Classes
class DeviationRenderer.State A state object that is passed to each call to drawItem
[Expand]
Inherited Fields
From class org.jfree.chart.renderer.AbstractRenderer
Public Constructors
DeviationRenderer()
Creates a new renderer that displays lines and shapes for the data items, as well as the shaded area for the y-interval.
DeviationRenderer(boolean lines, boolean shapes)
Creates a new renderer.
Public Methods
void drawItem(Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)
Draws the visual representation of a single data item.
boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.
Range findRangeBounds(XYDataset dataset)
Returns the range of values the renderer requires to display all the items from the specified dataset.
float getAlpha()
Returns the alpha transparency for the background shading.
int getPassCount()
Returns the number of passes (through the dataset) used by this renderer.
XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset dataset, PlotRenderingInfo info)
void setAlpha(float alpha)
Sets the alpha transparency for the background shading, and sends a RendererChangeEvent to all registered listeners.
void setDrawSeriesLineAsPath(boolean flag)
This method is overridden so that this flag cannot be changed---it is set to true for this renderer.
Protected Methods
boolean isItemPass(int pass)
Returns true if this is the pass where the shapes are drawn.
boolean isLinePass(int pass)
Returns true if this is the pass where the lines are drawn.
[Expand]
Inherited Methods
From class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
From class org.jfree.chart.renderer.xy.AbstractXYItemRenderer
From class org.jfree.chart.renderer.AbstractRenderer
From class java.lang.Object
From interface org.jfree.chart.LegendItemSource
From interface org.jfree.chart.renderer.xy.XYItemRenderer

Public Constructors

public DeviationRenderer ()

Creates a new renderer that displays lines and shapes for the data items, as well as the shaded area for the y-interval.

public DeviationRenderer (boolean lines, boolean shapes)

Creates a new renderer.

Parameters
lines show lines between data items?
shapes show a shape for each data item?

Public Methods

public void drawItem (Graphics2D g2, XYItemRendererState state, Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairState crosshairState, int pass)

Draws the visual representation of a single data item.

Parameters
g2 the graphics device.
state the renderer state.
dataArea the area within which the data is being drawn.
info collects information about the drawing.
plot the plot (can be used to obtain standard color information etc).
domainAxis the domain axis.
rangeAxis the range axis.
dataset the dataset.
series the series index (zero-based).
item the item index (zero-based).
crosshairState crosshair information for the plot (null permitted).
pass the pass index.

public boolean equals (Object obj)

Tests this renderer for equality with an arbitrary object.

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

public Range findRangeBounds (XYDataset dataset)

Returns the range of values the renderer requires to display all the items from the specified dataset.

Parameters
dataset the dataset (null permitted).
Returns
  • The range (null if the dataset is null or empty).

public float getAlpha ()

Returns the alpha transparency for the background shading.

Returns
  • The alpha transparency.
See Also

public int getPassCount ()

Returns the number of passes (through the dataset) used by this renderer.

Returns
  • 3.

public XYItemRendererState initialise (Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset dataset, PlotRenderingInfo info)

Parameters
g2 the graphics target.
dataArea the data area.
plot the plot.
dataset the dataset.
info the plot rendering info.
Returns
  • A newly initialised state object.

public void setAlpha (float alpha)

Sets the alpha transparency for the background shading, and sends a RendererChangeEvent to all registered listeners.

Parameters
alpha the alpha (in the range 0.0f to 1.0f).
See Also

public void setDrawSeriesLineAsPath (boolean flag)

This method is overridden so that this flag cannot be changed---it is set to true for this renderer.

Parameters
flag ignored.

Protected Methods

protected boolean isItemPass (int pass)

Returns true if this is the pass where the shapes are drawn.

Parameters
pass the pass index.
Returns
  • A boolean.
See Also

protected boolean isLinePass (int pass)

Returns true if this is the pass where the lines are drawn.

Parameters
pass the pass index.
Returns
  • A boolean.
See Also