org.jfree.chart.renderer.xy

Class XYErrorRenderer

public class XYErrorRenderer extends XYLineAndShapeRenderer

A line and shape renderer that can also display x and/or y-error values. This renderer expects an IntervalXYDataset, otherwise it reverts to the behaviour of the super class.

Since: 1.0.3

Constructor Summary
XYErrorRenderer()
Creates a new XYErrorRenderer instance.
Method Summary
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 for one data item.
booleanequals(Object obj)
Tests this instance for equality with an arbitrary object.
RangefindDomainBounds(XYDataset dataset)
Returns the range required by this renderer to display all the domain values in the specified dataset.
RangefindRangeBounds(XYDataset dataset)
Returns the range required by this renderer to display all the range values in the specified dataset.
doublegetCapLength()
Returns the length (in Java2D units) of the cap at the end of the error bars.
booleangetDrawXError()
Returns the flag that controls whether or not the renderer draws error bars for the x-values.
booleangetDrawYError()
Returns the flag that controls whether or not the renderer draws error bars for the y-values.
PaintgetErrorPaint()
Returns the paint used to draw the error bars.
voidsetCapLength(double length)
Sets the length of the cap at the end of the error bars, and sends a RendererChangeEvent to all registered listeners.
voidsetDrawXError(boolean draw)
Sets the flag that controls whether or not the renderer draws error bars for the x-values and, if the flag changes, sends a RendererChangeEvent to all registered listeners.
voidsetDrawYError(boolean draw)
Sets the flag that controls whether or not the renderer draws error bars for the y-values and, if the flag changes, sends a RendererChangeEvent to all registered listeners.
voidsetErrorPaint(Paint paint)
Sets the paint used to draw the error bars.

Constructor Detail

XYErrorRenderer

public XYErrorRenderer()
Creates a new XYErrorRenderer instance.

Method Detail

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 for one data item.

Parameters: g2 the graphics output target. state the renderer state. dataArea the data area. info the plot rendering info. plot the plot. domainAxis the domain axis. rangeAxis the range axis. dataset the dataset. series the series index. item the item index. crosshairState the crosshair state. pass the pass index.

equals

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

Parameters: obj the object (null permitted).

Returns: A boolean.

findDomainBounds

public Range findDomainBounds(XYDataset dataset)
Returns the range required by this renderer to display all the domain values in the specified dataset.

Parameters: dataset the dataset (null permitted).

Returns: The range, or null if the dataset is null.

findRangeBounds

public Range findRangeBounds(XYDataset dataset)
Returns the range required by this renderer to display all the range values in the specified dataset.

Parameters: dataset the dataset (null permitted).

Returns: The range, or null if the dataset is null.

getCapLength

public double getCapLength()
Returns the length (in Java2D units) of the cap at the end of the error bars.

Returns: The cap length.

See Also: XYErrorRenderer

getDrawXError

public boolean getDrawXError()
Returns the flag that controls whether or not the renderer draws error bars for the x-values.

Returns: A boolean.

See Also: XYErrorRenderer

getDrawYError

public boolean getDrawYError()
Returns the flag that controls whether or not the renderer draws error bars for the y-values.

Returns: A boolean.

See Also: XYErrorRenderer

getErrorPaint

public Paint getErrorPaint()
Returns the paint used to draw the error bars. If this is null (the default), the item paint is used instead.

Returns: The paint (possibly null).

See Also: setErrorPaint

setCapLength

public void setCapLength(double length)
Sets the length of the cap at the end of the error bars, and sends a RendererChangeEvent to all registered listeners.

Parameters: length the length (in Java2D units).

See Also: getCapLength

setDrawXError

public void setDrawXError(boolean draw)
Sets the flag that controls whether or not the renderer draws error bars for the x-values and, if the flag changes, sends a RendererChangeEvent to all registered listeners.

Parameters: draw the flag value.

See Also: getDrawXError

setDrawYError

public void setDrawYError(boolean draw)
Sets the flag that controls whether or not the renderer draws error bars for the y-values and, if the flag changes, sends a RendererChangeEvent to all registered listeners.

Parameters: draw the flag value.

See Also: getDrawYError

setErrorPaint

public void setErrorPaint(Paint paint)
Sets the paint used to draw the error bars.

Parameters: paint the paint (null permitted).

See Also: getErrorPaint