Package org.jfree.chart.renderer
Class BoxAndWhiskerRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.AbstractCategoryItemRenderer
org.jfree.chart.renderer.BoxAndWhiskerRenderer
- All Implemented Interfaces:
Serializable,Cloneable,CategoryItemRenderer,org.jfree.util.PublicCloneable
public class BoxAndWhiskerRenderer extends AbstractCategoryItemRenderer implements Cloneable, org.jfree.util.PublicCloneable, Serializable
A box-and-whisker renderer.
- 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 BoxAndWhiskerRenderer()Default constructor. -
Method Summary
Modifier and Type Method Description voiddrawHorizontalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draws the visual representation of a single data item when the plot has a horizontal orientation.voiddrawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draw a single data item.voiddrawVerticalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draws the visual representation of a single data item when the plot has a vertical orientation.booleanequals(Object obj)Tests this renderer for equality with an arbitrary object.PaintgetArtifactPaint()Returns the paint used to color the median and average markers.booleangetFillBox()Returns the flag that controls whether or not the box is filled.doublegetItemMargin()Returns the item margin.CategoryItemRendererStateinitialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)Initialises the renderer.voidsetArtifactPaint(Paint paint)Sets the paint used to color the median and average markers.voidsetFillBox(boolean flag)Sets the flag that controls whether or not the box is filled and sends aRendererChangeEventto all registered listeners.voidsetItemMargin(double margin)Sets the item margin.Methods inherited from class org.jfree.chart.renderer.AbstractCategoryItemRenderer
clone, drawBackground, drawDomainGridline, drawOutline, drawRangeGridline, drawRangeMarker, getBaseItemURLGenerator, getBaseLabelGenerator, getBaseToolTipGenerator, getColumnCount, getDrawingSupplier, getItemURLGenerator, getLabelGenerator, getLegendItem, getPlot, getRangeExtent, getRowCount, getSeriesItemURLGenerator, getSeriesLabelGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, hashCode, setBaseItemURLGenerator, setBaseLabelGenerator, setBaseToolTipGenerator, setItemURLGenerator, setLabelGenerator, setPlot, setSeriesItemURLGenerator, setSeriesLabelGenerator, setSeriesToolTipGenerator, setToolTipGeneratorMethods 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, 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, 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, setStrokeMethods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jfree.chart.renderer.CategoryItemRenderer
addChangeListener, getBaseItemLabelAnchor, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseItemLabelTextAnchor, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseShape, getBaseStroke, getItemLabelAnchor, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemLabelTextAnchor, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesItemLabelAnchor, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesItemLabelTextAnchor, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, isItemLabelVisible, isSeriesItemLabelsVisible, removeChangeListener, setBaseItemLabelAnchor, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelTextAnchor, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlineStroke, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseShape, setBaseStroke, setItemLabelAnchor, setItemLabelFont, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, setItemLabelTextAnchor, setNegativeItemLabelPosition, setNegativeItemLabelPosition, setOutlinePaint, setOutlineStroke, setPaint, setPositiveItemLabelPosition, setPositiveItemLabelPosition, setSeriesItemLabelAnchor, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelTextAnchor, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesStroke, setShape, setStrokeMethods inherited from interface org.jfree.util.PublicCloneable
clone
-
Constructor Details
-
BoxAndWhiskerRenderer
public BoxAndWhiskerRenderer()Default constructor.
-
-
Method Details
-
getArtifactPaint
Returns the paint used to color the median and average markers.- Returns:
- A paint.
-
setArtifactPaint
Sets the paint used to color the median and average markers.- Parameters:
paint- the paint.
-
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 aRendererChangeEventto all registered listeners.- Parameters:
flag- the flag.
-
getItemMargin
public double getItemMargin()Returns the item margin. This is a percentage of the available space that is allocated to the space between items in the chart.- Returns:
- The margin.
-
setItemMargin
public void setItemMargin(double margin)Sets the item margin.- Parameters:
margin- the margin.
-
initialise
public CategoryItemRendererState initialise(Graphics2D g2, Rectangle2D dataArea, CategoryPlot plot, int rendererIndex, PlotRenderingInfo info)Initialises the renderer.This method gets called once at the start of the process of drawing a chart.
- Specified by:
initialisein interfaceCategoryItemRenderer- Overrides:
initialisein classAbstractCategoryItemRenderer- Parameters:
g2- the graphics device.dataArea- the area in which the data is to be plotted.plot- the plot.rendererIndex- the renderer index.info- collects chart rendering information for return to caller.- Returns:
- The renderer state.
-
drawItem
public void drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draw a single data item.- Specified by:
drawItemin interfaceCategoryItemRenderer- Parameters:
g2- the graphics device.state- the renderer state.dataArea- the area in which the data is drawn.plot- the plot.domainAxis- the domain axis.rangeAxis- the range axis.dataset- the data.row- the row index (zero-based).column- the column index (zero-based).
-
drawHorizontalItem
public void drawHorizontalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draws the visual representation of a single data item when the plot has a horizontal orientation.- Parameters:
g2- the graphics device.state- the renderer state.dataArea- the area within which the plot is being drawn.plot- the plot (can be used to obtain standard color information etc).domainAxis- the domain axis.rangeAxis- the range axis.dataset- the dataset.row- the row index (zero-based).column- the column index (zero-based).
-
drawVerticalItem
public void drawVerticalItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column)Draws the visual representation of a single data item when the plot has a vertical orientation.- Parameters:
g2- the graphics device.state- the renderer state.dataArea- the area within which the plot is being drawn.plot- the plot (can be used to obtain standard color information etc).domainAxis- the domain axis.rangeAxis- the range axis.dataset- the dataset.row- the row index (zero-based).column- the column index (zero-based).
-
equals
Tests this renderer for equality with an arbitrary object.- Overrides:
equalsin classAbstractCategoryItemRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
trueorfalse.
-