Class ShapeSymbol

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
MappedShapeSymbol

public class ShapeSymbol extends MetSymbol
Shape symbol.
Version:
$Revision: 1.25 $
Author:
Metapps development team
  • Field Details

  • Constructor Details

    • ShapeSymbol

      public ShapeSymbol()
      Default constructor.
    • ShapeSymbol

      public ShapeSymbol(int x, int y)
      Construct a ShapeSymbol without a canvas at the position specified. Use the parameter names and long names specified.
      Parameters:
      x - x position
      y - y position
    • ShapeSymbol

      public ShapeSymbol(DisplayCanvas canvas, int x, int y)
      Construct a ShapeSymbol to use on the canvas specified at the position specified. Use the parameter names and long names specified.
      Parameters:
      canvas - canvas to draw on.
      x - x position on the canvas
      y - y position on the canvas
  • Method Details

    • getLabel

      public String getLabel()
      Get the label to show the user what I am in the properties
      Overrides:
      getLabel in class MetSymbol
      Returns:
      label
    • initialize

      public void initialize(Element symbolNode)
      Initialize the shape with the xml
      Overrides:
      initialize in class MetSymbol
      Parameters:
      symbolNode - The xml
    • initPropertyComponents

      protected void initPropertyComponents(List comps)
      Add any components to the list of widgets for the main property dialog tab.
      Overrides:
      initPropertyComponents in class MetSymbol
      Parameters:
      comps - List of components.
    • makeShapePropertyComponents

      protected void makeShapePropertyComponents(List comps)
      Add to the property components.
      Parameters:
      comps - List of label/component pairs.
    • applyProperties

      protected void applyProperties()
      Apply properties from the properties dialog.
      Overrides:
      applyProperties in class MetSymbol
    • getStretchy

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

      public void setStretchy(boolean s)
      Is this stretchy
      Overrides:
      setStretchy in class Glyph
      Parameters:
      s - Is this stretchy
    • getParamValue

      public Object getParamValue(int index)
      Get the parameter value at the index specified.
      Overrides:
      getParamValue in class MetSymbol
      Parameters:
      index - index into param array
      Returns:
      value of uOrSpeedParam if index = 0, otherwise vOrDirParam value
    • setParamValue

      public void setParamValue(int index, Object v)
      Set the parameter value at the index specified.
      Overrides:
      setParamValue in class MetSymbol
      Parameters:
      index - index into param array
      v - value (String) of double parameter value
    • getEqualSides

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

      public void draw(Graphics2D g, int x, int y, int width, int height)
      draw the symbol at the specified location
      Specified by:
      draw in class MetSymbol
      Parameters:
      g - Graphics2D object
      x - x position of the reference point
      y - y position of the reference point
      width - width of the symbol
      height - height of the symbol
    • setShape

      public void setShape(String value)
      Set the Shape property.
      Parameters:
      value - The new value for Shape
    • getShape

      public String getShape()
      Get the Shape property.
      Returns:
      The Shape
    • doAllObs

      public boolean doAllObs()
      Should this symbol do all of the observations. Used by the StationModelDisplayable to determine if makeShapes should be called.
      Overrides:
      doAllObs in class MetSymbol
      Returns:
      Do all obs - true.
    • makeShapes

      public VisADGeometryArray[] makeShapes(PointOb ob)
      Make the shapes.
      Overrides:
      makeShapes in class MetSymbol
      Parameters:
      ob - The observation. We don't use this.
      Returns:
      The array of shapes.
    • getShapeType

      public String getShapeType()
      Get the shape type.
      Returns:
      The shape type
    • setShapeType

      public void setShapeType(String type)
      Set the shape type
      Parameters:
      type - The shape type
    • getPoints

      public float[] getPoints()
      Get the points. From the xml.
      Returns:
      The points. May be null.
    • setPoints

      public void setPoints(float[] p)
      Set the points.
      Parameters:
      p - The points.