org.jfree.chart.renderer
Class XYBoxAndWhiskerRenderer

java.lang.Object
  extended byorg.jfree.chart.renderer.AbstractRenderer
      extended byorg.jfree.chart.renderer.AbstractXYItemRenderer
          extended byorg.jfree.chart.renderer.XYBoxAndWhiskerRenderer
All Implemented Interfaces:
java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable, XYItemRenderer

public class XYBoxAndWhiskerRenderer
extends AbstractXYItemRenderer
implements XYItemRenderer, java.lang.Cloneable, org.jfree.util.PublicCloneable, java.io.Serializable

A renderer that draws box-and-whisker items on an XYPlot. This renderer requires a BoxAndWhiskerXYDataset).

Author:
David Browning
See Also:
Serialized Form

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
XYBoxAndWhiskerRenderer()
          Creates a new renderer for box and whisker charts.
XYBoxAndWhiskerRenderer(double boxWidth)
          Creates a new renderer for box and whisker charts.
 
Method Summary
 java.lang.Object clone()
          Returns a clone of the renderer.
 void drawHorizontalItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairInfo crosshairInfo, int pass)
          Draws the visual representation of a single data item.
 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, CrosshairInfo crosshairInfo, int pass)
          Draws the visual representation of a single data item.
 void drawVerticalItem(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D dataArea, PlotRenderingInfo info, XYPlot plot, ValueAxis domainAxis, ValueAxis rangeAxis, XYDataset dataset, int series, int item, CrosshairInfo crosshairInfo, int pass)
          Draws the visual representation of a single data item.
 boolean equals(java.lang.Object obj)
          Tests this renderer for equality with another object.
 java.awt.Paint getArtifactPaint()
          Returns the paint used to paint the various artifacts such as outliers, farout symbol, median line and the averages ellipse.
 double getBoxWidth()
          Returns the width of each box.
 java.awt.Paint getPaint()
          Returns the paint used to fill boxes.
 void setArtifactPaint(java.awt.Paint artifactPaint)
          Sets the paint used to paint the various artifacts such as outliers, farout symbol, median line and the averages ellipse.
 void setBoxWidth(double width)
          Sets the box width.
 void setPaint(java.awt.Paint paint)
          Sets the paint used to fill boxes.
 
Methods inherited from class org.jfree.chart.renderer.AbstractXYItemRenderer
drawDomainGridLine, drawDomainMarker, drawRangeGridLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getDrawingSupplier, getLegendItem, getPassCount, getPlot, getRangeType, getToolTipGenerator, getURLGenerator, initialise, setPlot, setToolTipGenerator, setURLGenerator
 
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, addPropertyChangeListener, createTransformedShape, firePropertyChanged, getBaseItemLabelAnchor, getBaseItemLabelAngle, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelRotationAnchor, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelAngle, getItemLabelFont, getItemLabelPaint, getItemLabelRotationAnchor, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelAngle, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelRotationAnchor, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, hashCode, isItemLabelVisible, isSeriesItemLabelsVisible, notifyListeners, removeChangeListener, removePropertyChangeListener, setBaseAngle, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelRotationAnchor, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setItemLabelAnchor, setItemLabelAngle, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelRotationAnchor, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlinePaint, setOutlineStroke, setOutlineStroke, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesAngle, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelRotationAnchor, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, 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.XYItemRenderer
addPropertyChangeListener, drawDomainGridLine, drawDomainMarker, drawRangeGridLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getBaseStroke, getItemOutlinePaint, getItemPaint, getItemShape, getItemStroke, getLegendItem, getPassCount, getPlot, getRangeType, getSeriesOutlinePaint, getSeriesPaint, getSeriesShape, getSeriesStroke, getToolTipGenerator, getURLGenerator, initialise, removePropertyChangeListener, setBaseStroke, setPlot, setSeriesPaint, setSeriesStroke, setStroke, setToolTipGenerator, setURLGenerator
 

Constructor Detail

XYBoxAndWhiskerRenderer

public XYBoxAndWhiskerRenderer()
Creates a new renderer for box and whisker charts.


XYBoxAndWhiskerRenderer

public XYBoxAndWhiskerRenderer(double boxWidth)
Creates a new renderer for box and whisker charts.

Use -1 for the box width if you prefer the width to be calculated automatically.

Parameters:
boxWidth - The box width.
Method Detail

getBoxWidth

public double getBoxWidth()
Returns the width of each box.

Returns:
The box width.

setBoxWidth

public void setBoxWidth(double width)
Sets the box width.

If you set the width to a negative value, the renderer will calculate the box width automatically based on the space available on the chart.

Parameters:
width - The width.

getPaint

public java.awt.Paint getPaint()
Returns the paint used to fill boxes.

Returns:
The paint.

setPaint

public void setPaint(java.awt.Paint paint)
Sets the paint used to fill boxes.

Registered property change listeners are notified that the "BoxAndWhiskerRenderer.paint" property has changed.

Overrides:
setPaint in class AbstractRenderer
Parameters:
paint - The paint.

getArtifactPaint

public java.awt.Paint getArtifactPaint()
Returns the paint used to paint the various artifacts such as outliers, farout symbol, median line and the averages ellipse.

Returns:
The paint.

setArtifactPaint

public void setArtifactPaint(java.awt.Paint artifactPaint)
Sets the paint used to paint the various artifacts such as outliers, farout symbol, median line and the averages ellipse.

Parameters:
artifactPaint - the paint.

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,
                     CrosshairInfo crosshairInfo,
                     int pass)
Draws the visual representation of a single data item.

Specified by:
drawItem in interface XYItemRenderer
Parameters:
g2 - the graphics device.
state - the renderer state.
dataArea - the area within which the plot is being drawn.
info - collects info 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).
crosshairInfo - information about crosshairs on a plot.
pass - the pass index.

drawHorizontalItem

public void drawHorizontalItem(java.awt.Graphics2D g2,
                               java.awt.geom.Rectangle2D dataArea,
                               PlotRenderingInfo info,
                               XYPlot plot,
                               ValueAxis domainAxis,
                               ValueAxis rangeAxis,
                               XYDataset dataset,
                               int series,
                               int item,
                               CrosshairInfo crosshairInfo,
                               int pass)
Draws the visual representation of a single data item.

Parameters:
g2 - the graphics device.
dataArea - the area within which the plot is being drawn.
info - collects info 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).
crosshairInfo - information about crosshairs on a plot.
pass - the pass index.

drawVerticalItem

public void drawVerticalItem(java.awt.Graphics2D g2,
                             java.awt.geom.Rectangle2D dataArea,
                             PlotRenderingInfo info,
                             XYPlot plot,
                             ValueAxis domainAxis,
                             ValueAxis rangeAxis,
                             XYDataset dataset,
                             int series,
                             int item,
                             CrosshairInfo crosshairInfo,
                             int pass)
Draws the visual representation of a single data item.

Parameters:
g2 - the graphics device.
dataArea - the area within which the plot is being drawn.
info - collects info 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).
crosshairInfo - information about crosshairs on a plot.
pass - the pass index.

equals

public boolean equals(java.lang.Object obj)
Tests this renderer for equality with another object.

Overrides:
equals in class AbstractXYItemRenderer
Parameters:
obj - the object.
Returns:
true or false.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the renderer.

Specified by:
clone in interface org.jfree.util.PublicCloneable
Overrides:
clone in class AbstractXYItemRenderer
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if the renderer cannot be cloned.