Header
And More


org.jfree.chart.renderer.xy
Class XYErrorRenderer

java.lang.Object
  extended by org.jfree.chart.renderer.AbstractRenderer
      extended by org.jfree.chart.renderer.xy.AbstractXYItemRenderer
          extended by org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
              extended by org.jfree.chart.renderer.xy.XYErrorRenderer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, LegendItemSource, XYItemRenderer, org.jfree.util.PublicCloneable

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. The example shown here is generated by the XYErrorRendererDemo1.java program included in the JFreeChart demo collection:

XYErrorRendererSample.png

Since:
1.0.3
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
XYLineAndShapeRenderer.State
 
Field Summary
 
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
XYErrorRenderer()
          Creates a new XYErrorRenderer instance.
 
Method Summary
 void drawItem(java.awt.Graphics2D g2, XYItemRendererState state, java.awt.geom.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.
 boolean equals(java.lang.Object obj)
          Tests this instance for equality with an arbitrary object.
 Range findDomainBounds(XYDataset dataset)
          Returns the range required by this renderer to display all the domain values in the specified dataset.
 Range findRangeBounds(XYDataset dataset)
          Returns the range required by this renderer to display all the range values in the specified dataset.
 double getCapLength()
          Returns the length (in Java2D units) of the cap at the end of the error bars.
 boolean getDrawXError()
          Returns the flag that controls whether or not the renderer draws error bars for the x-values.
 boolean getDrawYError()
          Returns the flag that controls whether or not the renderer draws error bars for the y-values.
 java.awt.Paint getErrorPaint()
          Returns the paint used to draw the error bars.
 java.awt.Stroke getErrorStroke()
          Returns the stroke used to draw the error bars.
 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.
 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.
 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.
 void setErrorPaint(java.awt.Paint paint)
          Sets the paint used to draw the error bars and sends a RendererChangeEvent to all registered listeners.
 void setErrorStroke(java.awt.Stroke stroke)
          Sets the stroke used to draw the error bars and sends a RendererChangeEvent to all registered listeners.
 
Methods inherited from class org.jfree.chart.renderer.xy.XYLineAndShapeRenderer
clone, drawFirstPassShape, drawPrimaryLine, drawPrimaryLineAsPath, drawSecondaryPass, 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, drawAnnotations, drawDomainGridLine, drawDomainLine, drawDomainMarker, drawItemLabel, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, findDomainBounds, findRangeBounds, getAnnotations, getBaseItemLabelGenerator, getBaseToolTipGenerator, getDrawingSupplier, getItemLabelGenerator, getItemLabelGenerator, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPlot, getSeriesItemLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, getURLGenerator, isPointInRect, removeAnnotation, removeAnnotations, setBaseItemLabelGenerator, setBaseToolTipGenerator, setItemLabelGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator, updateCrosshairValues, updateCrosshairValues
 
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseLegendShape, getBaseLegendTextFont, getBaseLegendTextPaint, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDataBoundsIncludesVisibleSeriesOnly, getDefaultEntityRadius, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hashCode, hasListener, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseLegendShape, setBaseLegendTextFont, setBaseLegendTextPaint, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setDataBoundsIncludesVisibleSeriesOnly, setDefaultEntityRadius, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendShape, setLegendTextFont, setLegendTextPaint, 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
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.chart.renderer.xy.XYItemRenderer
addAnnotation, addAnnotation, addChangeListener, drawAnnotations, drawDomainGridLine, drawDomainMarker, drawRangeLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getBaseItemLabelFont, getBaseItemLabelGenerator, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getBaseToolTipGenerator, getItemLabelFont, getItemLabelFont, getItemLabelGenerator, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendItemLabelGenerator, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPlot, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelFont, getSeriesItemLabelGenerator, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, getToolTipGenerator, getURLGenerator, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeAnnotation, removeAnnotations, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelGenerator, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseStroke, setBaseToolTipGenerator, setItemLabelFont, setItemLabelGenerator, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLegendItemLabelGenerator, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPlot, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelGenerator, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesToolTipGenerator, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setShape, setStroke, setToolTipGenerator, setURLGenerator
 
Methods inherited from interface org.jfree.chart.LegendItemSource
getLegendItems
 

Constructor Detail

XYErrorRenderer

public XYErrorRenderer()
Creates a new XYErrorRenderer instance.

Method Detail

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:
setDrawXError(boolean)

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()

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:
setDrawYError(boolean)

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()

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:
setCapLength(double)

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()

getErrorPaint

public java.awt.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(Paint)

setErrorPaint

public void setErrorPaint(java.awt.Paint paint)
Sets the paint used to draw the error bars and sends a RendererChangeEvent to all registered listeners.

Parameters:
paint - the paint (null permitted).
See Also:
getErrorPaint()

getErrorStroke

public java.awt.Stroke getErrorStroke()
Returns the stroke used to draw the error bars. If this is null (the default), the item outline stroke is used instead.

Returns:
The stroke (possibly null).
Since:
1.0.13
See Also:
setErrorStroke(Stroke)

setErrorStroke

public void setErrorStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the error bars and sends a RendererChangeEvent to all registered listeners.

Parameters:
stroke - the stroke (null permitted).
Since:
1.0.13
See Also:
getErrorStroke()

findDomainBounds

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

Specified by:
findDomainBounds in interface XYItemRenderer
Overrides:
findDomainBounds in class AbstractXYItemRenderer
Parameters:
dataset - the dataset (null permitted).
Returns:
The range, or null if the dataset is null.
See Also:
AbstractXYItemRenderer.findRangeBounds(XYDataset)

findRangeBounds

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

Specified by:
findRangeBounds in interface XYItemRenderer
Overrides:
findRangeBounds in class AbstractXYItemRenderer
Parameters:
dataset - the dataset (null permitted).
Returns:
The range, or null if the dataset is null.
See Also:
AbstractXYItemRenderer.findDomainBounds(XYDataset)

drawItem

public void drawItem(java.awt.Graphics2D g2,
                     XYItemRendererState state,
                     java.awt.geom.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.

Specified by:
drawItem in interface XYItemRenderer
Overrides:
drawItem in class XYLineAndShapeRenderer
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(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.

Overrides:
equals in class XYLineAndShapeRenderer
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

Footer
And More


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