Class ColorMap

java.lang.Object
ucar.unidata.ui.symbol.ColorMap
Direct Known Subclasses:
ShapeMap

public class ColorMap extends Object
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 Details

    • ColorMap

      public ColorMap()
      Default ctor
    • ColorMap

      public ColorMap(String pattern, Color c)
      ctor
      Parameters:
      pattern - The pattern
      c - The color
  • Method Details

    • applyProperties

      public static 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. 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

      public JComponent[] getSwatchComps()
      Get the color swatch components
      Returns:
      color swatch components
    • getColorWidget

      public JComponent getColorWidget()
      Make the color widget
      Returns:
      color widget
    • getPatternWidget

      public JTextField 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

      public Real[] getNumericRange() throws Exception
      tokenize the pattern string as a numeric range
      Returns:
      min max range values
      Throws:
      Exception - On badness
    • match

      public boolean match(Data value) throws Exception
      Does the pattern match the given value
      Parameters:
      value - value to check
      Returns:
      Pattern matches value
      Throws:
      Exception
    • setPattern

      public void setPattern(String value)
      Set the Pattern property.
      Parameters:
      value - The new value for Pattern
    • getPattern

      public String getPattern()
      Get the Pattern property.
      Returns:
      The Pattern
    • setColor

      public void setColor(Color value)
      Set the Color property.
      Parameters:
      value - The new value for Color
    • getColor

      public Color getColor()
      Get the Color property.
      Returns:
      The Color