Package ucar.unidata.ui.symbol
Class ColorMap
java.lang.Object
ucar.unidata.ui.symbol.ColorMap
- Direct Known Subclasses:
ShapeMap
This defines a mapping from a pattern to a color.
The pattern is the value of a text point obs field.
- Version:
- $Revision: 1.6 $
- Author:
- Metapps development team
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply the propertiesstatic List
applyProperties
(List mappings) Utility to call apply properties to a list of ColorMap-s This will return the ones that actually have a pattern.getColor()
Get the Color property.Make the color widgetReal[]
tokenize the pattern string as a numeric rangeGet the Pattern property.Pattern widgetGet the color swatch componentsboolean
Do we have a non-zero length, non-null patternboolean
is the pattern string actually a numeric range of the form min,maxboolean
Does the pattern match the given valuevoid
Set the Color property.void
setPattern
(String value) Set the Pattern property.
-
Constructor Details
-
ColorMap
public ColorMap()Default ctor -
ColorMap
ctor- Parameters:
pattern
- The patternc
- The color
-
-
Method Details
-
applyProperties
Utility to call apply properties to a list of ColorMap-s This will return the ones that actually have a pattern. This way the properties dialog for the symbol can prune out the ones that the user removed.- Parameters:
mappings
- List of ColorMap-s- Returns:
- The list of ColorMaps-s that actually have a pattern.
-
applyProperties
public void applyProperties()Apply the properties -
getSwatchComps
Get the color swatch components- Returns:
- color swatch components
-
getColorWidget
Make the color widget- Returns:
- color widget
-
getPatternWidget
Pattern widget- Returns:
- Pattern widget
-
hasPattern
public boolean hasPattern()Do we have a non-zero length, non-null pattern- Returns:
- Has a pattern
-
isNumericRange
public boolean isNumericRange()is the pattern string actually a numeric range of the form min,max- Returns:
- is numeric range
-
getNumericRange
tokenize the pattern string as a numeric range- Returns:
- min max range values
- Throws:
Exception
- On badness
-
match
Does the pattern match the given value- Parameters:
value
- value to check- Returns:
- Pattern matches value
- Throws:
Exception
-
setPattern
Set the Pattern property.- Parameters:
value
- The new value for Pattern
-
getPattern
Get the Pattern property.- Returns:
- The Pattern
-
setColor
Set the Color property.- Parameters:
value
- The new value for Color
-
getColor
Get the Color property.- Returns:
- The Color
-