public class ArrowSymbol extends DirectionSymbol
ArrowSymbol
is a PointFeatureSymbol
that renders an arrow pointing in the direction of a vector quantity.Modifier and Type | Field and Description |
---|---|
protected int[] |
componentAtts
The feature attributes for the vector components.
|
protected boolean |
isMagDir
The magnitude-direction flag, true if the feature attributes are
[magnitude, direction], false if they are [u, v].
|
feature
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
drawVector(java.awt.Graphics gc,
int x,
int y,
double magnitude,
double direction)
Draws a direction symbol with the specified properties.
|
double |
getDirection()
Gets the direction angle of the vector feature.
|
double |
getMagnitude()
Gets the magnitude of the vector feature.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
convertAngle, draw, getDirectionIsFrom, setDirectionIsFrom
setFeature
protected int[] componentAtts
protected boolean isMagDir
public ArrowSymbol(int uComponentAtt, int vComponentAtt)
uComponentAtt
- the feature attribute for U component.vComponentAtt
- the feature attribute for V component.public ArrowSymbol(int magnitudeAtt, int directionAtt, EarthTransform2D trans)
magnitudeAtt
- the feature attribute for vector magnitude.directionAtt
- the feature attribute for vector direction.trans
- the earth transform used for converting directions.public void drawVector(java.awt.Graphics gc, int x, int y, double magnitude, double direction)
DirectionSymbol
drawVector
in class DirectionSymbol
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.public double getMagnitude()
DirectionSymbol
getMagnitude
in class DirectionSymbol
public double getDirection()
DirectionSymbol
getDirection
in class DirectionSymbol
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception