Package org.jfree.chart.renderer
Class WaferMapRenderer
- java.lang.Object
-
- org.jfree.chart.renderer.AbstractRenderer
-
- org.jfree.chart.renderer.WaferMapRenderer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class WaferMapRenderer extends AbstractRenderer
A renderer for wafer map plots. Provides color management facilities.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_PAINT_LIMITdefault paint limitprivate java.util.MappaintIndexpaint indexprivate intpaintIndexMethodpaint index methodprivate intpaintLimitpaint limitprivate WaferMapPlotplotplotstatic intPOSITION_INDEXdefault multivalue paint calculationstatic intVALUE_INDEXThe 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
Constructors Constructor Description WaferMapRenderer()Creates a new renderer.WaferMapRenderer(int paintLimit, int paintIndexMethod)Creates a new renderer.WaferMapRenderer(java.lang.Integer paintLimit, java.lang.Integer paintIndexMethod)Creates a new renderer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.PaintgetChipColor(java.lang.Number value)Returns the paint for a given chip value.DrawingSuppliergetDrawingSupplier()Returns the drawing supplier from the plot.LegendItemCollectiongetLegendCollection()Builds the list of legend entries.private java.lang.NumbergetMaxPaintValue(java.lang.Integer index)Returns the maximum chip value assigned to a color in the paintIndexprivate java.lang.NumbergetMinPaintValue(java.lang.Integer index)Returns the minimum chip value assigned to a color in the paintIndexprivate intgetPaintIndex(java.lang.Number value)Returns the paint index for a given chip value.WaferMapPlotgetPlot()Returns the plot.private booleanisMethodValid(int method)Verifies that the passed paint index method is valid.private voidmakePaintIndex()Builds a map of chip values to paint colors.private voidmakePositionIndex(java.util.Set uniqueValues)Builds the paintindex by assigning colors based on the number of unique values: totalvalues/totalcolors.private voidmakeValueIndex(java.lang.Number max, java.lang.Number min, java.util.Set uniqueValues)Builds the paintindex by assigning colors evenly across the range of values: maxValue-minValue/totalcolorsvoidsetPlot(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 Detail
-
paintIndex
private java.util.Map paintIndex
paint index
-
plot
private WaferMapPlot plot
plot
-
paintLimit
private int paintLimit
paint limit
-
DEFAULT_PAINT_LIMIT
private static final int DEFAULT_PAINT_LIMIT
default paint limit- See Also:
- Constant Field Values
-
POSITION_INDEX
public static final int POSITION_INDEX
default multivalue paint calculation- See Also:
- Constant Field Values
-
VALUE_INDEX
public static final int VALUE_INDEX
The default value index.- See Also:
- Constant Field Values
-
paintIndexMethod
private int paintIndexMethod
paint index method
-
-
Constructor Detail
-
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
public WaferMapRenderer(java.lang.Integer paintLimit, java.lang.Integer paintIndexMethod)Creates a new renderer.- Parameters:
paintLimit- the paint limit.paintIndexMethod- the paint index method.
-
-
Method Detail
-
isMethodValid
private boolean isMethodValid(int method)
Verifies that the passed paint index method is valid.- Parameters:
method- the method.- Returns:
trueor false.
-
getDrawingSupplier
public DrawingSupplier getDrawingSupplier()
Returns the drawing supplier from the plot.- Specified by:
getDrawingSupplierin classAbstractRenderer- Returns:
- The drawing supplier.
-
getPlot
public WaferMapPlot getPlot()
Returns the plot.- Returns:
- The plot.
-
setPlot
public void setPlot(WaferMapPlot plot)
Sets the plot and build the paint index.- Parameters:
plot- the plot.
-
getChipColor
public java.awt.Paint getChipColor(java.lang.Number value)
Returns the paint for a given chip value.- Parameters:
value- the value.- Returns:
- The paint.
-
getPaintIndex
private int getPaintIndex(java.lang.Number value)
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
private void makePositionIndex(java.util.Set uniqueValues)
Builds the paintindex by assigning colors based on the number of unique values: totalvalues/totalcolors.- Parameters:
uniqueValues- the set of unique values.
-
makeValueIndex
private void makeValueIndex(java.lang.Number max, java.lang.Number min, java.util.Set uniqueValues)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
public LegendItemCollection getLegendCollection()
Builds the list of legend entries. called by getLegendItems in WaferMapPlot to populate the plot legend.- Returns:
- The legend items.
-
getMinPaintValue
private java.lang.Number getMinPaintValue(java.lang.Integer index)
Returns the minimum chip value assigned to a color in the paintIndex- Parameters:
index- the index.- Returns:
- The value.
-
getMaxPaintValue
private java.lang.Number getMaxPaintValue(java.lang.Integer index)
Returns the maximum chip value assigned to a color in the paintIndex- Parameters:
index- the index.- Returns:
- The value
-
-