Package noaa.coastwatch.render
Class ArrowSymbol
java.lang.Object
jahuwaldt.plot.PlotSymbol
noaa.coastwatch.render.PointFeatureSymbol
noaa.coastwatch.render.DirectionSymbol
noaa.coastwatch.render.ArrowSymbol
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
ColorArrowSymbol
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
Modifier and TypeFieldDescriptionprotected 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
ConstructorDescriptionArrowSymbol
(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 TypeMethodDescriptionvoid
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
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
-
Field Details
-
componentAtts
protected int[] componentAttsThe feature attributes for the vector components. -
isMagDir
protected boolean isMagDirThe 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
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
Description copied from class:DirectionSymbol
Draws a direction symbol with the specified properties.- Specified by:
drawVector
in classDirectionSymbol
- 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 classDirectionSymbol
-
getDirection
public double getDirection()Description copied from class:DirectionSymbol
Gets the direction angle of the vector feature.- Specified by:
getDirection
in classDirectionSymbol
- Returns:
- the direction angle of the vector in radians, clockwise with respect to the graphics x-axis.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-