|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.ui.GenericMapper
simtools.ui.ColorMapper
public class ColorMapper
This class maps data sources and index to colors. The mapping is user defined, and based for example on the value of the data source For example, green value < 10, red above. Useful for making plots with "alarm" colors The data source shall not be saved into the object. Rather, this class goal is to implement a mapping independent of the data source given.
Nested Class Summary | |
---|---|
protected static class |
ColorMapper.ColorEditor
|
protected class |
ColorMapper.ColorMapperTableModel
|
protected class |
ColorMapper.ColorMappingTable
|
protected static class |
ColorMapper.ColorRenderer
|
Nested classes/interfaces inherited from class simtools.ui.GenericMapper |
---|
GenericMapper.Expression, GenericMapper.ExpressionDialog, GenericMapper.ExpressionEditor, GenericMapper.ExpressionMappingTable, GenericMapper.Interval, GenericMapper.MapperTableModel |
Field Summary | |
---|---|
static int |
BRIGHTNESS_CYCLE
|
static int |
COLOR_CYCLE
The default colors cycle between COLOR_CYCLE different hues, and SATURATION_CYCLE different SATURATION levels. |
static java.util.Vector |
colorMappers
The color mappers are application global |
protected static int |
defaultColorIndex
|
static java.util.ResourceBundle |
resources
|
static int |
SATURATION_CYCLE
|
Fields inherited from class simtools.ui.GenericMapper |
---|
defaultValue, intervals, listeners, map, name |
Constructor Summary | |
---|---|
ColorMapper()
|
|
ColorMapper(java.lang.String name)
|
Method Summary | |
---|---|
static ColorMapper |
createColorMapperDialog(javax.swing.JDialog owner)
|
GenericMapper.MapperTableModel |
createModel()
|
protected java.lang.Object |
createNewValue()
For subclasses to specialize, create a new object of the specialized type |
protected GenericMapper.ExpressionMappingTable |
createTable(javax.swing.JDialog parent)
For subclasses to specialize |
static ColorMapper |
getColorMapper(java.lang.String id)
|
java.awt.Paint |
getDefaultPaint()
|
java.awt.Paint |
getPaint(DataSource ds)
Realizes the mapping, and returns a Paint object for this data source and index |
java.awt.Paint |
getPaint(DataSource ds,
long index)
Realizes the mapping, and returns a Paint object for this data source and index |
java.awt.Paint |
getPaint(java.lang.Object value)
|
static void |
main(java.lang.String[] args)
|
void |
setDefaultPaint(java.awt.Paint defaultValue)
|
void |
setPaint(boolean isMore,
double value,
boolean boundIncluded,
java.awt.Paint paint)
Associate a paint with a double value infinite range. |
void |
setPaint(boolean isMore,
double value,
java.awt.Paint paint)
Associate a paint with a double value infinite range (bound included). |
void |
setPaint(boolean isMore,
long value,
boolean boundIncluded,
java.awt.Paint paint)
Associate a paint with a long value infinite range. |
void |
setPaint(boolean isMore,
long value,
java.awt.Paint paint)
Associate a paint with a long value infinite range (bound included). |
void |
setPaint(boolean isMore,
java.lang.String value,
boolean boundIncluded,
java.awt.Paint paint)
Associate a paint with a String value infinite range. |
void |
setPaint(boolean isMore,
java.lang.String value,
java.awt.Paint paint)
Associate a paint with a String value infinite range (bound included). |
void |
setPaint(double minvalue,
boolean boundedMin,
double maxvalue,
boolean boundedMax,
java.awt.Paint paint)
Associate a paint with a double value interval. |
void |
setPaint(double minvalue,
double maxvalue,
java.awt.Paint paint)
Associate a paint with a double value interval (bounds included) |
void |
setPaint(long minvalue,
boolean boundedMin,
long maxvalue,
boolean boundedMax,
java.awt.Paint paint)
Associate a paint with a long value interval. |
void |
setPaint(long minvalue,
long maxvalue,
java.awt.Paint paint)
Associate a paint with a long value interval (bounds included) |
void |
setPaint(java.lang.Object value,
java.awt.Paint paint)
Associate a paint with a value |
void |
setPaint(java.lang.String minvalue,
boolean boundedMin,
java.lang.String maxvalue,
boolean boundedMax,
java.awt.Paint paint)
Associate a paint with a String value interval. |
void |
setPaint(java.lang.String minvalue,
java.lang.String maxvalue,
java.awt.Paint paint)
Associate a paint with a String value interval (bounds included) |
static ColorMapper |
updateColorMapper(ColorMapper m)
If the mapper already exists in the list, update its values Otherwise add it to the list of existing mappers |
Methods inherited from class simtools.ui.GenericMapper |
---|
addListener, clone, createMapperDialog, createPanel, editDialog, equals, getAllMapperValues, getDefaultValue, getIntervals, getMap, getMapping, getMapping, getMapping, notifyListeners, removeListener, setDefaultValue, setMapperValues, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setMapping, setName, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.util.ResourceBundle resources
public static final int COLOR_CYCLE
public static final int SATURATION_CYCLE
public static final int BRIGHTNESS_CYCLE
protected static int defaultColorIndex
public static java.util.Vector colorMappers
Constructor Detail |
---|
public ColorMapper()
public ColorMapper(java.lang.String name)
Method Detail |
---|
public static ColorMapper updateColorMapper(ColorMapper m)
m,
- the mapper to update
public static ColorMapper getColorMapper(java.lang.String id)
name
-
public java.awt.Paint getPaint(DataSource ds, long index)
ds
- The data source to mapindex
- The index in the data source (may be used, or not, and defaults to the last Index if not specified).
public void setDefaultPaint(java.awt.Paint defaultValue)
public java.awt.Paint getDefaultPaint()
public java.awt.Paint getPaint(DataSource ds)
ds
- The data source to map
public java.awt.Paint getPaint(java.lang.Object value)
public void setPaint(java.lang.Object value, java.awt.Paint paint)
public void setPaint(double minvalue, double maxvalue, java.awt.Paint paint)
public void setPaint(double minvalue, boolean boundedMin, double maxvalue, boolean boundedMax, java.awt.Paint paint)
public void setPaint(boolean isMore, double value, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic void setPaint(boolean isMore, double value, boolean boundIncluded, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic void setPaint(long minvalue, long maxvalue, java.awt.Paint paint)
public void setPaint(long minvalue, boolean boundedMin, long maxvalue, boolean boundedMax, java.awt.Paint paint)
public void setPaint(boolean isMore, long value, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic void setPaint(boolean isMore, long value, boolean boundIncluded, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic void setPaint(java.lang.String minvalue, java.lang.String maxvalue, java.awt.Paint paint)
public void setPaint(java.lang.String minvalue, boolean boundedMin, java.lang.String maxvalue, boolean boundedMax, java.awt.Paint paint)
public void setPaint(boolean isMore, java.lang.String value, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic void setPaint(boolean isMore, java.lang.String value, boolean boundIncluded, java.awt.Paint paint)
isMore
- if true, the interval is x >= value, else it is x <= valuepublic GenericMapper.MapperTableModel createModel()
createModel
in class GenericMapper
protected GenericMapper.ExpressionMappingTable createTable(javax.swing.JDialog parent)
GenericMapper
createTable
in class GenericMapper
protected java.lang.Object createNewValue()
GenericMapper
createNewValue
in class GenericMapper
public static ColorMapper createColorMapperDialog(javax.swing.JDialog owner)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |