Package org.jfree.chart.renderer
Class WaferMapRenderer
java.lang.Object
org.jfree.chart.renderer.AbstractRenderer
org.jfree.chart.renderer.WaferMapRenderer
- All Implemented Interfaces:
Serializable
,Cloneable
A renderer for wafer map plots. Provides color management facilities.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
default paint limitprivate Map
paint indexprivate int
paint index methodprivate int
paint limitprivate WaferMapPlot
plotstatic final int
default multivalue paint calculationstatic final int
The default value index.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
ConstructorsConstructorDescriptionCreates a new renderer.WaferMapRenderer
(int paintLimit, int paintIndexMethod) Creates a new renderer.WaferMapRenderer
(Integer paintLimit, Integer paintIndexMethod) Creates a new renderer. -
Method Summary
Modifier and TypeMethodDescriptiongetChipColor
(Number value) Returns the paint for a given chip value.Returns the drawing supplier from the plot.Builds the list of legend entries.private Number
getMaxPaintValue
(Integer index) Returns the maximum chip value assigned to a color in the paintIndexprivate Number
getMinPaintValue
(Integer index) Returns the minimum chip value assigned to a color in the paintIndexprivate int
getPaintIndex
(Number value) Returns the paint index for a given chip value.getPlot()
Returns the plot.private boolean
isMethodValid
(int method) Verifies that the passed paint index method is valid.private void
Builds a map of chip values to paint colors.private void
makePositionIndex
(Set uniqueValues) Builds the paintindex by assigning colors based on the number of unique values: totalvalues/totalcolors.private void
makeValueIndex
(Number max, Number min, Set uniqueValues) Builds the paintindex by assigning colors evenly across the range of values: maxValue-minValue/totalcolorsvoid
setPlot
(WaferMapPlot plot) Sets the plot and build the paint index.Methods inherited from class org.jfree.chart.renderer.AbstractRenderer
addChangeListener, beginElementGroup, calculateLabelAnchorPoint, clearSeriesPaints, clearSeriesStrokes, clone, endElementGroup, equals, 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, hashCode, 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
-
Field Details
-
paintIndex
paint index -
plot
plot -
paintLimit
private int paintLimitpaint limit -
DEFAULT_PAINT_LIMIT
private static final int DEFAULT_PAINT_LIMITdefault paint limit- See Also:
-
POSITION_INDEX
public static final int POSITION_INDEXdefault multivalue paint calculation- See Also:
-
VALUE_INDEX
public static final int VALUE_INDEXThe default value index.- See Also:
-
paintIndexMethod
private int paintIndexMethodpaint index method
-
-
Constructor Details
-
WaferMapRenderer
public WaferMapRenderer()Creates a new renderer. -
WaferMapRenderer
public WaferMapRenderer(int paintLimit, int paintIndexMethod) Creates a new renderer.- Parameters:
paintLimit
- the paint limit.paintIndexMethod
- the paint index method.
-
WaferMapRenderer
Creates a new renderer.- Parameters:
paintLimit
- the paint limit.paintIndexMethod
- the paint index method.
-
-
Method Details
-
isMethodValid
private boolean isMethodValid(int method) Verifies that the passed paint index method is valid.- Parameters:
method
- the method.- Returns:
true
or false.
-
getDrawingSupplier
Returns the drawing supplier from the plot.- Specified by:
getDrawingSupplier
in classAbstractRenderer
- Returns:
- The drawing supplier.
-
getPlot
Returns the plot.- Returns:
- The plot.
-
setPlot
Sets the plot and build the paint index.- Parameters:
plot
- the plot.
-
getChipColor
Returns the paint for a given chip value.- Parameters:
value
- the value.- Returns:
- The paint.
-
getPaintIndex
Returns the paint index for a given chip value.- Parameters:
value
- the value.- Returns:
- The paint index.
-
makePaintIndex
private void makePaintIndex()Builds a map of chip values to paint colors. paintlimit is the maximum allowed number of colors. -
makePositionIndex
Builds the paintindex by assigning colors based on the number of unique values: totalvalues/totalcolors.- Parameters:
uniqueValues
- the set of unique values.
-
makeValueIndex
Builds the paintindex by assigning colors evenly across the range of values: maxValue-minValue/totalcolors- Parameters:
max
- the maximum value.min
- the minumum value.uniqueValues
- the unique values.
-
getLegendCollection
Builds the list of legend entries. called by getLegendItems in WaferMapPlot to populate the plot legend.- Returns:
- The legend items.
-
getMinPaintValue
Returns the minimum chip value assigned to a color in the paintIndex- Parameters:
index
- the index.- Returns:
- The value.
-
getMaxPaintValue
Returns the maximum chip value assigned to a color in the paintIndex- Parameters:
index
- the index.- Returns:
- The value
-