Class Route
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.AbstractTacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.lines.Route
-
- All Implemented Interfaces:
AVList
,Draggable
,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:- Air Corridor (2.X.2.2.2.1)
- Minimum Risk Route (2.X.2.2.2.2)
- Standard Flight Route (2.X.2.2.2.3)
- Unmanned Aircraft Route (2.X.2.2.2.4)
- Low Level Transit Route (2.X.2.2.2.5)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.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 java.util.List<Path>
paths
Path used to render the route.protected java.lang.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, dragEnabled, draggableSupport, frameTimestamp, highlightAttributes, highlighted, labelOffset, labels, modifiers, mustCreateLabels, normalAttributes, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, text, unitsFormat, visible
-
-
Constructor Summary
Constructors Constructor Description Route(java.lang.String sidc)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyDelegateOwner(java.lang.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 java.lang.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.java.lang.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 java.lang.String
getGraphicLabel()
Return the string that identifies this type of route.java.lang.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 java.util.List<java.lang.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(java.lang.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(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.void
setStatus(java.lang.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, doDrag, doRenderGraphicModifiers, doRenderTextModifiers, drag, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isDragEnabled, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setDelegateOwner, setDragEnabled, 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, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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
-
Methods inherited from interface gov.nasa.worldwind.render.Highlightable
isHighlighted
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
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
-
-
-
-
Field Detail
-
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
-
DEFAULT_OFFSET
protected static final Offset DEFAULT_OFFSET
-
paths
protected java.util.List<Path> paths
Path used to render the route.
-
positions
protected java.lang.Iterable<? extends Position> positions
Control points that define the shape.
-
children
protected java.lang.Iterable<? extends TacticalPoint> children
Graphics drawn at the route control points.
-
-
Method Detail
-
getSupportedGraphics
public static java.util.List<java.lang.String> getSupportedGraphics()
Indicates the graphics supported by this class.- Returns:
- List of masked SIDC strings that identify graphics that this class supports.
-
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 interfaceHighlightable
- Overrides:
setHighlighted
in classAbstractTacticalGraphic
- Parameters:
highlighted
- true to highlight the shape, otherwise false.
-
getControlPoints
public java.lang.Iterable<? extends TacticalPoint> getControlPoints()
Indicates the control points along this route.- Specified by:
getControlPoints
in interfaceTacticalRoute
- Returns:
- This route's control points.
-
setControlPoints
public void setControlPoints(java.lang.Iterable<? extends TacticalPoint> points)
Specifies the control points along this route.- Specified by:
setControlPoints
in interfaceTacticalRoute
- Parameters:
points
- New control points.
-
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.
-
setWidth
public void setWidth(double width)
Specifies the width of the route. Calling this method is equivalent to callingsetModifier(SymbologyConstants.DISTANCE, value)
.- Parameters:
width
- Width of the route, in meters.
-
setPositions
public void setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.- Specified by:
setPositions
in interfaceTacticalGraphic
- Parameters:
positions
- Control points that orient the graphic. Must provide at least three points.
-
getPositions
public java.lang.Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.- Specified by:
getPositions
in interfaceTacticalGraphic
- 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 interfaceMovable
- Returns:
- the object's reference position, or null if no reference position is available.
-
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 interfaceTacticalGraphic
- Overrides:
setAttributes
in classAbstractTacticalGraphic
- Parameters:
attributes
- new attributes. May be null, in which case default attributes are used.
-
setHighlightAttributes
public void setHighlightAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the highlighted state. See comments onsetAttributes
for more information on how the attributes are interpreted. Overridden to apply new attributes to route control points.- Specified by:
setHighlightAttributes
in interfaceTacticalGraphic
- Overrides:
setHighlightAttributes
in classAbstractTacticalGraphic
- Parameters:
attributes
- Attributes to apply to the graphic when it is highlighted. May be null, in which default attributes are used.
-
setStatus
public void setStatus(java.lang.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
- STATUS_ANTICIPATED
- STATUS_SUSPECTED
- STATUS_PRESENT
- STATUS_KNOWN
Meteorological and Oceanographic
- Not supported
Emergency Management
- STATUS_ANTICIPATED
- STATUS_PRESENT
- Specified by:
setStatus
in interfaceMilStd2525TacticalGraphic
- Overrides:
setStatus
in classAbstractMilStd2525TacticalGraphic
- Parameters:
status
- the new value for the Status/Operational Condition field.
-
preRender
public void preRender(DrawContext dc)
- Specified by:
preRender
in interfacePreRenderable
-
doRenderGraphic
protected void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.- Specified by:
doRenderGraphic
in classAbstractTacticalGraphic
- Parameters:
dc
- Current draw context.- See Also:
AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext)
,AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
-
applyDelegateOwner
protected void applyDelegateOwner(java.lang.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 classAbstractTacticalGraphic
- Parameters:
owner
- Current delegate owner.
-
createPaths
protected void createPaths(DrawContext dc)
Create the paths used to draw the route.- Parameters:
dc
- Current draw context.
-
createLabelText
protected java.lang.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.
-
createLabels
protected void createLabels()
- Overrides:
createLabels
in classAbstractTacticalGraphic
-
getGraphicLabel
protected java.lang.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".
-
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 classAbstractTacticalGraphic
- Parameters:
dc
- Current draw context.
-
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 classAbstractTacticalGraphic
- Returns:
- Offset to apply to the main label.
-
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.
-
-