NASA World Wind

gov.nasa.worldwind.symbology.milstd2525.graphics.lines
Class AbstractAxisArrow

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.symbology.AbstractTacticalGraphic
          extended by gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
              extended by gov.nasa.worldwind.symbology.milstd2525.graphics.lines.AbstractAxisArrow
All Implemented Interfaces:
AVList, Movable, Highlightable, Renderable, MilStd2525TacticalGraphic, TacticalGraphic
Direct Known Subclasses:
AdvanceForFeint, Aviation, MainAttack, SupportingAttack

public abstract class AbstractAxisArrow
extends AbstractMilStd2525TacticalGraphic

Base class for axis of advance arrow graphics. These arrows are specified by control points along the center line of the arrow. The final control point determines either the width of the arrowhead (default) or the width of the route. MIL-STD-2525C (pg. 517) specifies that the final control point determines the width of the arrowhead, but some applications may prefer to use this control point to set the width of the route precisely. The finalPointWidthOfRoute field controls this behavior.


Field Summary
protected  List<? extends Position> arrowPositions
          Positions computed from the control points, used to draw the arrow path.
protected  boolean finalPointWidthOfRoute
          Indicates whether the final control point marks the width of the route or the width of the arrowhead.
protected  Path[] paths
          Path used to render the line.
protected  Iterable<? extends Position> positions
          Control points that define the shape.
 
Fields inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
maskedSymbolCode, OUTLINE_STIPPLE_FACTOR_ANTICIPATED, OUTLINE_STIPPLE_FACTOR_PRESENT, OUTLINE_STIPPLE_PATTERN, symbolCode
 
Fields inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
activeOverrides, activeShapeAttributes, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_LABEL_INTERIOR_OPACITY, delegateOwner, frameTimestamp, highlightAttributes, highlighted, labelOffset, labels, modifiers, mustCreateLabels, normalAttributes, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, text, unitsFormat, visible
 
Constructor Summary
AbstractAxisArrow(String sidc)
          Create a new arrow graphic.
AbstractAxisArrow(String sidc, int numPaths)
          Create a new arrow graphic made up of more than one path.
 
Method Summary
protected  void applyDelegateOwner(Object owner)
          Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic.
protected  double createArrowHeadPositions(List<Position> leftPositions, List<Position> rightPositions, List<Position> arrowHeadPositions, Globe globe)
          Create positions that make up the arrow head.
protected  void createLinePositions(List<Position> leftPositions, List<Position> rightPositions, double halfWidth, Globe globe)
          Create positions that make up the left and right arrow lines.
protected  Path createPath()
          Create and configure the Path used to render this graphic.
protected  void createShapePositions(DrawContext dc)
          Create the list of positions that describe the arrow.
protected  void doRenderGraphic(DrawContext dc)
          Render this graphic, without modifiers.
 Iterable<? extends Position> getPositions()
          Indicates the positions of the control points that place and orient the graphic.
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
 boolean isFinalPointWidthOfRoute()
          Indicates whether or not the final control point marks the width of the arrowhead or the width of the route.
 void setFinalPointWidthOfRoute(boolean finalPointIsWidthOfRoute)
          Specifies whether or not the final control point marks the edge of the arrow head or the width of the route.
 void setPositions(Iterable<? extends Position> positions)
          Specifies the positions of the control points that place and orient the graphic.
 
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
applyDefaultAttributes, createSymbol, getDefaultMaterial, getIdentifier, getModifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setModifier, setStatus
 
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
addLabel, applyLabelAttributes, applyOverrideAttributes, computeGeometry, computeLabelInteriorOpacity, createLabels, determineActiveAttributes, determineDelegateOwner, determineLabelPositions, determinePerFrameAttributes, doRenderGraphicModifiers, doRenderTextModifiers, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDefaultLabelOffset, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setAttributes, setDelegateOwner, setHighlightAttributes, setHighlighted, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nasa.worldwind.symbology.TacticalGraphic
getAttributes, getDelegateOwner, getHighlightAttributes, getLabelOffset, getUnitsFormat, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, setAttributes, setDelegateOwner, setHighlightAttributes, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
 
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
 
Methods inherited from interface gov.nasa.worldwind.render.Highlightable
isHighlighted, setHighlighted
 
Methods inherited from interface gov.nasa.worldwind.Movable
move, moveTo
 
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 

Field Detail

arrowPositions

protected List<? extends Position> arrowPositions
Positions computed from the control points, used to draw the arrow path.


finalPointWidthOfRoute

protected boolean finalPointWidthOfRoute
Indicates whether the final control point marks the width of the route or the width of the arrowhead. Default is the width of the arrowhead.


paths

protected Path[] paths
Path used to render the line.


positions

protected Iterable<? extends Position> positions
Control points that define the shape.

Constructor Detail

AbstractAxisArrow

public AbstractAxisArrow(String sidc)
Create a new arrow graphic.

Parameters:
sidc - Symbol code the identifies the graphic.

AbstractAxisArrow

public AbstractAxisArrow(String sidc,
                         int numPaths)
Create a new arrow graphic made up of more than one path. This constructor allocates the paths, and creates the requested number of paths. The first element in the array is the main path that outlines the arrow. Subclasses are responsible for configuring the other paths.

Parameters:
sidc - Symbol code the identifies the graphic.
numPaths - Number of paths to create.
Method Detail

applyDelegateOwner

protected void applyDelegateOwner(Object owner)
Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic. This base class will apply the delegate owner to Label objects. Subclasses must implement this method to apply the delegate owner to any Renderables that they will draw in order to render the graphic.

Specified by:
applyDelegateOwner in class AbstractTacticalGraphic
Parameters:
owner - Current delegate owner.

createArrowHeadPositions

protected double createArrowHeadPositions(List<Position> leftPositions,
                                          List<Position> rightPositions,
                                          List<Position> arrowHeadPositions,
                                          Globe globe)
Create positions that make up the arrow head.

The arrow head is defined by the first two control points, and the last point. Pt. 1' is the point on the center line at the base of the arrow head, and Pt. N' is the reflection of Pt. N about the center line.

                 Pt N
                 |\
 Left line       | \
 ----------------|  \
 Pt 2        Pt 1'   \ Pt 1
                     /
 ----------------|  /
 Right line      | /
                 |/Pt N'
 

Parameters:
leftPositions - List to collect positions on the left arrow line. This list receives the position where the left line meets the arrow head.
rightPositions - List to collect positions on the right arrow line. This list receives the position where the right line meets the arrow head.
arrowHeadPositions - List to collect positions that make up the arrow head. This list receives positions for Pt. N, Pt. 1, and Pt. N', in that order.
globe - Current globe.
Returns:
The distance from the center line to the left and right lines.

createLinePositions

protected void createLinePositions(List<Position> leftPositions,
                                   List<Position> rightPositions,
                                   double halfWidth,
                                   Globe globe)
Create positions that make up the left and right arrow lines.

Parameters:
leftPositions - List to collect positions on the left line.
rightPositions - List to collect positions on the right line.
halfWidth - Distance from the center line to the left or right lines. Half the width of the arrow's double lines.
globe - Current globe.

createPath

protected Path createPath()
Create and configure the Path used to render this graphic.

Returns:
New path configured with defaults appropriate for this type of graphic.

createShapePositions

protected void createShapePositions(DrawContext dc)
Create the list of positions that describe the arrow.

Parameters:
dc - Current draw context.

doRenderGraphic

protected void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.

Specified by:
doRenderGraphic in class AbstractTacticalGraphic
Parameters:
dc - Current draw context.
See Also:
AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext), AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)

getPositions

public Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.

Returns:
positions that orient the graphic. How many positions are returned depends on the type of graphic. Some graphics require only a single position, others require many.

getReferencePosition

public Position getReferencePosition()
A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.

Returns:
the object's reference position, or null if no reference position is available.

isFinalPointWidthOfRoute

public boolean isFinalPointWidthOfRoute()
Indicates whether or not the final control point marks the width of the arrowhead or the width of the route. MIL-STD-2525C specifies that the final control point marks the edge of the arrow (pg. 517), and this is the default. However, some applications may prefer to specify the width of the route rather than the width of the arrowhead. In the diagram below, the default behavior is for the final control point to specify point A. When finalPointWidthOfRoute is true the final control point specifies point B instead.

                 A
                 |\
                 | \
 ----------------|  \
                 B   \
                     /
 ----------------|  /
                 | /
                 |/
 

Returns:
True if the final control point determines the width of the route instead of the width of the arrow head (point B in the diagram above).

setFinalPointWidthOfRoute

public void setFinalPointWidthOfRoute(boolean finalPointIsWidthOfRoute)
Specifies whether or not the final control point marks the edge of the arrow head or the width of the route. See isFinalPointWidthOfRoute() for details.

Parameters:
finalPointIsWidthOfRoute - True if the final control point determines the width of the route instead of the width of the arrow head.

setPositions

public void setPositions(Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.

Parameters:
positions - Control points that orient the graphic. Must provide at least three points.

NASA World Wind