org.jfree.chart.renderer.category

Class MinMaxCategoryRenderer

Implemented Interfaces:
CategoryItemRenderer, Cloneable, LegendItemSource, PublicCloneable, Serializable

public class MinMaxCategoryRenderer
extends AbstractCategoryItemRenderer

Renderer for drawing min max plot. This renderer draws all the series under the same category in the same x position using objectIcon and a line from the maximum value to the minimum value.

For use with the CategoryPlot class.

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

MinMaxCategoryRenderer()
Default constructor.

Method Summary

void
drawItem(Graphics2D g2, CategoryItemRendererState state, Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)
Draw a single data item.
Paint
getGroupPaint()
Returns the paint used to draw the line between the minimum and maximum value items in each category.
Stroke
getGroupStroke()
Returns the stroke used to draw the line between the minimum and maximum value items in each category.
Icon
getMaxIcon()
Returns the icon displayed for the maximum value data item within each category.
Icon
getMinIcon()
Returns the icon displayed for the minimum value data item within each category.
Icon
getObjectIcon()
Returns the icon drawn for each data item.
boolean
isDrawLines()
Gets whether or not lines are drawn between category points.
void
setDrawLines(boolean draw)
Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends a RendererChangeEvent to all registered listeners.
void
setGroupPaint(Paint paint)
Sets the paint used to draw the line between the minimum and maximum value items in each category and sends a RendererChangeEvent to all registered listeners.
void
setGroupStroke(Stroke groupStroke)
Sets the stroke of the line between the minimum value and the maximum value.
void
setMaxIcon(Icon icon)
Sets the icon displayed for the maximum value data item within each category and sends a RendererChangeEvent to all registered listeners.
void
setMinIcon(Icon icon)
Sets the icon displayed for the minimum value data item within each category and sends a RendererChangeEvent to all registered listeners.
void
setObjectIcon(Icon icon)
Sets the icon drawn for each data item.

Methods inherited from class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer

addItemEntity, calculateDomainMarkerTextAnchorPoint, calculateRangeMarkerTextAnchorPoint, clone, createState, drawBackground, drawDomainGridline, drawDomainMarker, drawItemLabel, drawOutline, drawRangeGridline, drawRangeMarker, equals, findRangeBounds, getBaseItemLabelGenerator, getBaseItemURLGenerator, getBaseToolTipGenerator, getColumnCount, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemURLGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getLegendItems, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, getToolTipGenerator, hashCode, initialise, setBaseItemLabelGenerator, setBaseItemURLGenerator, setBaseToolTipGenerator, setItemLabelGenerator, setItemURLGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setToolTipGenerator

Methods inherited from class org.jfree.chart.renderer.AbstractRenderer

addChangeListener, calculateLabelAnchorPoint, clone, equals, fireChangeEvent, getBaseCreateEntities, getBaseFillPaint, getBaseItemLabelFont, getBaseItemLabelPaint, getBaseItemLabelsVisible, getBaseNegativeItemLabelPosition, getBaseOutlinePaint, getBaseOutlineStroke, getBasePaint, getBasePositiveItemLabelPosition, getBaseSeriesVisible, getBaseSeriesVisibleInLegend, getBaseShape, getBaseStroke, getCreateEntities, getDrawingSupplier, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelFont, getItemLabelPaint, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisible, getSeriesVisibleInLegend, getSeriesVisibleInLegend, hasListener, hashCode, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, notifyListeners, removeChangeListener, setBaseCreateEntities, setBaseCreateEntities, setBaseFillPaint, setBaseFillPaint, setBaseItemLabelFont, setBaseItemLabelFont, setBaseItemLabelPaint, setBaseItemLabelPaint, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseItemLabelsVisible, setBaseNegativeItemLabelPosition, setBaseNegativeItemLabelPosition, setBaseOutlinePaint, setBaseOutlinePaint, setBaseOutlineStroke, setBaseOutlineStroke, setBasePaint, setBasePaint, setBasePositiveItemLabelPosition, setBasePositiveItemLabelPosition, setBaseSeriesVisible, setBaseSeriesVisible, setBaseSeriesVisibleInLegend, setBaseSeriesVisibleInLegend, setBaseShape, setBaseShape, setBaseStroke, setBaseStroke, setCreateEntities, setCreateEntities, setFillPaint, setFillPaint, setItemLabelAnchorOffset, setItemLabelFont, setItemLabelFont, setItemLabelPaint, setItemLabelPaint, setItemLabelsVisible, setItemLabelsVisible, setItemLabelsVisible, 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

Constructor Details

MinMaxCategoryRenderer

public MinMaxCategoryRenderer()
Default constructor.

Method Details

drawItem

public void drawItem(Graphics2D g2,
                     CategoryItemRendererState state,
                     Rectangle2D dataArea,
                     CategoryPlot plot,
                     CategoryAxis domainAxis,
                     ValueAxis rangeAxis,
                     CategoryDataset dataset,
                     int row,
                     int column,
                     int pass)
Draw a single data item.
Specified by:
drawItem in interface CategoryItemRenderer
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 dataset.
row - the row index (zero-based).
column - the column index (zero-based).
pass - the pass index.

getGroupPaint

public Paint getGroupPaint()
Returns the paint used to draw the line between the minimum and maximum value items in each category.
Returns:
The paint (never null).

getGroupStroke

public Stroke getGroupStroke()
Returns the stroke used to draw the line between the minimum and maximum value items in each category.
Returns:
The stroke (never null).

getMaxIcon

public Icon getMaxIcon()
Returns the icon displayed for the maximum value data item within each category.
Returns:
The icon (never null).

getMinIcon

public Icon getMinIcon()
Returns the icon displayed for the minimum value data item within each category.
Returns:
The icon (never null).

getObjectIcon

public Icon getObjectIcon()
Returns the icon drawn for each data item.
Returns:
The icon (never null).

isDrawLines

public boolean isDrawLines()
Gets whether or not lines are drawn between category points.
Returns:
boolean true if line will be drawn between sequenced categories, otherwise false.

setDrawLines

public void setDrawLines(boolean draw)
Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends a RendererChangeEvent to all registered listeners.
Parameters:
draw - the new value of the flag.
See Also:
isDrawLines()

setGroupPaint

public void setGroupPaint(Paint paint)
Sets the paint used to draw the line between the minimum and maximum value items in each category and sends a RendererChangeEvent to all registered listeners.
Parameters:
paint - the paint (null not permitted).

setGroupStroke

public void setGroupStroke(Stroke groupStroke)
Sets the stroke of the line between the minimum value and the maximum value.
Parameters:
groupStroke - The new stroke

setMaxIcon

public void setMaxIcon(Icon icon)
Sets the icon displayed for the maximum value data item within each category and sends a RendererChangeEvent to all registered listeners.
Parameters:
icon - the icon (null not permitted).
See Also:
getMaxIcon()

setMinIcon

public void setMinIcon(Icon icon)
Sets the icon displayed for the minimum value data item within each category and sends a RendererChangeEvent to all registered listeners.
Parameters:
icon - the icon (null not permitted).
See Also:
getMinIcon()

setObjectIcon

public void setObjectIcon(Icon icon)
Sets the icon drawn for each data item.
Parameters:
icon - the icon.