public abstract class DirectionSymbol extends PointFeatureSymbol
DirectionSymbol
is a PointFeatureSymbol
that renders a directional vector.feature
Constructor and Description |
---|
DirectionSymbol(EarthTransform2D trans)
Creates a new direction symbol.
|
Modifier and Type | Method and Description |
---|---|
double |
convertAngle(double inAngle,
EarthLocation earthLoc)
Converts a direction angle that is clockwise relative to north to
a direction angle that is counterclockwise relative to the x axis
of the earth transform.
|
void |
draw(java.awt.Graphics gc,
int x,
int y) |
abstract void |
drawVector(java.awt.Graphics gc,
int x,
int y,
double magnitude,
double direction)
Draws a direction symbol with the specified properties.
|
abstract double |
getDirection()
Gets the direction angle of the vector feature.
|
boolean |
getDirectionIsFrom()
Gets the direction-is-from flag.
|
abstract double |
getMagnitude()
Gets the magnitude of the vector feature.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
void |
setDirectionIsFrom(boolean flag)
Sets the direction-is-from flag.
|
setFeature
public DirectionSymbol(EarthTransform2D trans)
trans
- the earth transform used for converting directions.public void setDirectionIsFrom(boolean flag)
flag
- the new direction-is-from flag value.public boolean getDirectionIsFrom()
setDirectionIsFrom(boolean)
public abstract void drawVector(java.awt.Graphics gc, int x, int y, double magnitude, double direction)
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 abstract double getMagnitude()
public abstract double getDirection()
public double convertAngle(double inAngle, EarthLocation earthLoc)
inAngle
- the input direction angle in radians.earthLoc
- the earth location at which the direction applies.Double.NaN
if the
angle could not be converted.public void draw(java.awt.Graphics gc, int x, int y)
draw
in class jahuwaldt.plot.PlotSymbol
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception