Class MinMaxCategoryRenderer
- java.lang.Object
-
- org.jfree.chart.renderer.AbstractRenderer
-
- org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
-
- org.jfree.chart.renderer.category.MinMaxCategoryRenderer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,LegendItemSource,CategoryItemRenderer,PublicCloneable
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 usingobjectIconand a line from the maximum value to the minimum value. For use with theCategoryPlotclass. The example shown here is generated by theMinMaxCategoryPlotDemo1.javaprogram included in the JFreeChart Demo Collection:

- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.awt.PaintgroupPaintThe paint of the line between the minimum value and the maximum value.private java.awt.StrokegroupStrokeThe stroke of the line between the minimum value and the maximum value.private intlastCategoryThe last category.private doublemaxThe maximum.private javax.swing.IconmaxIconThe icon used to indicate the maximum value.private doubleminThe minimum.private javax.swing.IconminIconThe icon used to indicate the minimum value.private javax.swing.IconobjectIconThe icon used to indicate the values.private booleanplotLinesA flag indicating whether or not lines are drawn between XY points.private static longserialVersionUIDFor serialization.-
Fields inherited from class org.jfree.chart.renderer.AbstractRenderer
DEFAULT_ITEM_LABEL_INSETS, 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 MinMaxCategoryRenderer()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawItem(java.awt.Graphics2D g2, CategoryItemRendererState state, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)Draw a single data item.booleanequals(java.lang.Object obj)Tests this instance for equality with an arbitrary object.java.awt.PaintgetGroupPaint()Returns the paint used to draw the line between the minimum and maximum value items in each category.java.awt.StrokegetGroupStroke()Returns the stroke used to draw the line between the minimum and maximum value items in each category.private javax.swing.IcongetIcon(java.awt.Shape shape, boolean fill, boolean outline)Returns an icon from a shape.private javax.swing.IcongetIcon(java.awt.Shape shape, java.awt.Paint fillPaint, java.awt.Paint outlinePaint)Returns an icon.javax.swing.IcongetMaxIcon()Returns the icon displayed for the maximum value data item within each category.javax.swing.IcongetMinIcon()Returns the icon displayed for the minimum value data item within each category.javax.swing.IcongetObjectIcon()Returns the icon drawn for each data item.booleanisDrawLines()Gets whether or not lines are drawn between category points.private voidreadObject(java.io.ObjectInputStream stream)Provides serialization support.voidsetDrawLines(boolean draw)Sets the flag that controls whether or not lines are drawn to connect the items within a series and sends aRendererChangeEventto all registered listeners.voidsetGroupPaint(java.awt.Paint paint)Sets the paint used to draw the line between the minimum and maximum value items in each category and sends aRendererChangeEventto all registered listeners.voidsetGroupStroke(java.awt.Stroke stroke)Sets the stroke of the line between the minimum value and the maximum value and sends aRendererChangeEventto all registered listeners.voidsetMaxIcon(javax.swing.Icon icon)Sets the icon displayed for the maximum value data item within each category and sends aRendererChangeEventto all registered listeners.voidsetMinIcon(javax.swing.Icon icon)Sets the icon displayed for the minimum value data item within each category and sends aRendererChangeEventto all registered listeners.voidsetObjectIcon(javax.swing.Icon icon)Sets the icon drawn for each data item and sends aRendererChangeEventto all registered listeners.private voidwriteObject(java.io.ObjectOutputStream stream)Provides serialization support.-
Methods inherited from class org.jfree.chart.renderer.category.AbstractCategoryItemRenderer
addEntity, addItemEntity, beginElementGroup, calculateDomainMarkerTextAnchorPoint, calculateRangeMarkerTextAnchorPoint, clone, createState, drawBackground, drawDomainGridline, drawDomainMarker, drawItemLabel, drawOutline, drawRangeLine, drawRangeMarker, findRangeBounds, findRangeBounds, getColumnCount, getDefaultItemLabelGenerator, getDefaultItemURLGenerator, getDefaultToolTipGenerator, getDomainAxis, getDrawingSupplier, getItemLabelGenerator, getItemMiddle, getItemURLGenerator, getLegendItem, getLegendItemLabelGenerator, getLegendItems, getLegendItemToolTipGenerator, getLegendItemURLGenerator, getPassCount, getPlot, getRangeAxis, getRowCount, getSeriesItemLabelGenerator, getSeriesItemURLGenerator, getSeriesToolTipGenerator, getToolTipGenerator, hashCode, initialise, setDefaultItemLabelGenerator, setDefaultItemLabelGenerator, setDefaultItemURLGenerator, setDefaultItemURLGenerator, setDefaultToolTipGenerator, setDefaultToolTipGenerator, setLegendItemLabelGenerator, setLegendItemToolTipGenerator, setLegendItemURLGenerator, setPlot, setSeriesItemLabelGenerator, setSeriesItemLabelGenerator, setSeriesItemURLGenerator, setSeriesItemURLGenerator, setSeriesToolTipGenerator, setSeriesToolTipGenerator, updateCrosshairValues
-
Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, endElementGroup, fireChangeEvent, getAutoPopulateSeriesFillPaint, getAutoPopulateSeriesOutlinePaint, getAutoPopulateSeriesOutlineStroke, getAutoPopulateSeriesPaint, getAutoPopulateSeriesShape, getAutoPopulateSeriesStroke, getDataBoundsIncludesVisibleSeriesOnly, getDefaultCreateEntities, getDefaultEntityRadius, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultLegendShape, getDefaultLegendTextFont, getDefaultLegendTextPaint, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelAnchorOffset, getItemLabelFont, getItemLabelInsets, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getLegendShape, getLegendTextFont, getLegendTextPaint, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, getTreatLegendShapeAsLine, hasListener, isComputeItemLabelContrastColor, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, lookupLegendShape, lookupLegendTextFont, lookupLegendTextPaint, lookupSeriesFillPaint, lookupSeriesOutlinePaint, lookupSeriesOutlineStroke, lookupSeriesPaint, lookupSeriesShape, lookupSeriesStroke, notifyListeners, removeChangeListener, setAutoPopulateSeriesFillPaint, setAutoPopulateSeriesOutlinePaint, setAutoPopulateSeriesOutlineStroke, setAutoPopulateSeriesPaint, setAutoPopulateSeriesShape, setAutoPopulateSeriesStroke, setComputeItemLabelContrastColor, setDataBoundsIncludesVisibleSeriesOnly, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultEntityRadius, setDefaultFillPaint, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultLegendShape, setDefaultLegendTextFont, setDefaultLegendTextPaint, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setItemLabelAnchorOffset, setItemLabelInsets, setLegendShape, setLegendTextFont, setLegendTextPaint, 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, setSeriesVisibleInLegend, setSeriesVisibleInLegend, setTreatLegendShapeAsLine
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jfree.chart.renderer.category.CategoryItemRenderer
addChangeListener, getDefaultCreateEntities, getDefaultFillPaint, getDefaultItemLabelFont, getDefaultItemLabelPaint, getDefaultItemLabelsVisible, getDefaultNegativeItemLabelPosition, getDefaultOutlinePaint, getDefaultOutlineStroke, getDefaultPaint, getDefaultPositiveItemLabelPosition, getDefaultSeriesVisible, getDefaultSeriesVisibleInLegend, getDefaultShape, getDefaultStroke, getItemCreateEntity, getItemFillPaint, getItemLabelFont, getItemLabelPaint, getItemOutlinePaint, getItemOutlineStroke, getItemPaint, getItemShape, getItemStroke, getItemVisible, getNegativeItemLabelPosition, getPositiveItemLabelPosition, getSeriesCreateEntities, getSeriesFillPaint, getSeriesItemLabelFont, getSeriesItemLabelPaint, getSeriesNegativeItemLabelPosition, getSeriesOutlinePaint, getSeriesOutlineStroke, getSeriesPaint, getSeriesPositiveItemLabelPosition, getSeriesShape, getSeriesStroke, getSeriesVisible, getSeriesVisibleInLegend, isItemLabelVisible, isSeriesItemLabelsVisible, isSeriesVisible, isSeriesVisibleInLegend, removeChangeListener, setDefaultCreateEntities, setDefaultCreateEntities, setDefaultFillPaint, setDefaultItemLabelFont, setDefaultItemLabelFont, setDefaultItemLabelPaint, setDefaultItemLabelPaint, setDefaultItemLabelsVisible, setDefaultItemLabelsVisible, setDefaultNegativeItemLabelPosition, setDefaultNegativeItemLabelPosition, setDefaultOutlinePaint, setDefaultOutlinePaint, setDefaultOutlineStroke, setDefaultOutlineStroke, setDefaultPaint, setDefaultPaint, setDefaultPositiveItemLabelPosition, setDefaultPositiveItemLabelPosition, setDefaultSeriesVisible, setDefaultSeriesVisible, setDefaultSeriesVisibleInLegend, setDefaultSeriesVisibleInLegend, setDefaultShape, setDefaultShape, setDefaultStroke, setDefaultStroke, setSeriesCreateEntities, setSeriesCreateEntities, setSeriesFillPaint, setSeriesItemLabelFont, setSeriesItemLabelFont, setSeriesItemLabelPaint, setSeriesItemLabelPaint, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesItemLabelsVisible, setSeriesNegativeItemLabelPosition, setSeriesNegativeItemLabelPosition, setSeriesOutlinePaint, setSeriesOutlinePaint, setSeriesOutlineStroke, setSeriesOutlineStroke, setSeriesPaint, setSeriesPaint, setSeriesPositiveItemLabelPosition, setSeriesPositiveItemLabelPosition, setSeriesShape, setSeriesShape, setSeriesStroke, setSeriesStroke, setSeriesVisible, setSeriesVisible, setSeriesVisibleInLegend, setSeriesVisibleInLegend
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
plotLines
private boolean plotLines
A flag indicating whether or not lines are drawn between XY points.
-
groupPaint
private transient java.awt.Paint groupPaint
The paint of the line between the minimum value and the maximum value.
-
groupStroke
private transient java.awt.Stroke groupStroke
The stroke of the line between the minimum value and the maximum value.
-
minIcon
private transient javax.swing.Icon minIcon
The icon used to indicate the minimum value.
-
maxIcon
private transient javax.swing.Icon maxIcon
The icon used to indicate the maximum value.
-
objectIcon
private transient javax.swing.Icon objectIcon
The icon used to indicate the values.
-
lastCategory
private int lastCategory
The last category.
-
min
private double min
The minimum.
-
max
private double max
The maximum.
-
-
Method Detail
-
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.
- See Also:
setDrawLines(boolean)
-
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 aRendererChangeEventto all registered listeners.- Parameters:
draw- the new value of the flag.- See Also:
isDrawLines()
-
getGroupPaint
public java.awt.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). - See Also:
setGroupPaint(Paint)
-
setGroupPaint
public void setGroupPaint(java.awt.Paint paint)
Sets the paint used to draw the line between the minimum and maximum value items in each category and sends aRendererChangeEventto all registered listeners.- Parameters:
paint- the paint (nullnot permitted).- See Also:
getGroupPaint()
-
getGroupStroke
public java.awt.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). - See Also:
setGroupStroke(Stroke)
-
setGroupStroke
public void setGroupStroke(java.awt.Stroke stroke)
Sets the stroke of the line between the minimum value and the maximum value and sends aRendererChangeEventto all registered listeners.- Parameters:
stroke- the new stroke (nullnot permitted).
-
getObjectIcon
public javax.swing.Icon getObjectIcon()
Returns the icon drawn for each data item.- Returns:
- The icon (never
null). - See Also:
setObjectIcon(Icon)
-
setObjectIcon
public void setObjectIcon(javax.swing.Icon icon)
Sets the icon drawn for each data item and sends aRendererChangeEventto all registered listeners.- Parameters:
icon- the icon.- See Also:
getObjectIcon()
-
getMaxIcon
public javax.swing.Icon getMaxIcon()
Returns the icon displayed for the maximum value data item within each category.- Returns:
- The icon (never
null). - See Also:
setMaxIcon(Icon)
-
setMaxIcon
public void setMaxIcon(javax.swing.Icon icon)
Sets the icon displayed for the maximum value data item within each category and sends aRendererChangeEventto all registered listeners.- Parameters:
icon- the icon (nullnot permitted).- See Also:
getMaxIcon()
-
getMinIcon
public javax.swing.Icon getMinIcon()
Returns the icon displayed for the minimum value data item within each category.- Returns:
- The icon (never
null). - See Also:
setMinIcon(Icon)
-
setMinIcon
public void setMinIcon(javax.swing.Icon icon)
Sets the icon displayed for the minimum value data item within each category and sends aRendererChangeEventto all registered listeners.- Parameters:
icon- the icon (nullnot permitted).- See Also:
getMinIcon()
-
drawItem
public void drawItem(java.awt.Graphics2D g2, CategoryItemRendererState state, java.awt.geom.Rectangle2D dataArea, CategoryPlot plot, CategoryAxis domainAxis, ValueAxis rangeAxis, CategoryDataset dataset, int row, int column, int pass)Draw a single data item.- 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.
-
equals
public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object. The icon fields are NOT included in the test, so this implementation is a little weak.- Overrides:
equalsin classAbstractCategoryItemRenderer- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
getIcon
private javax.swing.Icon getIcon(java.awt.Shape shape, java.awt.Paint fillPaint, java.awt.Paint outlinePaint)Returns an icon.- Parameters:
shape- the shape.fillPaint- the fill paint.outlinePaint- the outline paint.- Returns:
- The icon.
-
getIcon
private javax.swing.Icon getIcon(java.awt.Shape shape, boolean fill, boolean outline)Returns an icon from a shape.- Parameters:
shape- the shape.fill- the fill flag.outline- the outline flag.- Returns:
- The icon.
-
writeObject
private void writeObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionProvides serialization support.- Parameters:
stream- the output stream.- Throws:
java.io.IOException- if there is an I/O error.
-
readObject
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, java.lang.ClassNotFoundExceptionProvides serialization support.- Parameters:
stream- the input stream.- Throws:
java.io.IOException- if there is an I/O error.java.lang.ClassNotFoundException- if there is a classpath problem.
-
-