NASA World Wind

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

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.PrincipleDirectionOfFire
All Implemented Interfaces:
AVList, Movable, Highlightable, PreRenderable, Renderable, MilStd2525TacticalGraphic, TacticalGraphic

public class PrincipleDirectionOfFire
extends AbstractMilStd2525TacticalGraphic
implements PreRenderable

Implementation of the Principle Direction of Fire graphic (2.X.2.4.2.2).


Field Summary
protected  Angle arrowAngle
          Length of the arrowhead from base to tip, as a fraction of the total line length.
protected  double arrowLength
          Angle of the arrowhead.
static Angle DEFAULT_ARROWHEAD_ANGLE
          Default angle of the arrowhead.
static double DEFAULT_ARROWHEAD_LENGTH
          Default length of the arrowhead, as a fraction of the total line length.
static double DEFAULT_ARROWHEAD_OUTLINE_WIDTH
          Default width of the arrowhead outline.
protected  double outlineWidth
          Width of the arrowhead outline, as a fraction of the arrowhead length.
protected  Path[] paths
          Path used to render the line.
protected  Position position1
          First control point.
protected  Position position2
          Second control point.
protected  Position position3
          Third control point.
protected  TacticalSymbol symbol
          Symbol drawn at the center of the range fan.
protected  TacticalSymbolAttributes symbolAttributes
          Attributes applied to the symbol.
protected  SurfacePolygon thickLine
          Polygon used to render the "thick" line on the left leg of the graphic.
 
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
PrincipleDirectionOfFire(String sidc)
          Create a new arrow graphic.
 
Method Summary
protected  void applyDefaultAttributes(ShapeAttributes attributes)
          Apply defaults to the active attributes bundle.
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  List<Position> computeArrowheadPositions(DrawContext dc, Position startPosition, Position endPosition)
          Determine the positions that make up the arrowhead.
protected  void createLabels()
          Create labels for the start and end of the path.
protected  Path createPath(List<Position> positions)
          Create and configure the Path used to render this graphic.
protected  SurfacePolygon createPolygon(List<? extends LatLon> positions)
           
protected  void createShapes(DrawContext dc)
          Create the list of positions that describe the arrow.
protected  void determineActiveAttributes()
          Determine active attributes for this frame.
protected  void determineLabelPositions(DrawContext dc)
          Determine positions for the start and end labels.
protected  void doRenderGraphic(DrawContext dc)
          Render this graphic, without modifiers.
protected  void doRenderGraphicModifiers(DrawContext dc)
          Render the graphic modifiers.
 Angle getArrowAngle()
          Indicates the angle of the arrowhead.
 double getArrowLength()
          Indicates the length of the arrowhead.
 Object getModifier(String modifier)
          Indicates the current value of a text or graphic modifier.
 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.
static List<String> getSupportedGraphics()
          Indicates the graphics supported by this class.
 String getSymbol()
          Indicates a symbol drawn at the center of the range fan.
 void preRender(DrawContext dc)
          
 void setArrowAngle(Angle arrowAngle)
          Specifies the angle of the arrowhead in the graphic.
 void setArrowLength(double arrowLength)
          Specifies the length of the arrowhead.
 void setModifier(String modifier, Object value)
          Specifies the value of a text or graphic modifier.
 void setPositions(Iterable<? extends Position> positions)
          Specifies the positions of the control points that place and orient the graphic.
 void setSymbol(String sidc)
          Specifies a symbol to draw at the center of the range fan.
 
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
createSymbol, getDefaultMaterial, getIdentifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setStatus
 
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
addLabel, applyLabelAttributes, applyOverrideAttributes, computeGeometry, computeLabelInteriorOpacity, determineDelegateOwner, determinePerFrameAttributes, 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

arrowAngle

protected Angle arrowAngle
Length of the arrowhead from base to tip, as a fraction of the total line length.


arrowLength

protected double arrowLength
Angle of the arrowhead.


DEFAULT_ARROWHEAD_ANGLE

public static final Angle DEFAULT_ARROWHEAD_ANGLE
Default angle of the arrowhead.


DEFAULT_ARROWHEAD_LENGTH

public static final double DEFAULT_ARROWHEAD_LENGTH
Default length of the arrowhead, as a fraction of the total line length.

See Also:
Constant Field Values

DEFAULT_ARROWHEAD_OUTLINE_WIDTH

public static final double DEFAULT_ARROWHEAD_OUTLINE_WIDTH
Default width of the arrowhead outline.

See Also:
Constant Field Values

outlineWidth

protected double outlineWidth
Width of the arrowhead outline, as a fraction of the arrowhead length.


paths

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


position1

protected Position position1
First control point.


position2

protected Position position2
Second control point.


position3

protected Position position3
Third control point.


symbol

protected TacticalSymbol symbol
Symbol drawn at the center of the range fan.


symbolAttributes

protected TacticalSymbolAttributes symbolAttributes
Attributes applied to the symbol.


thickLine

protected SurfacePolygon thickLine
Polygon used to render the "thick" line on the left leg of the graphic.

Constructor Detail

PrincipleDirectionOfFire

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

Parameters:
sidc - Symbol code the identifies the graphic.
Method Detail

applyDefaultAttributes

protected void applyDefaultAttributes(ShapeAttributes attributes)
Apply defaults to the active attributes bundle. The default attributes are determined by the type of graphic. This method is called each frame to reset the active shape attributes to the appropriate default state. Override attributes specified by the application may be applied after the defaults have been set.

Overrides:
applyDefaultAttributes in class AbstractMilStd2525TacticalGraphic
Parameters:
attributes - Attributes bundle to receive defaults.

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.

computeArrowheadPositions

protected List<Position> computeArrowheadPositions(DrawContext dc,
                                                   Position startPosition,
                                                   Position endPosition)
Determine the positions that make up the arrowhead.

Parameters:
dc - Current draw context.
startPosition - Position of the arrow's base.
endPosition - Position of the arrow head tip.
Returns:
Positions that define the arrowhead.

createLabels

protected void createLabels()
Create labels for the start and end of the path.

Overrides:
createLabels in class AbstractTacticalGraphic

createPath

protected Path createPath(List<Position> positions)
Create and configure the Path used to render this graphic.

Parameters:
positions - Positions that define the path.
Returns:
New path configured with defaults appropriate for this type of graphic.

createPolygon

protected SurfacePolygon createPolygon(List<? extends LatLon> positions)

createShapes

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

Parameters:
dc - Current draw context.

determineActiveAttributes

protected void determineActiveAttributes()
Determine active attributes for this frame. Overridden to update symbol attributes.

Overrides:
determineActiveAttributes in class AbstractTacticalGraphic

determineLabelPositions

protected void determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.

Overrides:
determineLabelPositions in class AbstractTacticalGraphic
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)

doRenderGraphicModifiers

protected void doRenderGraphicModifiers(DrawContext dc)
Render the graphic modifiers. This base class does not render anything, but subclasses may override this method to draw graphic modifiers.

Overrides:
doRenderGraphicModifiers in class AbstractTacticalGraphic
Parameters:
dc - Current draw context.

getArrowAngle

public Angle getArrowAngle()
Indicates the angle of the arrowhead.

Returns:
Angle of the arrowhead in the graphic.

getArrowLength

public double getArrowLength()
Indicates the length of the arrowhead.

Returns:
The length of the arrowhead as a fraction of the total line length.

getModifier

public Object getModifier(String modifier)
Indicates the current value of a text or graphic modifier.

Specified by:
getModifier in interface TacticalGraphic
Overrides:
getModifier in class AbstractMilStd2525TacticalGraphic
Parameters:
modifier - Key that identifies the modifier to retrieve. The possible modifiers depends on the symbol set.
Returns:
The value of the modifier, or null if the modifier is not set.

getPositions

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

Specified by:
getPositions in interface TacticalGraphic
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.

Specified by:
getReferencePosition in interface Movable
Returns:
the object's reference position, or null if no reference position is available.

getSupportedGraphics

public static List<String> getSupportedGraphics()
Indicates the graphics supported by this class.

Returns:
List of masked SIDC strings that identify graphics that this class supports.

getSymbol

public String getSymbol()
Indicates a symbol drawn at the center of the range fan.

Returns:
The symbol drawn at the center of the range fan. May be null.

preRender

public void preRender(DrawContext dc)

Specified by:
preRender in interface PreRenderable

setArrowAngle

public void setArrowAngle(Angle arrowAngle)
Specifies the angle of the arrowhead in the graphic.

Parameters:
arrowAngle - The angle of the arrowhead. Must be greater than zero degrees and less than 90 degrees.

setArrowLength

public void setArrowLength(double arrowLength)
Specifies the length of the arrowhead.

Parameters:
arrowLength - Length of the arrowhead as a fraction of the total line length. If the arrowhead length is 0.25, then the arrowhead length will be one quarter of the total line length.

setModifier

public void setModifier(String modifier,
                        Object value)
Specifies the value of a text or graphic modifier.

Specified by:
setModifier in interface TacticalGraphic
Overrides:
setModifier in class AbstractMilStd2525TacticalGraphic
Parameters:
modifier - Key that identifies the modifier to set. The possible modifiers depends on the symbol set.
value - New value for the modifier.

setPositions

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

Specified by:
setPositions in interface TacticalGraphic
Parameters:
positions - Control points that orient the graphic. Must provide at least three points.

setSymbol

public void setSymbol(String sidc)
Specifies a symbol to draw at the center of the range fan. Equivalent to setting the SymbologyConstants.SYMBOL_INDICATOR modifier. The symbol's position will be changed to match the range fan center position.

Parameters:
sidc - Identifier for a MIL-STD-2525C symbol to draw at the center of the range fan. May be null to indicate that no symbol is drawn.

NASA World Wind