NASA World Wind

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

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

public class Route
extends AbstractMilStd2525TacticalGraphic
implements TacticalRoute, PreRenderable

Implementation of the aviation route graphics. This class implements the following graphics:


Field Summary
protected  Iterable<? extends TacticalPoint> children
          Graphics drawn at the route control points.
protected static Offset DEFAULT_OFFSET
           
static double DEFAULT_WIDTH
          Width of the route if no width is specified in the modifiers.
protected  List<Path> paths
          Path used to render the route.
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
Route(String sidc)
           
 
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  Position computeMainLabelPosition(DrawContext dc, TacticalGraphicLabel label, Position midpoint, Position posB)
          Compute the position of the graphic's main label.
protected  void createLabels()
           
protected  String createLabelText()
          Create the text for the main label on this graphic.
protected  Path createPath(Position start, Position end)
          Create between two points and configure the Path.
protected  void createPaths(DrawContext dc)
          Create the paths used to draw the route.
protected  void determineLabelPositions(DrawContext dc)
          Compute the position for the area's main label.
protected  void doRenderGraphic(DrawContext dc)
          Render this graphic, without modifiers.
 Iterable<? extends TacticalPoint> getControlPoints()
          Indicates the control points along this route.
protected  Offset getDefaultLabelOffset()
          Indicates the default offset applied to the graphic's main label.
protected  String getGraphicLabel()
          Return the string that identifies this type of route.
 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.
 double getWidth()
          Indicates the width of the route, in meters.
 void preRender(DrawContext dc)
          
 void setAttributes(TacticalGraphicAttributes attributes)
          Specifies attributes for this graphic in the normal (as opposed to highlighted) state.
 void setControlPoints(Iterable<? extends TacticalPoint> points)
          Specifies the control points along this route.
 void setHighlightAttributes(TacticalGraphicAttributes attributes)
          Specifies attributes for this graphic in the highlighted state.
 void setHighlighted(boolean highlighted)
          Specifies whether to highlight the shape.
 void setPositions(Iterable<? extends Position> positions)
          Specifies the positions of the control points that place and orient the graphic.
 void setStatus(String status)
          Specifies this graphic's Status/Operational Condition field.
 void setWidth(double width)
          Specifies the width of the route.
 
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
applyDefaultAttributes, createSymbol, getDefaultMaterial, getIdentifier, getModifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setModifier
 
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
addLabel, applyLabelAttributes, applyOverrideAttributes, computeGeometry, computeLabelInteriorOpacity, determineActiveAttributes, determineDelegateOwner, determinePerFrameAttributes, doRenderGraphicModifiers, doRenderTextModifiers, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setDelegateOwner, 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, getIdentifier, getLabelOffset, getModifier, getText, getUnitsFormat, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, setDelegateOwner, setLabelOffset, setModifier, 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
 
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

children

protected Iterable<? extends TacticalPoint> children
Graphics drawn at the route control points.


DEFAULT_OFFSET

protected static final Offset DEFAULT_OFFSET

DEFAULT_WIDTH

public static final double DEFAULT_WIDTH
Width of the route if no width is specified in the modifiers.

See Also:
Constant Field Values

paths

protected List<Path> paths
Path used to render the route.


positions

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

Constructor Detail

Route

public Route(String sidc)
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.

computeMainLabelPosition

protected Position computeMainLabelPosition(DrawContext dc,
                                            TacticalGraphicLabel label,
                                            Position midpoint,
                                            Position posB)
Compute the position of the graphic's main label. This label is positioned to the side of the first segment along the route.

Parameters:
dc - Current draw context.
label - Label for which to compute position.
midpoint - Midpoint of the first route segment.
posB - End point of the first route segment.
Returns:
The position of the main label.

createLabels

protected void createLabels()
Overrides:
createLabels in class AbstractTacticalGraphic

createLabelText

protected String createLabelText()
Create the text for the main label on this graphic.

Returns:
Text for the main label. May return null if there is no text.

createPath

protected Path createPath(Position start,
                          Position end)
Create between two points and configure the Path.

Parameters:
start - First position
end - Second position
Returns:
New path configured with defaults appropriate for this type of graphic.

createPaths

protected void createPaths(DrawContext dc)
Create the paths used to draw the route.

Parameters:
dc - Current draw context.

determineLabelPositions

protected void determineLabelPositions(DrawContext dc)
Compute the position for the area's main label. This position indicates the position of the first line of the label. If there are more lines, they will be arranged South of the first line. This method places the label between the first to control points on the route, and to the side of the route.

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)

getControlPoints

public Iterable<? extends TacticalPoint> getControlPoints()
Indicates the control points along this route.

Specified by:
getControlPoints in interface TacticalRoute
Returns:
This route's control points.

getDefaultLabelOffset

protected Offset getDefaultLabelOffset()
Description copied from class: AbstractTacticalGraphic
Indicates the default offset applied to the graphic's main label. This offset may be overridden by the graphic attributes.

Overrides:
getDefaultLabelOffset in class AbstractTacticalGraphic
Returns:
Offset to apply to the main label.

getGraphicLabel

protected String getGraphicLabel()
Return the string that identifies this type of route.

Returns:
The string the determines the type of route, such as "AC" for "Air Corridor".

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.

getWidth

public double getWidth()
Indicates the width of the route, in meters.

Returns:
If the SymbologyConstants.DISTANCE modifier set, and is a Double, returns the value of this modifier. Otherwise returns a default width.

preRender

public void preRender(DrawContext dc)

Specified by:
preRender in interface PreRenderable

setAttributes

public void setAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the normal (as opposed to highlighted) state. If any fields in the attribute bundle are null, the default attribute will be used instead. For example, if the attribute bundle includes a setting for outline material but not for interior material the new outline material will override the default outline material, but the interior material will remain the default. The default attributes are determined by the symbol set, and may differ depending on the type of graphic. Overridden to apply new attributes to route control points.

Specified by:
setAttributes in interface TacticalGraphic
Overrides:
setAttributes in class AbstractTacticalGraphic
Parameters:
attributes - new attributes. May be null, in which case default attributes are used.

setControlPoints

public void setControlPoints(Iterable<? extends TacticalPoint> points)
Specifies the control points along this route.

Specified by:
setControlPoints in interface TacticalRoute
Parameters:
points - New control points.

setHighlightAttributes

public void setHighlightAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the highlighted state. See comments on setAttributes for more information on how the attributes are interpreted. Overridden to apply new attributes to route control points.

Specified by:
setHighlightAttributes in interface TacticalGraphic
Overrides:
setHighlightAttributes in class AbstractTacticalGraphic
Parameters:
attributes - Attributes to apply to the graphic when it is highlighted. May be null, in which default attributes are used.

setHighlighted

public void setHighlighted(boolean highlighted)
Specifies whether to highlight the shape. Overridden to apply the highlight state to child graphics.

Specified by:
setHighlighted in interface Highlightable
Overrides:
setHighlighted in class AbstractTacticalGraphic
Parameters:
highlighted - true to highlight the shape, otherwise false.

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.

setStatus

public void setStatus(String status)
Specifies this graphic's Status/Operational Condition field. A graphic's Status defines whether the represented object exists at the time the symbol was generated, or is anticipated to exist in the future. Additionally, a graphic's Status can define its operational condition. The recognized values depend on the graphic's scheme:

Tactical graphics

Meteorological and Oceanographic

Emergency Management

Specified by:
setStatus in interface MilStd2525TacticalGraphic
Overrides:
setStatus in class AbstractMilStd2525TacticalGraphic
Parameters:
status - the new value for the Status/Operational Condition field.

setWidth

public void setWidth(double width)
Specifies the width of the route. Calling this method is equivalent to calling setModifier(SymbologyConstants.DISTANCE, value).

Parameters:
width - Width of the route, in meters.

NASA World Wind