Package org.jfree.chart.renderer
Class XYBoxAndWhiskerRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.AbstractXYItemRenderer
org.jfree.chart.renderer.XYBoxAndWhiskerRenderer
- All Implemented Interfaces:
Serializable
,Cloneable
,XYItemRenderer
,org.jfree.util.PublicCloneable
public class XYBoxAndWhiskerRenderer extends AbstractXYItemRenderer implements XYItemRenderer, Cloneable, org.jfree.util.PublicCloneable, Serializable
A renderer that draws box-and-whisker items on an
XYPlot
. This
renderer requires a BoxAndWhiskerXYDataset
).
This renderer does not include any code to calculate the crosshair point.
- 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
Constructors Constructor Description XYBoxAndWhiskerRenderer()
Creates a new renderer for box and whisker charts.XYBoxAndWhiskerRenderer(double boxWidth)
Creates a new renderer for box and whisker charts. -
Method Summary
Modifier and Type Method Description Object
clone()
Returns a clone of the renderer.void
drawHorizontalItem(Graphics2D g2, 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.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.void
drawVerticalItem(Graphics2D g2, 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 another object.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.boolean
getFillBox()
Returns the flag that controls whether or not the box is filled.Paint
getPaint()
Returns the paint used to fill boxes.void
setArtifactPaint(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
setFillBox(boolean flag)
Sets the flag that controls whether or not the box is filled and sends aRendererChangeEvent
to all registered listeners.void
setPaint(Paint paint)
Sets the paint used to fill boxes.Methods inherited from class org.jfree.chart.renderer.AbstractXYItemRenderer
drawDomainGridLine, drawDomainMarker, drawRangeGridLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getBaseLabelGenerator, getBaseToolTipGenerator, getDrawingSupplier, getLabelGenerator, getLegendItem, getPassCount, getPlot, getRangeExtent, getRangeType, getSeriesLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getURLGenerator, initialise, setBaseLabelGenerator, setBaseToolTipGenerator, setLabelGenerator, setPlot, setSeriesLabelGenerator, setSeriesToolTipGenerator, setToolTipGenerator, setURLGenerator
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, getBaseItemLabelAnchor, getBaseItemLabelAngle, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelRotationAnchor, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelAnchorOffset, getItemLabelAngle, getItemLabelFont, getItemLabelFont, getItemLabelPaint, 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, setBaseAngle, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelRotationAnchor, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setItemLabelAnchor, setItemLabelAnchorOffset, 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, 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
getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jfree.chart.renderer.XYItemRenderer
addChangeListener, drawDomainGridLine, drawDomainMarker, drawRangeGridLine, drawRangeMarker, fillDomainGridBand, fillRangeGridBand, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseLabelGenerator, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getBaseToolTipGenerator, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getLabelGenerator, getLegendItem, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPassCount, getPlot, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getRangeExtent, getRangeType, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesLabelGenerator, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesToolTipGenerator, getToolTipGenerator, getURLGenerator, initialise, isItemLabelVisible, isSeriesItemLabelsVisible, removeChangeListener, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseLabelGenerator, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseStroke, setBaseToolTipGenerator, setItemLabelFont, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setLabelGenerator, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPlot, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesLabelGenerator, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setSeriesToolTipGenerator, setShape, setStroke, setToolTipGenerator, setURLGenerator
-
Constructor Details
-
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 Details
-
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
Returns the paint used to fill boxes.- Returns:
- the paint (possibly
null
).
-
setPaint
Sets the paint used to fill boxes.Registered property change listeners are notified that the "BoxAndWhiskerRenderer.paint" property has changed.
- Specified by:
setPaint
in interfaceXYItemRenderer
- Overrides:
setPaint
in classAbstractRenderer
- Parameters:
paint
- the paint (null
permitted).
-
getFillBox
public boolean getFillBox()Returns the flag that controls whether or not the box is filled.- Returns:
- A boolean.
-
setFillBox
public void setFillBox(boolean flag)Sets the flag that controls whether or not the box is filled and sends aRendererChangeEvent
to all registered listeners.- Parameters:
flag
- the flag.
-
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
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(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.- Specified by:
drawItem
in interfaceXYItemRenderer
- 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).crosshairState
- crosshair information for the plot (null
permitted).pass
- the pass index.
-
drawHorizontalItem
public void drawHorizontalItem(Graphics2D g2, 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.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).crosshairState
- crosshair information for the plot (null
permitted).pass
- the pass index.
-
drawVerticalItem
public void drawVerticalItem(Graphics2D g2, 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.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).crosshairState
- crosshair information for the plot (null
permitted).pass
- the pass index.
-
equals
Tests this renderer for equality with another object.- Overrides:
equals
in classAbstractXYItemRenderer
- Parameters:
obj
- the object.- Returns:
true
orfalse
.
-
clone
Returns a clone of the renderer.- Specified by:
clone
in interfaceorg.jfree.util.PublicCloneable
- Returns:
- A clone.
- Throws:
CloneNotSupportedException
- if the renderer cannot be cloned.
-