Class ArrowSymbol

java.lang.Object
jahuwaldt.plot.PlotSymbol
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
ColorArrowSymbol

public class ArrowSymbol extends DirectionSymbol
A ArrowSymbol is a PointFeatureSymbol that renders an arrow pointing in the direction of a vector quantity.
Since:
3.2.0
Author:
Peter Hollemans
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int[]
    The feature attributes for the vector components.
    protected boolean
    The magnitude-direction flag, true if the feature attributes are [magnitude, direction], false if they are [u, v].

    Fields inherited from class noaa.coastwatch.render.PointFeatureSymbol

    feature
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArrowSymbol(int uComponentAtt, int vComponentAtt)
    Creates a new arrow symbol based on U and V components.
    ArrowSymbol(int magnitudeAtt, int directionAtt, EarthTransform2D trans)
    Creates a new arrow symbol based on magnitude and direction components.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawVector(Graphics gc, int x, int y, double magnitude, double direction)
    Draws a direction symbol with the specified properties.
    double
    Gets the direction angle of the vector feature.
    double
    Gets the magnitude of the vector feature.
    static void
    main(String[] argv)
    Tests this class.

    Methods inherited from class noaa.coastwatch.render.DirectionSymbol

    convertAngle, draw, getDirectionIsFrom, setDirectionIsFrom

    Methods inherited from class noaa.coastwatch.render.PointFeatureSymbol

    setFeature

    Methods inherited from class jahuwaldt.plot.PlotSymbol

    clone, getBorderColor, getFillColor, getSize, setBorderColor, setFillColor, setSize

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • componentAtts

      protected int[] componentAtts
      The feature attributes for the vector components.
    • isMagDir

      protected boolean isMagDir
      The magnitude-direction flag, true if the feature attributes are [magnitude, direction], false if they are [u, v].
  • Constructor Details

    • ArrowSymbol

      public ArrowSymbol(int uComponentAtt, int vComponentAtt)
      Creates a new arrow symbol based on U and V components.
      Parameters:
      uComponentAtt - the feature attribute for U component.
      vComponentAtt - the feature attribute for V component.
    • ArrowSymbol

      public ArrowSymbol(int magnitudeAtt, int directionAtt, EarthTransform2D trans)
      Creates a new arrow symbol based on magnitude and direction components.
      Parameters:
      magnitudeAtt - the feature attribute for vector magnitude.
      directionAtt - the feature attribute for vector direction.
      trans - the earth transform used for converting directions.
  • Method Details

    • drawVector

      public void drawVector(Graphics gc, int x, int y, double magnitude, double direction)
      Description copied from class: DirectionSymbol
      Draws a direction symbol with the specified properties.
      Specified by:
      drawVector in class DirectionSymbol
      Parameters:
      gc - the graphics context for drawing.
      x - the x position of the base.
      y - the y position of the base.
      magnitude - the magnitude of the vector.
      direction - the direction angle of the vector in radians, clockwise with respect to the graphics x-axis.
    • getMagnitude

      public double getMagnitude()
      Description copied from class: DirectionSymbol
      Gets the magnitude of the vector feature.
      Specified by:
      getMagnitude in class DirectionSymbol
    • getDirection

      public double getDirection()
      Description copied from class: DirectionSymbol
      Gets the direction angle of the vector feature.
      Specified by:
      getDirection in class DirectionSymbol
      Returns:
      the direction angle of the vector in radians, clockwise with respect to the graphics x-axis.
    • main

      public static void main(String[] argv) throws Exception
      Tests this class.
      Parameters:
      argv - the array of command line parameters.
      Throws:
      Exception