Class WeatherSymbol

All Implemented Interfaces:
ImageObserver, Cloneable

public class WeatherSymbol extends MetSymbol implements ImageObserver
Glyphs representing Meteorological symbols.
Version:
$Revision: 1.20 $
Author:
Metapps development team
  • Field Details

    • SYMBOL_CLOUDCOVERAGE

      public static final int SYMBOL_CLOUDCOVERAGE
      Cloud coverage symbol index
      See Also:
    • SYMBOL_PRESENTWEATHER

      public static final int SYMBOL_PRESENTWEATHER
      Present weather symbol index
      See Also:
    • SYMBOL_LOWCLOUD

      public static final int SYMBOL_LOWCLOUD
      Low cloud symbol index
      See Also:
    • SYMBOL_MIDCLOUD

      public static final int SYMBOL_MIDCLOUD
      Mid cloud symbol index
      See Also:
    • SYMBOL_HIGHCLOUD

      public static final int SYMBOL_HIGHCLOUD
      High cloud symbol index
      See Also:
    • SYMBOL_PRESSURETENDENCY

      public static final int SYMBOL_PRESSURETENDENCY
      Pressure tendency symbol index
      See Also:
    • SYMBOL_ICING

      public static final int SYMBOL_ICING
      Icing symbol index
      See Also:
    • SYMBOL_TURBULENCE

      public static final int SYMBOL_TURBULENCE
      Turbulence symbol index
      See Also:
    • SYMBOL_LIGHTNING

      public static final int SYMBOL_LIGHTNING
      Lightning symbol index
      See Also:
    • SYMBOL_MISC

      public static final int SYMBOL_MISC
      Miscellaneous symbol index
      See Also:
    • SYMBOL_ALL

      public static final int SYMBOL_ALL
      All symbols index
      See Also:
    • SYMBOLNAMES

      public static final String[] SYMBOLNAMES
      Symbol names
    • ATTR_SYMBOLTYPE

      public static final String ATTR_SYMBOLTYPE
      Symbol type attribute
      See Also:
  • Constructor Details

    • WeatherSymbol

      public WeatherSymbol()
      Default constructor.
    • WeatherSymbol

      public WeatherSymbol(int x, int y)
      Create a WeatherSymbol at the position indicated.
      Parameters:
      x - x coordinate
      y - y coordinate
    • WeatherSymbol

      public WeatherSymbol(DisplayCanvas canvas, int x, int y)
      Create a WeatherSymbol on the canvas specified at the position indicated.
      Parameters:
      canvas - canvas for displaying this symbol
      x - x coordinate
      y - y coordinate
    • WeatherSymbol

      public WeatherSymbol(int x, int y, String param, String paramDesc)
      Create a WeatherSymbol at the position indicated and use the name and description supplied.
      Parameters:
      x - x coordinate
      y - y coordinate
      param - parameter name
      paramDesc - parameter description (used in labels, widgets)
    • WeatherSymbol

      public WeatherSymbol(DisplayCanvas canvas, int x, int y, String param, String paramDesc)
      Create a WeatherSymbol on canvas at the position indicated and use the name and description supplied.
      Parameters:
      canvas - canvas for displaying this symbol
      x - x coordinate
      y - y coordinate
      param - parameter name
      paramDesc - parameter description (used in labels, widgets)
  • Method Details

    • getLabel

      public String getLabel()
      Get the label to show the user
      Overrides:
      getLabel in class MetSymbol
      Returns:
      The label
    • imageUpdate

      public boolean imageUpdate(Image img, int flags, int x, int y, int width, int height)
      This method is called when information about an image which was previously requested using an asynchronous interface becomes available, public due do implementing ImageObserver.
      Specified by:
      imageUpdate in interface ImageObserver
      Parameters:
      img - image being observed
      flags - information flags
      x - x coordinate
      y - y coordinate
      width - the width
      height - the height
      Returns:
      false if the infoflags indicate that the image is completely loaded; true otherwise.
    • setSymbolType

      public void setSymbolType(int value)
      Set the type of symbol that this is.
      Parameters:
      value - symbol type (e.g., SYMBOL_LOWCLOUD)
    • getLines

      public VisADLineArray getLines(int index)
      Gets the VisADLineArray that corresponds to the index for the symbol type.
      Parameters:
      index - index for this symbolType.
      Returns:
      VisADLineArray corresponding to this symbol
      See Also:
    • getLines

      public static VisADLineArray getLines(int symbolType, int code)
      Gets the VisADLineArray that corresponds to the code for the symbol type.
      Parameters:
      symbolType - type of symbol
      code - code for the particular item in this symbol type
      Returns:
      VisADLineArray corresponding to this symbol
      See Also:
    • getParamValue

      public Object getParamValue(int index)
      Get the value for the parameter at the particular index. Since this objection only has one value, it is returned.
      Overrides:
      getParamValue in class MetSymbol
      Parameters:
      index - parameter index (ignored)
      Returns:
      symbol code for this symbolType as an Integer
    • setParamValue

      public void setParamValue(int index, Object v)
      Set the value for the parameter at the particular index. Since this objection only has one value, it is set with the input.
      Overrides:
      setParamValue in class MetSymbol
      Parameters:
      index - parameter index (ignored)
      v - value (String version of integer code)
    • getSymbolType

      public int getSymbolType()
      Get the symbol type for this WeatherSymbol. Used primarily for persistence.
      Returns:
      symbol type (e.g., SYMBOL_LOWCLOUD)
    • setCode

      public void setCode(int value)
      Set the code (index) for this symbol type. Used primarily for XML persistence.
      Parameters:
      value - code for the index for this symbol type.
      See Also:
    • getCode

      public int getCode()
      Get the code (index) for this symbol type. Used primarily for XML persistence.
      Returns:
      code for the index for this symbol type.
      See Also:
    • getStretchy

      public boolean getStretchy()
      Get whether this MetSymbol can be stretched or not.
      Overrides:
      getStretchy in class Glyph
      Returns:
      true if can be stretched.
    • getEqualSides

      public boolean getEqualSides()
      Get whether this MetSymbol has equals sides (width and height).
      Overrides:
      getEqualSides in class RectangleGlyph
      Returns:
      true
    • getSymetricReshape

      public boolean getSymetricReshape()
      Get whether this MetSymbol should be stretched symetrically or not.
      Overrides:
      getSymetricReshape in class RectangleGlyph
      Returns:
      true
    • draw

      public void draw(Graphics2D g, int x, int y, int width, int height)
      Draw this object to the graphics device.
      Specified by:
      draw in class MetSymbol
      Parameters:
      g - Graphics object
      x - x position of the object
      y - y position of the object
      width - width to draw
      height - height to draw
    • setAttr

      public void setAttr(String name, String value)
      Set the attribute with the value supplied.
      Overrides:
      setAttr in class MetSymbol
      Parameters:
      name - name of attribute.
      value - value of attribute.