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
FieldsModifier and TypeFieldDescriptionprotected int[]The feature attributes for the vector components.protected booleanThe 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
ConstructorsConstructorDescriptionArrowSymbol(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 TypeMethodDescriptionvoiddrawVector(Graphics gc, int x, int y, double magnitude, double direction) Draws a direction symbol with the specified properties.doubleGets the direction angle of the vector feature.doubleGets the magnitude of the vector feature.static voidTests this class.Methods inherited from class noaa.coastwatch.render.DirectionSymbol
convertAngle, draw, getDirectionIsFrom, setDirectionIsFromMethods inherited from class noaa.coastwatch.render.PointFeatureSymbol
setFeatureMethods 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:DirectionSymbolDraws a direction symbol with the specified properties.- Specified by:
drawVectorin 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:DirectionSymbolGets the magnitude of the vector feature.- Specified by:
getMagnitudein classDirectionSymbol
-
getDirection
public double getDirection()Description copied from class:DirectionSymbolGets the direction angle of the vector feature.- Specified by:
getDirectionin 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
-