NASA World Wind

gov.nasa.worldwind.symbology
Class AbstractTacticalSymbol

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.symbology.AbstractTacticalSymbol
All Implemented Interfaces:
AVList, MessageListener, Movable, Highlightable, OrderedRenderable, Renderable, TacticalSymbol, WWObject, PropertyChangeListener, EventListener
Direct Known Subclasses:
EchelonSymbol, ForwardEdgeOfBattleArea.FEBASymbol, LimitedAccessSymbol, MilStd2525TacticalSymbol, TacticalGraphicSymbol

public abstract class AbstractTacticalSymbol
extends WWObjectImpl
implements TacticalSymbol, OrderedRenderable, Movable


Nested Class Summary
protected static class AbstractTacticalSymbol.IconAtlasElement
           
protected static class AbstractTacticalSymbol.IconSource
           
protected static class AbstractTacticalSymbol.IconTexture
           
protected static class AbstractTacticalSymbol.Label
           
protected static class AbstractTacticalSymbol.Line
           
 
Field Summary
protected  TacticalSymbolAttributes activeAttrs
          Indicates this symbol's currently active attributes.
protected  WWTexture activeIconTexture
           
protected  AVList activeModifiers
          Modifiers active this frame.
protected  int altitudeMode
          Indicates this symbol's altitude mode.
protected  OGLStackHandler BEogsh
          Support for setting up and restoring OpenGL state during rendering.
protected  List<AbstractTacticalSymbol.IconAtlasElement> currentGlyphs
           
protected  List<AbstractTacticalSymbol.Label> currentLabels
           
protected  List<AbstractTacticalSymbol.Line> currentLines
           
protected static double DEFAULT_DEPTH_OFFSET
          The default depth offset in device independent depth units: -8200.
protected static TextureAtlas DEFAULT_GLYPH_ATLAS
          The default glyph texture atlas.
protected static int DEFAULT_LABEL_LINES
          The default number of label lines to expect when computing the minimum size of the text layout rectangle.
protected static long DEFAULT_MAX_TIME_SINCE_LAST_USED
           
static UnitsFormat DEFAULT_UNITS_FORMAT
          Default unit format.
protected static TacticalSymbolAttributes defaultAttrs
          The attributes used if attributes are not specified.
protected  Object delegateOwner
          Indicates an object to attach to the picked object list instead of this symbol.
protected  Double depthOffset
           
protected  double dx
          Per-frame screen offset indicating this symbol's x-offset relative to the screenPoint.
protected  double dy
          Per-frame screen offset indicating this symbol's y-offset relative to the screenPoint.
protected  boolean enableBatchPicking
           
protected  boolean enableBatchRendering
           
protected  double eyeDistance
          Per-frame distance corresponding to the distance between the placePoint and the View's eye point.
protected  String formattedPosition
          Current symbol position, formatted using the current unit format.
protected  long frameNumber
          The frame used to calculate this symbol's per-frame values.
protected  TextureAtlas glyphAtlas
           
protected  Map<String,AbstractTacticalSymbol.IconAtlasElement> glyphMap
           
protected  TacticalSymbolAttributes highlightAttrs
          Indicates this symbol's highlight attributes.
protected  boolean highlighted
          Indicates whether this symbol is highlighted.
protected  Offset iconOffset
           
protected  Rectangle iconRect
           
protected  Rectangle iconRectScaled
          iconRect with scaling applied, used to lay out text.
protected  IconRetriever iconRetriever
           
protected  Size iconSize
           
protected  WWTexture iconTexture
           
protected static String LAYOUT_ABSOLUTE
           
protected static String LAYOUT_NONE
           
protected static String LAYOUT_RELATIVE
           
protected  Rectangle layoutRect
           
protected  Rectangle layoutRectScaled
          layoutRect with scaling applied, used to lay out text.
static String LOADING_IMAGE_PATH
          The image file displayed while the icon is loading.
protected static int MAX_SYMBOL_DIMENSION
          Maximum expected size of a symbol, used to estimate screen bounds for view frustum culling.
protected  long maxTimeSinceLastUsed
           
protected  IconRetriever modifierRetriever
           
protected  AVList modifiers
          Indicates the current text and graphic modifiers assigned to this symbol.
protected  TacticalSymbolAttributes normalAttrs
          Indicates this symbol's normal (as opposed to highlight) attributes.
protected  Offset offset
           
protected  Layer pickLayer
          Per-frame layer indicating this symbol's layer when its ordered renderable was created.
protected  PickSupport pickSupport
          Support for setting up and restoring picking state, and resolving the picked object.
protected  Vec4 placePoint
          Per-frame Cartesian point corresponding to this symbol's position.
protected  Position position
          Indicates this symbol's geographic position.
protected  Vec4 screenPoint
          Per-frame screen point corresponding to the projection of the placePoint in the viewport (on the screen).
protected  Rectangle screenRect
           
protected  boolean showGraphicModifiers
          Indicates whether this symbol draws its supplemental graphic modifiers.
protected  boolean showHostileIndicator
          Indicates whether or not to display the implicit hostile indicator modifier.
protected  boolean showLocation
          Indicates whether or not to display the implicit location modifier.
protected  boolean showTextModifiers
          Indicates whether this symbol draws its supplemental text modifiers.
protected  Rectangle staticLayoutRect
          Layout rect computed from the icon and static modifiers.
protected  Rectangle staticScreenRect
          Screen rect computed from the icon and static modifiers.
protected  double sx
          Per-frame screen scale indicating this symbol's x-scale relative to the screen offset.
protected  double sy
          Per-frame screen scale indicating this symbol's y-scale relative to the screen offset.
protected  UnitsFormat unitsFormat
          Unit format used to format location and altitude for text modifiers.
protected  boolean unresolvedGlyph
          Indicates that one or more glyphs have not been resolved.
protected  boolean visible
          Indicates whether this symbol is drawn when in view.
 
Constructor Summary
protected AbstractTacticalSymbol()
          Constructs a new symbol with no position.
protected AbstractTacticalSymbol(Position position)
          Constructs a new symbol with the specified position.
 
Method Summary
protected  void addGlyph(DrawContext dc, Offset offset, Offset hotspot, String modifierCode)
           
protected  void addGlyph(DrawContext dc, Offset offset, Offset hotspot, String modifierCode, AVList retrieverParams, Object layoutMode)
           
protected  void addLabel(DrawContext dc, Offset offset, Offset hotspot, String modifierText)
           
protected  void addLabel(DrawContext dc, Offset offset, Offset hotspot, String modifierText, Font font, Color color, Object layoutMode)
           
protected  void addLine(DrawContext dc, Offset offset, List<? extends Point2D> points)
           
protected  void addLine(DrawContext dc, Offset offset, List<? extends Point2D> points, Object layoutMode, int numPointsInLayout)
           
protected  void applyImplicitModifiers(AVList modifiers)
          Add implicit modifiers to the modifier list.
protected  AVList assembleIconRetrieverParameters(AVList params)
           
protected  void beginDrawing(DrawContext dc, int attrMask)
           
protected  Dimension computeMinTextLayout(DrawContext dc, AVList modifiers)
          Compute the dimension of the minimum layout rectangle for the text modifiers.
protected  void computeScale()
           
protected  void computeScaledBounds(DrawContext dc, AVList modifiers)
          Compute the bounds of symbol after the scale has been applied.
protected  Rectangle computeScaledRect(Rectangle rect, Dimension maxDimension, double scaleX, double scaleY)
           
protected  Rectangle computeScreenExtent()
           
protected  void computeSymbolPoints(DrawContext dc)
           
protected  void computeTransform(DrawContext dc)
           
protected  PickedObject createPickedObject(int colorCode)
           
protected  void determineActiveAttributes()
           
protected  void doDrawOrderedRenderable(DrawContext dc, PickSupport pickCandidates)
           
protected  void draw(DrawContext dc)
           
protected  void drawBatched(DrawContext dc)
           
protected  void drawGlyphs(DrawContext dc)
           
protected  void drawGraphicModifiers(DrawContext dc)
           
protected  void drawIcon(DrawContext dc)
           
protected  void drawLabels(DrawContext dc)
           
protected  void drawLines(DrawContext dc)
           
protected  void drawOrderedRenderable(DrawContext dc)
           
protected  void drawTextModifiers(DrawContext dc)
           
protected  void endDrawing(DrawContext dc)
           
protected  TacticalSymbolAttributes getActiveAttributes()
           
 int getAltitudeMode()
          Indicates this symbol's altitude mode.
 TacticalSymbolAttributes getAttributes()
          Returns this symbol's normal (as opposed to highlight) attributes.
 Object getDelegateOwner()
          Indicates the delegate owner of this symbol.
protected  Double getDepthOffset()
           
 double getDistanceFromEye()
          Returns the ordered renderable's distance from the current view's eye point.
protected  String getFormattedPosition()
          Indicates the symbol's current position, formatted according to the current UnitsFormat.
protected  AbstractTacticalSymbol.IconAtlasElement getGlyph(String modifierCode, AVList retrieverParams)
           
protected  TextureAtlas getGlyphAtlas()
           
 TacticalSymbolAttributes getHighlightAttributes()
          Returns this symbol's highlight attributes.
protected  IconRetriever getIconRetriever()
           
protected  int getMaxLabelLines(AVList modifiers)
           
protected  int getMaxSymbolDimension()
          Indicates the maximum expected size of a rendered tactical symbol.
 Object getModifier(String modifier)
          Indicates the current value of a text or graphic modifier.
protected  IconRetriever getModifierRetriever()
           
 Offset getOffset()
          Indicates a location within the symbol to align with the symbol point.
 Position getPosition()
          Indicates this symbol's geographic position.
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
 UnitsFormat getUnitsFormat()
          Indicates the unit format used to format values in text modifiers.
protected  boolean intersectsFrustum(DrawContext dc)
           
 boolean isEnableBatchPicking()
           
 boolean isEnableBatchRendering()
           
 boolean isHighlighted()
          Indicates whether to highlight the shape.
 boolean isShowGraphicModifiers()
          Indicates whether this symbol draws its supplemental graphic modifiers.
 boolean isShowHostileIndicator()
          Indicates whether or not to display an indicator when the symbol represents a hostile entity.
 boolean isShowLocation()
          Indicates whether or not to display this symbol's location as a text modifier.
 boolean isShowTextModifiers()
          Indicates whether this symbol draws its supplemental text modifiers.
 boolean isVisible()
          Indicates whether this symbol is drawn when in view.
protected  void layout(DrawContext dc)
           
protected  void layoutDynamicModifiers(DrawContext dc, AVList modifiers)
          Layout dynamic modifiers around the symbol.
protected  void layoutGraphicModifiers(DrawContext dc, AVList modifiers)
          Layout static graphic modifiers around the symbol.
protected  void layoutIcon(DrawContext dc, AbstractTacticalSymbol.IconSource source)
           
protected  Rectangle layoutLabelRect(Offset offset, Offset hotspot, Dimension size, Object layoutMode)
          Layout a label rectangle relative to the current layout.
protected  List<? extends Point2D> layoutPoints(Offset offset, List<? extends Point2D> points, Object layoutMode, int numPointsInLayout)
           
protected  Rectangle layoutRect(Offset offset, Offset hotspot, Dimension size, Object layoutMode)
          Layout a rectangle relative to the current layout.
protected  void layoutStaticModifiers(DrawContext dc, AVList modifiers)
          Layout static modifiers around the symbol.
protected  void layoutTextModifiers(DrawContext dc, AVList modifiers)
          Layout static text modifiers around the symbol.
protected  void makeOrderedRenderable(DrawContext dc)
           
 void move(Position delta)
          Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
 void moveTo(Position position)
          Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
protected  boolean mustDrawGraphicModifiers(DrawContext dc)
           
protected  boolean mustDrawIcon(DrawContext dc)
           
protected  boolean mustDrawTextModifiers(DrawContext dc)
           
protected  boolean mustLayout(AbstractTacticalSymbol.IconSource iconSource, AVList modifiers)
          Determines if the icon layout or static modifier layout must be computed.
 void pick(DrawContext dc, Point pickPoint)
          Executes a pick of the ordered renderable.
protected  void prepareToDraw(DrawContext dc)
           
protected  void removeDeadModifiers(long now)
           
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
protected  void reset()
          Invalidate the symbol layout, causing it to be recomputed on the next frame.
 void setAltitudeMode(int altitudeMode)
          Specifies this symbol's altitude mode.
 void setAttributes(TacticalSymbolAttributes normalAttrs)
          Specifies this symbol's normal (as opposed to highlight) attributes.
 void setDelegateOwner(Object owner)
          Specifies the delegate owner of this symbol.
protected  void setDepthOffset(Double depthOffset)
           
 void setEnableBatchPicking(boolean enableBatchPicking)
           
 void setEnableBatchRendering(boolean enableBatchRendering)
           
protected  void setGlyphAtlas(TextureAtlas atlas)
           
 void setHighlightAttributes(TacticalSymbolAttributes highlightAttrs)
          Specifies this symbol's highlight attributes.
 void setHighlighted(boolean highlighted)
          Specifies whether to highlight the shape.
protected  void setIconRetriever(IconRetriever retriever)
           
 void setModifier(String modifier, Object value)
          Specifies the value of a text or graphic modifier.
protected  void setModifierRetriever(IconRetriever retriever)
           
 void setOffset(Offset offset)
          Specifies a location within the tactical symbol to align with the symbol point.
 void setPosition(Position position)
          Specifies this symbol's geographic position.
 void setShowGraphicModifiers(boolean showGraphicModifiers)
          Specifies whether to draw this symbol's supplemental graphic modifiers.
 void setShowHostileIndicator(boolean show)
          Specifies whether or not to display an indicator when the symbol represents a hostile entity.
 void setShowLocation(boolean show)
          Specifies whether or not to display this symbol's location as a text modifier.
 void setShowTextModifiers(boolean showTextModifiers)
          Specifies whether to draw this symbol's supplemental text modifiers.
 void setUnitsFormat(UnitsFormat unitsFormat)
          Specifies the unit format used to format values in text modifiers.
 void setVisible(boolean visible)
          Specifies whether this symbol is drawn when in view.
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
 
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.TacticalSymbol
getIdentifier
 
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 java.beans.PropertyChangeListener
propertyChange
 
Methods inherited from interface gov.nasa.worldwind.event.MessageListener
onMessage
 

Field Detail

activeAttrs

protected TacticalSymbolAttributes activeAttrs
Indicates this symbol's currently active attributes. Updated in determineActiveAttributes(). Initialized to a new BasicTacticalSymbolAttributes.


activeIconTexture

protected WWTexture activeIconTexture

activeModifiers

protected AVList activeModifiers
Modifiers active this frame. This list is determined by copying modifiers, and applying changings in applyImplicitModifiers(gov.nasa.worldwind.avlist.AVList).


altitudeMode

protected int altitudeMode
Indicates this symbol's altitude mode. See setAltitudeMode(int) for a description of the valid altitude modes. Initially Worldwind.ABSOLUTE.


BEogsh

protected OGLStackHandler BEogsh
Support for setting up and restoring OpenGL state during rendering. Initialized to a new OGLStackHandler, and used in beginDrawing(gov.nasa.worldwind.render.DrawContext, int) and endDrawing(gov.nasa.worldwind.render.DrawContext).


currentGlyphs

protected List<AbstractTacticalSymbol.IconAtlasElement> currentGlyphs

currentLabels

protected List<AbstractTacticalSymbol.Label> currentLabels

currentLines

protected List<AbstractTacticalSymbol.Line> currentLines

DEFAULT_DEPTH_OFFSET

protected static final double DEFAULT_DEPTH_OFFSET
The default depth offset in device independent depth units: -8200. This value is configured to match the depth offset produced by existing screen elements such as PointPlacemark. This value was determined empirically.

See Also:
Constant Field Values

DEFAULT_GLYPH_ATLAS

protected static final TextureAtlas DEFAULT_GLYPH_ATLAS
The default glyph texture atlas. This texture atlas holds all glyph images loaded by calls to layoutGlyphModifier. Initialized with initial dimensions of 1024x128 and maximum dimensions of 2048x2048. Configured to remove the least recently used texture elements when more space is needed.


DEFAULT_LABEL_LINES

protected static final int DEFAULT_LABEL_LINES
The default number of label lines to expect when computing the minimum size of the text layout rectangle.

See Also:
Constant Field Values

DEFAULT_MAX_TIME_SINCE_LAST_USED

protected static final long DEFAULT_MAX_TIME_SINCE_LAST_USED
See Also:
Constant Field Values

DEFAULT_UNITS_FORMAT

public static final UnitsFormat DEFAULT_UNITS_FORMAT
Default unit format.


defaultAttrs

protected static TacticalSymbolAttributes defaultAttrs
The attributes used if attributes are not specified.


delegateOwner

protected Object delegateOwner
Indicates an object to attach to the picked object list instead of this symbol.


depthOffset

protected Double depthOffset

dx

protected double dx
Per-frame screen offset indicating this symbol's x-offset relative to the screenPoint. Calculated each frame in computeTransform(gov.nasa.worldwind.render.DrawContext). Initially 0.


dy

protected double dy
Per-frame screen offset indicating this symbol's y-offset relative to the screenPoint. Calculated each frame in computeTransform(gov.nasa.worldwind.render.DrawContext). Initially 0.


enableBatchPicking

protected boolean enableBatchPicking

enableBatchRendering

protected boolean enableBatchRendering

eyeDistance

protected double eyeDistance
Per-frame distance corresponding to the distance between the placePoint and the View's eye point. Used to order the symbol as an ordered renderable, and is returned by getDistanceFromEye. Calculated each frame in computeSymbolPoints(gov.nasa.worldwind.render.DrawContext). Initially 0.


formattedPosition

protected String formattedPosition
Current symbol position, formatted using the current unit format.


frameNumber

protected long frameNumber
The frame used to calculate this symbol's per-frame values. Set to the draw context's frame number each frame. Initially -1.


glyphAtlas

protected TextureAtlas glyphAtlas

glyphMap

protected Map<String,AbstractTacticalSymbol.IconAtlasElement> glyphMap

highlightAttrs

protected TacticalSymbolAttributes highlightAttrs
Indicates this symbol's highlight attributes. May be null, indicating that the default attributes are used. Initially null.


highlighted

protected boolean highlighted
Indicates whether this symbol is highlighted. true if this symbol is highlighted, otherwise false. Initially false.


iconOffset

protected Offset iconOffset

iconRect

protected Rectangle iconRect

iconRectScaled

protected Rectangle iconRectScaled
iconRect with scaling applied, used to lay out text.


iconRetriever

protected IconRetriever iconRetriever

iconSize

protected Size iconSize

iconTexture

protected WWTexture iconTexture

LAYOUT_ABSOLUTE

protected static final String LAYOUT_ABSOLUTE
See Also:
Constant Field Values

LAYOUT_NONE

protected static final String LAYOUT_NONE
See Also:
Constant Field Values

LAYOUT_RELATIVE

protected static final String LAYOUT_RELATIVE
See Also:
Constant Field Values

layoutRect

protected Rectangle layoutRect

layoutRectScaled

protected Rectangle layoutRectScaled
layoutRect with scaling applied, used to lay out text.


LOADING_IMAGE_PATH

public static final String LOADING_IMAGE_PATH
The image file displayed while the icon is loading.


MAX_SYMBOL_DIMENSION

protected static final int MAX_SYMBOL_DIMENSION
Maximum expected size of a symbol, used to estimate screen bounds for view frustum culling. This value is configured a bit higher than a symbol is likely to be drawn in practice to err on the side of not culling a symbol that is not visible, rather culling one that is visible.

See Also:
Constant Field Values

maxTimeSinceLastUsed

protected long maxTimeSinceLastUsed

modifierRetriever

protected IconRetriever modifierRetriever

modifiers

protected AVList modifiers
Indicates the current text and graphic modifiers assigned to this symbol. This list of key-value pairs contains both the modifiers specified by the string identifier during construction, and those specified by calling setModifier(String, Object). Initialized to a new AVListImpl, and populated during construction from values in the string identifier and the modifiers list.


normalAttrs

protected TacticalSymbolAttributes normalAttrs
Indicates this symbol's normal (as opposed to highlight) attributes. May be null, indicating that the default attributes are used. Initially null.


offset

protected Offset offset

pickLayer

protected Layer pickLayer
Per-frame layer indicating this symbol's layer when its ordered renderable was created. Assigned each frame in makeOrderedRenderable(gov.nasa.worldwind.render.DrawContext). Used to define the picked object's layer during pick resolution. Initially null.


pickSupport

protected PickSupport pickSupport
Support for setting up and restoring picking state, and resolving the picked object. Initialized to a new PickSupport, and used in pick(gov.nasa.worldwind.render.DrawContext, java.awt.Point).


placePoint

protected Vec4 placePoint
Per-frame Cartesian point corresponding to this symbol's position. Calculated each frame in computeSymbolPoints(gov.nasa.worldwind.render.DrawContext). Initially null.


position

protected Position position
Indicates this symbol's geographic position. See setPosition(gov.nasa.worldwind.geom.Position) for a description of how tactical symbols interpret their position. Must be non-null, and is initialized during construction.


screenPoint

protected Vec4 screenPoint
Per-frame screen point corresponding to the projection of the placePoint in the viewport (on the screen). Calculated each frame in computeSymbolPoints(gov.nasa.worldwind.render.DrawContext). Initially null.


screenRect

protected Rectangle screenRect

showGraphicModifiers

protected boolean showGraphicModifiers
Indicates whether this symbol draws its supplemental graphic modifiers. true if this symbol draws its graphic modifiers, otherwise false. Initially true.


showHostileIndicator

protected boolean showHostileIndicator
Indicates whether or not to display the implicit hostile indicator modifier.


showLocation

protected boolean showLocation
Indicates whether or not to display the implicit location modifier.


showTextModifiers

protected boolean showTextModifiers
Indicates whether this symbol draws its supplemental text modifiers. true if this symbol draws its text modifiers, otherwise false. Initially true.


staticLayoutRect

protected Rectangle staticLayoutRect
Layout rect computed from the icon and static modifiers. This rectangle is cached and only recomputed when the icon or modifiers change.


staticScreenRect

protected Rectangle staticScreenRect
Screen rect computed from the icon and static modifiers. This rectangle is cached and only recomputed when the icon or modifiers change.


sx

protected double sx
Per-frame screen scale indicating this symbol's x-scale relative to the screen offset. Calculated each frame in computeTransform(gov.nasa.worldwind.render.DrawContext). Initially 0.


sy

protected double sy
Per-frame screen scale indicating this symbol's y-scale relative to the screen offset. Calculated each frame in computeTransform(gov.nasa.worldwind.render.DrawContext). Initially 0.


unitsFormat

protected UnitsFormat unitsFormat
Unit format used to format location and altitude for text modifiers.


unresolvedGlyph

protected boolean unresolvedGlyph
Indicates that one or more glyphs have not been resolved.


visible

protected boolean visible
Indicates whether this symbol is drawn when in view. true if this symbol is drawn when in view, otherwise false. Initially true.

Constructor Detail

AbstractTacticalSymbol

protected AbstractTacticalSymbol()
Constructs a new symbol with no position.


AbstractTacticalSymbol

protected AbstractTacticalSymbol(Position position)
Constructs a new symbol with the specified position. The position specifies the latitude, longitude, and altitude where this symbol is drawn on the globe. The position's altitude component is interpreted according to the altitudeMode.

Parameters:
position - the latitude, longitude, and altitude where the symbol is drawn.
Throws:
IllegalArgumentException - if the position is null.
Method Detail

addGlyph

protected void addGlyph(DrawContext dc,
                        Offset offset,
                        Offset hotspot,
                        String modifierCode)

addGlyph

protected void addGlyph(DrawContext dc,
                        Offset offset,
                        Offset hotspot,
                        String modifierCode,
                        AVList retrieverParams,
                        Object layoutMode)

addLabel

protected void addLabel(DrawContext dc,
                        Offset offset,
                        Offset hotspot,
                        String modifierText)

addLabel

protected void addLabel(DrawContext dc,
                        Offset offset,
                        Offset hotspot,
                        String modifierText,
                        Font font,
                        Color color,
                        Object layoutMode)

addLine

protected void addLine(DrawContext dc,
                       Offset offset,
                       List<? extends Point2D> points)

addLine

protected void addLine(DrawContext dc,
                       Offset offset,
                       List<? extends Point2D> points,
                       Object layoutMode,
                       int numPointsInLayout)

applyImplicitModifiers

protected void applyImplicitModifiers(AVList modifiers)
Add implicit modifiers to the modifier list. This method is called each frame to add modifiers that are determined implicitly by the symbol state, rather than set explicitly by the application. For example, the location modifier can be determined by the symbol position without the application needing to specify it.

Parameters:
modifiers - List of modifiers. This method may modify this list by adding implicit modifiers.

assembleIconRetrieverParameters

protected AVList assembleIconRetrieverParameters(AVList params)

beginDrawing

protected void beginDrawing(DrawContext dc,
                            int attrMask)

computeMinTextLayout

protected Dimension computeMinTextLayout(DrawContext dc,
                                         AVList modifiers)
Compute the dimension of the minimum layout rectangle for the text modifiers. A minimum dimension is enforced to prevent the text from overlapping if the symbol is scaled to a very small size.

Parameters:
dc - Current draw context.
Returns:
Minimum dimension for the label layout rectangle.

computeScale

protected void computeScale()

computeScaledBounds

protected void computeScaledBounds(DrawContext dc,
                                   AVList modifiers)
Compute the bounds of symbol after the scale has been applied. This method computes iconRectScaled and layoutRectScaled.

Parameters:
dc - Current draw context.
modifiers - Current modifiers.

computeScaledRect

protected Rectangle computeScaledRect(Rectangle rect,
                                      Dimension maxDimension,
                                      double scaleX,
                                      double scaleY)

computeScreenExtent

protected Rectangle computeScreenExtent()

computeSymbolPoints

protected void computeSymbolPoints(DrawContext dc)

computeTransform

protected void computeTransform(DrawContext dc)

createPickedObject

protected PickedObject createPickedObject(int colorCode)

determineActiveAttributes

protected void determineActiveAttributes()

doDrawOrderedRenderable

protected void doDrawOrderedRenderable(DrawContext dc,
                                       PickSupport pickCandidates)

draw

protected void draw(DrawContext dc)

drawBatched

protected void drawBatched(DrawContext dc)

drawGlyphs

protected void drawGlyphs(DrawContext dc)

drawGraphicModifiers

protected void drawGraphicModifiers(DrawContext dc)

drawIcon

protected void drawIcon(DrawContext dc)

drawLabels

protected void drawLabels(DrawContext dc)

drawLines

protected void drawLines(DrawContext dc)

drawOrderedRenderable

protected void drawOrderedRenderable(DrawContext dc)

drawTextModifiers

protected void drawTextModifiers(DrawContext dc)

endDrawing

protected void endDrawing(DrawContext dc)

getActiveAttributes

protected TacticalSymbolAttributes getActiveAttributes()

getAltitudeMode

public int getAltitudeMode()
Indicates this symbol's altitude mode. See TacticalSymbol.setAltitudeMode(int) for a description of the valid altitude modes.

Specified by:
getAltitudeMode in interface TacticalSymbol
Returns:
this symbol's altitude mode.

getAttributes

public TacticalSymbolAttributes getAttributes()
Returns this symbol's normal (as opposed to highlight) attributes.

Specified by:
getAttributes in interface TacticalSymbol
Returns:
this symbol's normal attributes. May be null, indicating that the default highlight attributes are used.

getDelegateOwner

public Object getDelegateOwner()
Indicates the delegate owner of this symbol. If non-null, the returned object replaces the symbol as the pickable object returned during picking. If null, the symbol itself is the pickable object returned during picking.

Specified by:
getDelegateOwner in interface TacticalSymbol
Returns:
the object used as the pickable object returned during picking, or null to indicate the the symbol is returned during picking.

getDepthOffset

protected Double getDepthOffset()

getDistanceFromEye

public double getDistanceFromEye()
Returns the ordered renderable's distance from the current view's eye point. Intended to be used only to sort a list of ordered renderables according to eye distance, and only during frame generation when a view is active.

Specified by:
getDistanceFromEye in interface OrderedRenderable
Returns:
the distance of the ordered renderable from the current view's eye point.

getFormattedPosition

protected String getFormattedPosition()
Indicates the symbol's current position, formatted according to the current UnitsFormat.

Returns:
The current position formatted according to the current unit format. Returns null if the position is null.

getGlyph

protected AbstractTacticalSymbol.IconAtlasElement getGlyph(String modifierCode,
                                                           AVList retrieverParams)

getGlyphAtlas

protected TextureAtlas getGlyphAtlas()

getHighlightAttributes

public TacticalSymbolAttributes getHighlightAttributes()
Returns this symbol's highlight attributes.

Specified by:
getHighlightAttributes in interface TacticalSymbol
Returns:
this symbol's highlight attributes. May be null, indicating that the default attributes are used.

getIconRetriever

protected IconRetriever getIconRetriever()

getMaxLabelLines

protected int getMaxLabelLines(AVList modifiers)

getMaxSymbolDimension

protected int getMaxSymbolDimension()
Indicates the maximum expected size of a rendered tactical symbol. This value is used to estimate the size of a symbol and perform culling. If the symbol would not be visible (assuming it is the max size), then the icon does not need to be retrieved.

Returns:
Maximum size of a symbol, in pixels.

getModifier

public Object getModifier(String modifier)
Indicates the current value of a text or graphic modifier. See TacticalSymbol.setModifier(String, Object) for a description of how modifiers values are interpreted.

Specified by:
getModifier in interface TacticalSymbol
Parameters:
modifier - the modifier key.
Returns:
the modifier value. May be null, indicating that this symbol does not display the specified modifier.

getModifierRetriever

protected IconRetriever getModifierRetriever()

getOffset

public Offset getOffset()
Indicates a location within the symbol to align with the symbol point. See setOffset for more information.

Returns:
the hot spot controlling the symbol's placement relative to the symbol point. null indicates default alignment.

getPosition

public Position getPosition()
Indicates this symbol's geographic position. See TacticalSymbol.setPosition(gov.nasa.worldwind.geom.Position) for a description of how tactical symbols interpret their position.

Specified by:
getPosition in interface TacticalSymbol
Returns:
this symbol's current geographic position.

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.

getUnitsFormat

public UnitsFormat getUnitsFormat()
Indicates the unit format used to format values in text modifiers.

Specified by:
getUnitsFormat in interface TacticalSymbol
Returns:
Units format used to format text modifiers.

intersectsFrustum

protected boolean intersectsFrustum(DrawContext dc)

isEnableBatchPicking

public boolean isEnableBatchPicking()

isEnableBatchRendering

public boolean isEnableBatchRendering()

isHighlighted

public boolean isHighlighted()
Indicates whether to highlight the shape.

Specified by:
isHighlighted in interface Highlightable
Returns:
true to highlight the shape, otherwise false.

isShowGraphicModifiers

public boolean isShowGraphicModifiers()
Indicates whether this symbol draws its supplemental graphic modifiers.

Specified by:
isShowGraphicModifiers in interface TacticalSymbol
Returns:
true if this symbol draws its graphic modifiers, otherwise false.

isShowHostileIndicator

public boolean isShowHostileIndicator()
Indicates whether or not to display an indicator when the symbol represents a hostile entity. See comments on setShowHostileIndicator for more information.

Specified by:
isShowHostileIndicator in interface TacticalSymbol
Returns:
true if an indicator will be drawn when this symbol represents a hostile entity, if supported by the symbol specification.

isShowLocation

public boolean isShowLocation()
Indicates whether or not to display this symbol's location as a text modifier. Not all symbols support the location modifier.

Specified by:
isShowLocation in interface TacticalSymbol
Returns:
true if the symbol will display the location modifier. Note that not some symbols may not support this modifier.

isShowTextModifiers

public boolean isShowTextModifiers()
Indicates whether this symbol draws its supplemental text modifiers.

Specified by:
isShowTextModifiers in interface TacticalSymbol
Returns:
true if this symbol draws its text modifiers, otherwise false.

isVisible

public boolean isVisible()
Indicates whether this symbol is drawn when in view.

Specified by:
isVisible in interface TacticalSymbol
Returns:
true if this symbol is drawn when in view, otherwise false.

layout

protected void layout(DrawContext dc)

layoutDynamicModifiers

protected void layoutDynamicModifiers(DrawContext dc,
                                      AVList modifiers)
Layout dynamic modifiers around the symbol. Dynamic modifiers are expected to (potentially) change each frame, and are laid out each frame. For example, a direction of movement line that is computed based on the current eye position would be treated as a dynamic modifier. Dynamic modifiers are always laid out after static modifiers.

Parameters:
dc - Current draw context.
modifiers - Current modifiers.
See Also:
layoutStaticModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList)

layoutGraphicModifiers

protected void layoutGraphicModifiers(DrawContext dc,
                                      AVList modifiers)
Layout static graphic modifiers around the symbol. Static modifiers are not expected to change due to changes in view. The static layout is computed when a modifier is changed, but may not be computed each frame. For example, a text modifier indicating a symbol identifier would only need to be laid out when the text is changed, so this is best treated as a static modifier. However a direction of movement line that needs to be computed based on the current eye position should be treated as a dynamic modifier.

Parameters:
dc - Current draw context.
modifiers - Current modifiers.
See Also:
layoutDynamicModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList)

layoutIcon

protected void layoutIcon(DrawContext dc,
                          AbstractTacticalSymbol.IconSource source)

layoutLabelRect

protected Rectangle layoutLabelRect(Offset offset,
                                    Offset hotspot,
                                    Dimension size,
                                    Object layoutMode)
Layout a label rectangle relative to the current layout. This method lays out text around the icon and graphic modifiers after scaling has been applied (text is not scaled with the icon).

Parameters:
offset - Offset into either the iconRect or layoutRect at which to align the hot spot.
hotspot - Offset into the rectangle of the hot spot.
size - Size of the rectangle.
layoutMode - One of LAYOUT_ABSOLUTE, LAYOUT_RELATIVE, or LAYOUT_NONE.
Returns:
the laid out rectangle.

layoutPoints

protected List<? extends Point2D> layoutPoints(Offset offset,
                                               List<? extends Point2D> points,
                                               Object layoutMode,
                                               int numPointsInLayout)

layoutRect

protected Rectangle layoutRect(Offset offset,
                               Offset hotspot,
                               Dimension size,
                               Object layoutMode)
Layout a rectangle relative to the current layout.

Parameters:
offset - Offset into either the iconRect or layoutRect at which to align the hot spot.
hotspot - Offset into the rectangle of the hot spot.
size - Size of the rectangle.
layoutMode - One of LAYOUT_ABSOLUTE, LAYOUT_RELATIVE, or LAYOUT_NONE.
Returns:
the laid out rectangle.

layoutStaticModifiers

protected void layoutStaticModifiers(DrawContext dc,
                                     AVList modifiers)
Layout static modifiers around the symbol. Static modifiers are not expected to change due to changes in view. Subclasses should not override this method. Instead, subclasses may override layoutGraphicModifiers and layoutTextModifiers.

Parameters:
dc - Current draw context.
modifiers - Current modifiers.
See Also:
layoutDynamicModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList), layoutGraphicModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList), layoutTextModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList)

layoutTextModifiers

protected void layoutTextModifiers(DrawContext dc,
                                   AVList modifiers)
Layout static text modifiers around the symbol. Static modifiers are not expected to change due to changes in view. The static layout is computed when a modifier is changed, but may not be computed each frame. For example, a text modifier indicating a symbol identifier would only need to be laid out when the text is changed, so this is best treated as a static modifier. However a direction of movement line that needs to be computed based on the current eye position should be treated as a dynamic modifier.

Parameters:
dc - Current draw context.
modifiers - Current modifiers.
See Also:
layoutDynamicModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList)

makeOrderedRenderable

protected void makeOrderedRenderable(DrawContext dc)

move

public void move(Position delta)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
move in interface Movable
Parameters:
delta - the latitude and longitude to add to the shape's reference position.

moveTo

public void moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.

Specified by:
moveTo in interface Movable
Parameters:
position - the new position of the shape's reference position.

mustDrawGraphicModifiers

protected boolean mustDrawGraphicModifiers(DrawContext dc)

mustDrawIcon

protected boolean mustDrawIcon(DrawContext dc)

mustDrawTextModifiers

protected boolean mustDrawTextModifiers(DrawContext dc)

mustLayout

protected boolean mustLayout(AbstractTacticalSymbol.IconSource iconSource,
                             AVList modifiers)
Determines if the icon layout or static modifier layout must be computed.

Parameters:
iconSource - Current icon source.
modifiers - Current modifiers.
Returns:
true if the layout must be recomputed.

pick

public void pick(DrawContext dc,
                 Point pickPoint)
Executes a pick of the ordered renderable.

Specified by:
pick in interface OrderedRenderable
Parameters:
dc - the current draw context.
pickPoint - the pick point.

prepareToDraw

protected void prepareToDraw(DrawContext dc)

removeDeadModifiers

protected void removeDeadModifiers(long now)

render

public void render(DrawContext dc)
Causes this Renderable to render itself using the provided draw context.

Specified by:
render in interface Renderable
Parameters:
dc - the DrawContext to be used
See Also:
DrawContext

reset

protected void reset()
Invalidate the symbol layout, causing it to be recomputed on the next frame.


setAltitudeMode

public void setAltitudeMode(int altitudeMode)
Specifies this symbol's altitude mode. Altitude mode defines how the altitude component of this symbol's position is interpreted. Recognized modes are:

This symbol assumes the altitude mode WorldWind.ABSOLUTE if the specified mode is not recognized.

Specified by:
setAltitudeMode in interface TacticalSymbol
Parameters:
altitudeMode - this symbol's new altitude mode.

setAttributes

public void setAttributes(TacticalSymbolAttributes normalAttrs)
Specifies this symbol's normal (as opposed to highlight) attributes.

Specified by:
setAttributes in interface TacticalSymbol
Parameters:
normalAttrs - the normal attributes. May be null, in which case default attributes are used.

setDelegateOwner

public void setDelegateOwner(Object owner)
Specifies the delegate owner of this symbol. If non-null, the delegate owner replaces the symbol as the pickable object returned during picking. If null, the symbol itself is the pickable object returned during picking.

Specified by:
setDelegateOwner in interface TacticalSymbol
Parameters:
owner - the object to use as the pickable object returned during picking, or null to return the symbol.

setDepthOffset

protected void setDepthOffset(Double depthOffset)

setEnableBatchPicking

public void setEnableBatchPicking(boolean enableBatchPicking)

setEnableBatchRendering

public void setEnableBatchRendering(boolean enableBatchRendering)

setGlyphAtlas

protected void setGlyphAtlas(TextureAtlas atlas)

setHighlightAttributes

public void setHighlightAttributes(TacticalSymbolAttributes highlightAttrs)
Specifies this symbol's highlight attributes.

Specified by:
setHighlightAttributes in interface TacticalSymbol
Parameters:
highlightAttrs - the highlight attributes. May be null, in which case default highlight attributes are used.

setHighlighted

public void setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.

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

setIconRetriever

protected void setIconRetriever(IconRetriever retriever)

setModifier

public void setModifier(String modifier,
                        Object value)
Specifies the value of a text or graphic modifier. Which modifier keys are recognized how they affect the symbol's graphic is implementation dependent. If the modifier has an implicit value and only needs to be enabled (e.g. the MIL-STD-2525 location modifier), specify true as the modifier value. If the specified value is null, the modifier is removed from this symbol.

If the specified modifier represents a graphic or text modifier, its display is suppressed if isShowGraphicModifiers or isShowTextModifiers, respectively, returns false.

Specified by:
setModifier in interface TacticalSymbol
Parameters:
modifier - the modifier key.
value - the modifier value. May be null, indicating that the modifier should be removed from this symbol.

setModifierRetriever

protected void setModifierRetriever(IconRetriever retriever)

setOffset

public void setOffset(Offset offset)
Specifies a location within the tactical symbol to align with the symbol point. By default, ground symbols are aligned at the bottom center of the symbol, and other symbols are aligned to the center of the symbol. setOffset(Offset.CENTER) aligns the center of the symbol with the symbol point, and setOffset(Offset.BOTTOM_CENTER) aligns the center of the bottom edge with the symbol point.

Parameters:
offset - the hot spot controlling the symbol's placement relative to the symbol point. May be null to indicate default alignment.

setPosition

public void setPosition(Position position)
Specifies this symbol's geographic position. The specified position must be non-null, and defines where on the globe this symbol displays its graphic. The position's altitude component is interpreted according to the altitudeMode. The type of graphic this symbol displays at the position is implementation dependent.

Specified by:
setPosition in interface TacticalSymbol
Parameters:
position - this symbol's new position.

setShowGraphicModifiers

public void setShowGraphicModifiers(boolean showGraphicModifiers)
Specifies whether to draw this symbol's supplemental graphic modifiers.

Specified by:
setShowGraphicModifiers in interface TacticalSymbol
Parameters:
showGraphicModifiers - true if this symbol should draw its graphic modifiers, otherwise false.

setShowHostileIndicator

public void setShowHostileIndicator(boolean show)
Specifies whether or not to display an indicator when the symbol represents a hostile entity. The indicator is determined by the symbology set, and may not apply to all symbols in the symbol set. In the case of MIL-STD-2525C, the indicator is the letters "ENY" displayed at the lower right corner of the symbol.

Specified by:
setShowHostileIndicator in interface TacticalSymbol
Parameters:
show - true if this symbol will display an indicator when this symbol represents a hostile entity and the symbol specification supports such an indicator.

setShowLocation

public void setShowLocation(boolean show)
Specifies whether or not to display this symbol's location as a text modifier. Not all symbols support the location modifier. Setting showLocation on a symbol that does not support the modifier will have no effect.

Specified by:
setShowLocation in interface TacticalSymbol
Parameters:
show - true if the symbol will display the location modifier. Note that not some symbols may not support this modifier.

setShowTextModifiers

public void setShowTextModifiers(boolean showTextModifiers)
Specifies whether to draw this symbol's supplemental text modifiers.

Specified by:
setShowTextModifiers in interface TacticalSymbol
Parameters:
showTextModifiers - true if this symbol should draw its text modifiers, otherwise false.

setUnitsFormat

public void setUnitsFormat(UnitsFormat unitsFormat)
Specifies the unit format used to format values in text modifiers.

Specified by:
setUnitsFormat in interface TacticalSymbol
Parameters:
unitsFormat - Format used to format text modifiers.

setVisible

public void setVisible(boolean visible)
Specifies whether this symbol is drawn when in view.

Specified by:
setVisible in interface TacticalSymbol
Parameters:
visible - true if this symbol should be drawn when in view, otherwise false.

NASA World Wind