Class WindBarbSymbol

All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
WindVectorSymbol

public class WindBarbSymbol extends MetSymbol
Wind Barb meteorological symbol.
Version:
$Id: WindBarbSymbol.java,v 1.23 2007/05/22 20:00:23 jeffmc Exp $
Author:
Metapps development team
  • Field Details

    • DEG_TO_RAD

      public static final double DEG_TO_RAD
      Fix conversion value
      See Also:
  • Constructor Details

    • WindBarbSymbol

      public WindBarbSymbol()
      Default constructor.
    • WindBarbSymbol

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

      public WindBarbSymbol(int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr)
      Construct a WindBarbSymbol without a canvas at the position specified. Use the parameter names and long names specified.
      Parameters:
      x - x position
      y - y position
      uOrSpeedParam - u or speed component of wind parameter name
      uOrSpeedDescr - u or speed component of wind parameter description
      vOrDirParam - v or direction component of wind parameter name
      vOrDirDescr - v or direction component of wind parameter descr
    • WindBarbSymbol

      public WindBarbSymbol(DisplayCanvas canvas, int x, int y, String uOrSpeedParam, String uOrSpeedDescr, String vOrDirParam, String vOrDirDescr)
      Construct a WindBarbSymbol 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
      uOrSpeedParam - u or speed component of wind parameter name
      uOrSpeedDescr - u or speed component of wind parameter description
      vOrDirParam - v or direction component of wind parameter name
      vOrDirDescr - v or direction component of wind parameter descr
  • Method Details

    • shouldScaleShape

      public boolean shouldScaleShape()
      Should this shape be scaled. See MetSymbol.
      Overrides:
      shouldScaleShape in class MetSymbol
      Returns:
      Should this shape be scaled
    • shouldOffsetShape

      public boolean shouldOffsetShape()
      Should this shape be offset. See MetSymbol.
      Overrides:
      shouldOffsetShape in class MetSymbol
      Returns:
      Should this shape be offset
    • doAlignmentMenu

      public boolean doAlignmentMenu()
      Determine whether this MetSymbol should show an alignment menu in an editor. Subclasses should override if not.
      Overrides:
      doAlignmentMenu in class MetSymbol
      Returns:
      false for this
    • 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
    • getSpeedName

      public String getSpeedName()
      Get the name of the Speed or U component.
      Returns:
      name of this component.
    • getDirectionName

      public String getDirectionName()
      Get the name of the Direction or V component.
      Returns:
      name of this component.
    • 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
    • getWindSpeed

      public double getWindSpeed()
      get the Wind Speed, in knots
      Returns:
      windSpeed
    • setWindSpeed

      public void setWindSpeed(double windSpeed)
      set the Wind Speed, in knots
      Parameters:
      windSpeed - speed in knots
    • getWindDirection

      public double getWindDirection()
      get the Wind Direction, in degrees (0 = north) from [0, 360)
      Returns:
      The direction
    • setWindDirection

      public void setWindDirection(double windDirection)
      set the Wind Direction, in degrees (0 = north) from [0, 360)
      Parameters:
      windDirection -
    • 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 - Graphics to draw to
      x - x location
      y - y location
      width - width to draw
      height - height to draw
    • makeDrawer

      protected WindBarbSymbol.WindDrawer makeDrawer()
      Make the drawer for this symbol
      Returns:
      the drawer
    • rotateOnEarth

      public boolean rotateOnEarth()
      Can we rotate this symbol when the display rotates
      Overrides:
      rotateOnEarth in class MetSymbol
      Returns:
      false