Class ThreeDCrossSymbol

All Implemented Interfaces:
Cloneable

public class ThreeDCrossSymbol extends MetSymbol
draws a symbol for a location point indicaiton, in 3D which is very simple (small number of graphic elements) so that large numbers of symbols can be displayed (like 5000).
Version:
$Id: $
Author:
  • Constructor Details

    • ThreeDCrossSymbol

      public ThreeDCrossSymbol()
      Default constructor
    • ThreeDCrossSymbol

      public ThreeDCrossSymbol(int x, int y)
      Create a symbol at the x and y position of the "station model editor" ; this is relative to the editor's screen center point.
      Parameters:
      x - x offset from center
      y - y offset from center
    • ThreeDCrossSymbol

      public ThreeDCrossSymbol(DisplayCanvas canvas, int x, int y)
      Create a symbol at the x and y position on the supplied canvas. Position is relative to the center point. Use default parameter and description.
      Parameters:
      canvas - DisplayCanvas to draw on
      x - x offset from center
      y - y offset from center
    • ThreeDCrossSymbol

      public ThreeDCrossSymbol(int x, int y, String param, String paramDesc)
      Create a symbol at the x and y position. Position is relative to the center point. Use parameter and description provided.
      Parameters:
      x - x offset from center
      y - y offset from center
      param - parameter name for this GPSVectorSymbol
      paramDesc - description (long name) of param
    • ThreeDCrossSymbol

      public ThreeDCrossSymbol(DisplayCanvas canvas, int x, int y, String param, String paramDesc)
      Create a symbol at the x and y position on the DisplayCanvas supplied. Position is relative to the center point. Use parameter and description provided.
      Parameters:
      canvas - DisplayCanvas to draw on
      x - x offset from center
      y - y offset from center
      param - parameter name for this GPSVectorSymbol
      paramDesc - description (long name) of param
  • Method Details

    • shouldOffsetShape

      public boolean shouldOffsetShape()
      From Unidata: "I have code that takes the shapes for a symbol and moves them by some offset wrt the origin. However, I move each individual shape in the array. Thus the recentering all problem. A workaround for now is to overwrite the method shouldOffsetShape(). This turns off any relative repositioning."
      Overrides:
      shouldOffsetShape in class MetSymbol
      Returns:
      Should the shapes be offset
    • 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.
    • 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
    • getEqualSides

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

      public Object getParamValue(int index)
      Get the parameter value at the index specified. ??? fix
      Overrides:
      getParamValue in class MetSymbol
      Parameters:
      index - index into param array
      Returns:
      always returns the magnitude as a Double
    • setParamValue

      public void setParamValue(int index, Object v)
      Set the parameter value at the index specified. Since this MetSymbol only has one parameter, it sets the value at index 0.
      Overrides:
      setParamValue in class MetSymbol
      Parameters:
      index - parameter index. Ignored in this object.
      v - value for the parameter (String representation of magnitude).
    • 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.
    • shouldBeColored

      public boolean shouldBeColored()
      Is used by the StationModelDisplayable to determine if the color of the shapes should be set. NOTE - if true, that means the IDV core code OVERRIDES colors defined here; and everything is drawn pink or black or something, all the same color.
      Overrides:
      shouldBeColored in class MetSymbol
      Returns:
      Should the shapes be colored
    • makeShapes

      public VisADGeometryArray[] makeShapes(PointOb ob)
      Make the "shapes", the plot symbol. one symbol is made of several "shapes"; for one data point observation In this case a 3D "cross" of 3 straight arms.
      Overrides:
      makeShapes in class MetSymbol
      Parameters:
      ob - The observation, or data value in a PointOb object.
      Returns:
      The array of shapes.
    • draw

      public void draw(Graphics2D g, int x, int y, int width, int height)
      draw a little cross at the specified location in the station model editor only -- NOT the IDV data display. NOTE THIS ONLY DRAWS IN THE STATION MODEL EDITOR WINDOW; IT DOES NOT MAKE THE DATA DISPLAY SYMBOLS;
      Specified by:
      draw in class MetSymbol
      Parameters:
      g - Graphics2D object
      x - x position
      y - y position
      width - width of symbol
      height - height of symbol