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>childrenGraphics drawn at the route control points.protected static OffsetDEFAULT_OFFSETstatic doubleDEFAULT_WIDTHWidth of the route if no width is specified in the modifiers.protected java.util.List<Path>pathsPath used to render the route.protected java.lang.Iterable<? extends Position>positionsControl 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 voidapplyDelegateOwner(java.lang.Object owner)Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic.protected PositioncomputeMainLabelPosition(DrawContext dc, TacticalGraphicLabel label, Position midpoint, Position posB)Compute the position of the graphic's main label.protected voidcreateLabels()protected java.lang.StringcreateLabelText()Create the text for the main label on this graphic.protected PathcreatePath(Position start, Position end)Create between two points and configure the Path.protected voidcreatePaths(DrawContext dc)Create the paths used to draw the route.protected voiddetermineLabelPositions(DrawContext dc)Compute the position for the area's main label.protected voiddoRenderGraphic(DrawContext dc)Render this graphic, without modifiers.java.lang.Iterable<? extends TacticalPoint>getControlPoints()Indicates the control points along this route.protected OffsetgetDefaultLabelOffset()Indicates the default offset applied to the graphic's main label.protected java.lang.StringgetGraphicLabel()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.PositiongetReferencePosition()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.doublegetWidth()Indicates the width of the route, in meters.voidpreRender(DrawContext dc)voidsetAttributes(TacticalGraphicAttributes attributes)Specifies attributes for this graphic in the normal (as opposed to highlighted) state.voidsetControlPoints(java.lang.Iterable<? extends TacticalPoint> points)Specifies the control points along this route.voidsetHighlightAttributes(TacticalGraphicAttributes attributes)Specifies attributes for this graphic in the highlighted state.voidsetHighlighted(boolean highlighted)Specifies whether to highlight the shape.voidsetPositions(java.lang.Iterable<? extends Position> positions)Specifies the positions of the control points that place and orient the graphic.voidsetStatus(java.lang.String status)Specifies this graphic's Status/Operational Condition field.voidsetWidth(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:
setHighlightedin interfaceHighlightable- Overrides:
setHighlightedin 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:
getControlPointsin 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:
setControlPointsin 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:
setPositionsin 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:
getPositionsin 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:
getReferencePositionin 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:
setAttributesin interfaceTacticalGraphic- Overrides:
setAttributesin 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 onsetAttributesfor more information on how the attributes are interpreted. Overridden to apply new attributes to route control points.- Specified by:
setHighlightAttributesin interfaceTacticalGraphic- Overrides:
setHighlightAttributesin 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:
setStatusin interfaceMilStd2525TacticalGraphic- Overrides:
setStatusin classAbstractMilStd2525TacticalGraphic- Parameters:
status- the new value for the Status/Operational Condition field.
-
preRender
public void preRender(DrawContext dc)
- Specified by:
preRenderin interfacePreRenderable
-
doRenderGraphic
protected void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.- Specified by:
doRenderGraphicin 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:
applyDelegateOwnerin 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:
createLabelsin 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:
determineLabelPositionsin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.
-
getDefaultLabelOffset
protected Offset getDefaultLabelOffset()
Description copied from class:AbstractTacticalGraphicIndicates the default offset applied to the graphic's main label. This offset may be overridden by the graphic attributes.- Overrides:
getDefaultLabelOffsetin 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.
-
-