org.jfree.chart.renderer.xy

Class SamplingXYLineRenderer

public class SamplingXYLineRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, PublicCloneable, Serializable

A renderer that... This renderer is designed for use with the XYPlot class.
Nested Class Summary
static classSamplingXYLineRenderer.State
Records the state for the renderer.
Constructor Summary
SamplingXYLineRenderer()
Creates a new renderer.
Method Summary
Objectclone()
Returns a clone of the renderer.
voiddrawItem(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.
booleanequals(Object obj)
Tests this renderer for equality with an arbitrary object.
LegendItemgetLegendItem(int datasetIndex, int series)
Returns a legend item for the specified series.
ShapegetLegendLine()
Returns the shape used to represent a line in the legend.
intgetPassCount()
Returns the number of passes through the data that the renderer requires in order to draw the chart.
XYItemRendererStateinitialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
Initialises the renderer.
voidsetLegendLine(Shape line)
Sets the shape used as a line in each legend item and sends a RendererChangeEvent to all registered listeners.

Constructor Detail

SamplingXYLineRenderer

public SamplingXYLineRenderer()
Creates a new renderer.

Method Detail

clone

public Object clone()
Returns a clone of the renderer.

Returns: A clone.

Throws: CloneNotSupportedException if the clone cannot be created.

drawItem

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.

equals

public boolean equals(Object obj)
Tests this renderer for equality with an arbitrary object.

Parameters: obj the object (null permitted).

Returns: true or false.

getLegendItem

public LegendItem getLegendItem(int datasetIndex, int series)
Returns a legend item for the specified series.

Parameters: datasetIndex the dataset index (zero-based). series the series index (zero-based).

Returns: A legend item for the series.

getLegendLine

public Shape getLegendLine()
Returns the shape used to represent a line in the legend.

Returns: The legend line (never null).

See Also: setLegendLine

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.

Returns: The pass count.

initialise

public XYItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, XYPlot plot, XYDataset data, PlotRenderingInfo info)
Initialises the renderer.

This method will be called before the first item is rendered, giving the renderer an opportunity to initialise any state information it wants to maintain. The renderer can do nothing if it chooses.

Parameters: g2 the graphics device. dataArea the area inside the axes. plot the plot. data the data. info an optional info collection object to return data back to the caller.

Returns: The renderer state.

setLegendLine

public void setLegendLine(Shape line)
Sets the shape used as a line in each legend item and sends a RendererChangeEvent to all registered listeners.

Parameters: line the line (null not permitted).

See Also: getLegendLine

Copyright © 2000-2009 by Object Refinery Limited. All Rights Reserved.