NASA World Wind

gov.nasa.worldwind.symbology.milstd2525
Class MilStd2525TacticalSymbol

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.symbology.AbstractTacticalSymbol
              extended by gov.nasa.worldwind.symbology.milstd2525.MilStd2525TacticalSymbol
All Implemented Interfaces:
AVList, MessageListener, Movable, Highlightable, OrderedRenderable, Renderable, TacticalSymbol, WWObject, PropertyChangeListener, EventListener

public class MilStd2525TacticalSymbol
extends AbstractTacticalSymbol

Implementation of TacticalSymbol that provides support for tactical symbols from the MIL-STD-2525 symbology set. See the Tactical Symbol Usage Guide for instructions on using TacticalSymbol in an application.


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.symbology.AbstractTacticalSymbol
AbstractTacticalSymbol.IconAtlasElement, AbstractTacticalSymbol.IconSource, AbstractTacticalSymbol.IconTexture, AbstractTacticalSymbol.Label, AbstractTacticalSymbol.Line
 
Field Summary
protected static Font DEFAULT_FRAME_SHAPE_FONT
           
static UnitsFormat DEFAULT_UNITS_FORMAT
          Default unit format.
protected static Set<String> exerciseSymbols
           
protected  boolean isGroundSymbol
           
protected  SymbolCode symbolCode
          Indicates a string identifier for this symbol.
protected static Map<String,String> symbolEchelonMap
           
protected  boolean useGroundHeadingIndicator
           
 
Fields inherited from class gov.nasa.worldwind.symbology.AbstractTacticalSymbol
activeAttrs, activeIconTexture, activeModifiers, altitudeMode, BEogsh, currentGlyphs, currentLabels, currentLines, DEFAULT_DEPTH_OFFSET, DEFAULT_GLYPH_ATLAS, DEFAULT_LABEL_LINES, DEFAULT_MAX_TIME_SINCE_LAST_USED, defaultAttrs, delegateOwner, depthOffset, dx, dy, enableBatchPicking, enableBatchRendering, eyeDistance, formattedPosition, frameNumber, glyphAtlas, glyphMap, highlightAttrs, highlighted, iconOffset, iconRect, iconRectScaled, iconRetriever, iconSize, iconTexture, LAYOUT_ABSOLUTE, LAYOUT_NONE, LAYOUT_RELATIVE, layoutRect, layoutRectScaled, LOADING_IMAGE_PATH, MAX_SYMBOL_DIMENSION, maxTimeSinceLastUsed, modifierRetriever, modifiers, normalAttrs, offset, pickLayer, pickSupport, placePoint, position, screenPoint, screenRect, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, staticLayoutRect, staticScreenRect, sx, sy, unitsFormat, unresolvedGlyph, visible
 
Constructor Summary
MilStd2525TacticalSymbol(String symbolId, Position position)
          Constructs a tactical symbol for the MIL-STD-2525 symbology set with the specified symbol identifier and position.
MilStd2525TacticalSymbol(String symbolId, Position position, AVList modifiers)
          Constructs a tactical symbol for the MIL-STD-2525 symbology set with the specified symbol identifier, position, and list of modifiers.
 
Method Summary
protected  void appendTextModifier(StringBuilder sb, AVList modifiers, String modifierKey, Integer maxLength)
           
protected  void applyImplicitModifiers(AVList modifiers)
          Add implicit modifiers to the modifier list.
protected  AVList assembleIconRetrieverParameters(AVList params)
           
protected  void computeTransform(DrawContext dc)
           
 String getIdentifier()
          Indicates a string identifier for this symbol.
protected  int getMaxLabelLines(AVList modifiers)
           
protected  String getModifierCode(AVList modifiers, String modifierKey)
           
protected  String getReinforcedReducedModifier(AVList modifiers, String modifierKey)
           
 String getStatus()
          Indicates the current value of symbol's Status/Operational Condition field.
protected  void init(String symbolId, AVList modifiers)
           
protected  void initIconLayout()
           
 boolean isShowFill()
          Indicates whether this symbol draws its fill.
 boolean isShowFrame()
          Indicates whether this symbol draws its frame.
 boolean isShowIcon()
          Indicates whether this symbol draws its internal icon.
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 layoutTextModifiers(DrawContext dc, AVList modifiers)
          Layout static text modifiers around the symbol.
protected  boolean mustUseAlternateOperationalCondition(AVList modifiers)
          Indicates whether or not the symbol should be displayed using the alternate Operational Condition indicator described in MIL-STD-2525C spec Table III-2, pg.
 void setShowFill(boolean showFill)
          Specifies whether to draw this symbol's fill.
 void setShowFrame(boolean showFrame)
          Specifies whether to draw this symbol's frame.
 void setShowIcon(boolean showIcon)
          Specifies whether to draw this symbol's internal icon.
 void setStatus(String value)
          Specifies this symbol's Status/Operational Condition field.
 
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalSymbol
addGlyph, addGlyph, addLabel, addLabel, addLine, addLine, beginDrawing, computeMinTextLayout, computeScale, computeScaledBounds, computeScaledRect, computeScreenExtent, computeSymbolPoints, createPickedObject, determineActiveAttributes, doDrawOrderedRenderable, draw, drawBatched, drawGlyphs, drawGraphicModifiers, drawIcon, drawLabels, drawLines, drawOrderedRenderable, drawTextModifiers, endDrawing, getActiveAttributes, getAltitudeMode, getAttributes, getDelegateOwner, getDepthOffset, getDistanceFromEye, getFormattedPosition, getGlyph, getGlyphAtlas, getHighlightAttributes, getIconRetriever, getMaxSymbolDimension, getModifier, getModifierRetriever, getOffset, getPosition, getReferencePosition, getUnitsFormat, intersectsFrustum, isEnableBatchPicking, isEnableBatchRendering, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, layout, layoutIcon, layoutLabelRect, layoutPoints, layoutRect, layoutStaticModifiers, makeOrderedRenderable, move, moveTo, mustDrawGraphicModifiers, mustDrawIcon, mustDrawTextModifiers, mustLayout, pick, prepareToDraw, removeDeadModifiers, render, reset, setAltitudeMode, setAttributes, setDelegateOwner, setDepthOffset, setEnableBatchPicking, setEnableBatchRendering, setGlyphAtlas, setHighlightAttributes, setHighlighted, setIconRetriever, setModifier, setModifierRetriever, setOffset, setPosition, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setUnitsFormat, setVisible
 
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.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

DEFAULT_FRAME_SHAPE_FONT

protected static final Font DEFAULT_FRAME_SHAPE_FONT

DEFAULT_UNITS_FORMAT

public static final UnitsFormat DEFAULT_UNITS_FORMAT
Default unit format.


exerciseSymbols

protected static final Set<String> exerciseSymbols

isGroundSymbol

protected boolean isGroundSymbol

symbolCode

protected SymbolCode symbolCode
Indicates a string identifier for this symbol. The format of the identifier depends on the symbol set to which this symbol belongs. For symbols belonging to the MIL-STD-2525 symbol set, this returns a 15-character alphanumeric symbol identification code (SIDC). Calculated from the current modifiers at construction and during each call to AbstractTacticalSymbol.setModifier(String, Object). Initially null.


symbolEchelonMap

protected static final Map<String,String> symbolEchelonMap

useGroundHeadingIndicator

protected boolean useGroundHeadingIndicator
Constructor Detail

MilStd2525TacticalSymbol

public MilStd2525TacticalSymbol(String symbolId,
                                Position position)
Constructs a tactical symbol for the MIL-STD-2525 symbology set with the specified symbol identifier and position. This constructor does not accept any supplemental modifiers, so the symbol contains only the attributes specified by its symbol identifier. This constructor does not accept any icon retrieval path, so the created symbol retrieves its icons from the default location.

The symbolId specifies the tactical symbol's appearance. The symbolId must be a 15-character alphanumeric symbol identification code (SIDC). The symbol's shape, fill color, outline color, and icon are all defined by the symbol identifier. Use the '-' character to specify null entries in the symbol identifier.

The position specifies the latitude, longitude, and altitude where the symbol is drawn on the globe. The position's altitude component is interpreted according to the altitudeMode.

Parameters:
symbolId - a 15-character alphanumeric symbol identification code (SIDC).
position - the latitude, longitude, and altitude where the symbol is drawn.
Throws:
IllegalArgumentException - if either the symbolId or the position are null, or if the symbolId is not a valid 15-character alphanumeric symbol identification code (SIDC).

MilStd2525TacticalSymbol

public MilStd2525TacticalSymbol(String symbolId,
                                Position position,
                                AVList modifiers)
Constructs a tactical symbol for the MIL-STD-2525 symbology set with the specified symbol identifier, position, and list of modifiers. This constructor does not accept any icon retrieval path, so the created symbol retrieves its icons from the default location.

The symbolId specifies the tactical symbol's appearance. The symbolId must be a 15-character alphanumeric symbol identification code (SIDC). The symbol's shape, fill color, outline color, and icon are all defined by the symbol identifier. Use the '-' character to specify null entries in the symbol identifier.

The position specifies the latitude, longitude, and altitude where the symbol is drawn on the globe. The position's altitude component is interpreted according to this symbol's altitudeMode.

The modifiers specify supplemental graphic and text attributes as key-value pairs. See the MilStd2525TacticalSymbol class documentation for the list of recognized modifiers. In the case where both the symbol identifier and the modifiers list specify the same attribute, the modifiers list has priority.

Parameters:
symbolId - a 15-character alphanumeric symbol identification code (SIDC).
position - the latitude, longitude, and altitude where the symbol is drawn.
modifiers - an optional list of key-value pairs specifying the symbol's modifiers. May be null to specify that the symbol contains only the attributes in its symbol identifier.
Throws:
IllegalArgumentException - if either the symbolId or the position are null, or if the symbolId is not a valid 15-character alphanumeric symbol identification code (SIDC).
Method Detail

appendTextModifier

protected void appendTextModifier(StringBuilder sb,
                                  AVList modifiers,
                                  String modifierKey,
                                  Integer maxLength)

applyImplicitModifiers

protected void applyImplicitModifiers(AVList modifiers)
Description copied from class: AbstractTacticalSymbol
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.

Overrides:
applyImplicitModifiers in class AbstractTacticalSymbol
Parameters:
modifiers - List of modifiers. This method may modify this list by adding implicit modifiers.

assembleIconRetrieverParameters

protected AVList assembleIconRetrieverParameters(AVList params)
Overrides:
assembleIconRetrieverParameters in class AbstractTacticalSymbol

computeTransform

protected void computeTransform(DrawContext dc)
Overrides:
computeTransform in class AbstractTacticalSymbol

getIdentifier

public String getIdentifier()
Indicates a string identifier for this symbol. The format of the identifier depends on the symbol set to which this symbol belongs. For symbols belonging to the MIL-STD-2525 symbol set, this returns a 15-character alphanumeric symbol identification code (SIDC).

Returns:
an identifier for this symbol.

getMaxLabelLines

protected int getMaxLabelLines(AVList modifiers)
Overrides:
getMaxLabelLines in class AbstractTacticalSymbol

getModifierCode

protected String getModifierCode(AVList modifiers,
                                 String modifierKey)

getReinforcedReducedModifier

protected String getReinforcedReducedModifier(AVList modifiers,
                                              String modifierKey)

getStatus

public String getStatus()
Indicates the current value of symbol's Status/Operational Condition field.

Returns:
this symbol's Status/Operational Condition field.
See Also:
setStatus(String)

init

protected void init(String symbolId,
                    AVList modifiers)

initIconLayout

protected void initIconLayout()

isShowFill

public boolean isShowFill()
Indicates whether this symbol draws its fill. See setShowFill(boolean) for a description of how this property is used.

Returns:
true if this symbol draws its fill, otherwise false.

isShowFrame

public boolean isShowFrame()
Indicates whether this symbol draws its frame. See setShowFrame(boolean) for a description of how this property is used.

Returns:
true if this symbol draws its frame, otherwise false.

isShowIcon

public boolean isShowIcon()
Indicates whether this symbol draws its internal icon. See setShowIcon(boolean) for a description of how this property is used.

Returns:
true if this symbol draws its icon, otherwise false.

layoutDynamicModifiers

protected void layoutDynamicModifiers(DrawContext dc,
                                      AVList modifiers)
Description copied from class: AbstractTacticalSymbol
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.

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

layoutGraphicModifiers

protected void layoutGraphicModifiers(DrawContext dc,
                                      AVList modifiers)
Description copied from class: AbstractTacticalSymbol
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.

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

layoutTextModifiers

protected void layoutTextModifiers(DrawContext dc,
                                   AVList modifiers)
Description copied from class: AbstractTacticalSymbol
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.

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

mustUseAlternateOperationalCondition

protected boolean mustUseAlternateOperationalCondition(AVList modifiers)
Indicates whether or not the symbol should be displayed using the alternate Operational Condition indicator described in MIL-STD-2525C spec Table III-2, pg. 19. The alternate display is always used for symbols in the Emergency Management scheme (see MIL-STD-2525C // spec section G.5.5.14, pg. 1030). It is be used for other symbols if the SymbologyConstants.OPERATIONAL_CONDITION_ALTERNATE modifier is set.

Parameters:
modifiers - Symbol modifiers.
Returns:
True if the symbol must use the alternate operational condition indicator.

setShowFill

public void setShowFill(boolean showFill)
Specifies whether to draw this symbol's fill. The showFill property provides control over this tactical symbol's display option hierarchy as defined by MIL-STD-2525C, section 5.4.5 and table III.

When true, this symbol's fill is drawn. This state corresponds to MIL-STD-2525C, table III, row 1.

When false, this symbol's fill is not drawn. Instead, only the symbol's frame and internal icon are drawn. This state corresponds to MIL-STD-2525C, table III, row 2.

Parameters:
showFill - true to draw this symbol's fill, otherwise false.

setShowFrame

public void setShowFrame(boolean showFrame)
Specifies whether to draw this symbol's frame. The showFrame property provides control over this tactical symbol's display option hierarchy as defined by MIL-STD-2525C, section 5.4.5 and table III.

When true, this symbol's frame is drawn. This state corresponds to MIL-STD-2525C, table III, row 1.

When false, this symbol's frame is not drawn. Instead, only the symbol's internal icon is drawn. This state corresponds to MIL-STD-2525C, table III, row 4.

Parameters:
showFrame - true to draw this symbol's frame, otherwise false.

setShowIcon

public void setShowIcon(boolean showIcon)
Specifies whether to draw this symbol's internal icon. The showIcon property provides control over this tactical symbol's display option hierarchy as defined by MIL-STD-2525C, section 5.4.5 and table III.

When true, this symbol's icon is drawn. This state corresponds to MIL-STD-2525C, table III, row 1.

When false, this symbol's icon is not drawn. Instead, only the symbol's frame and fill are drawn. This state corresponds to MIL-STD-2525C, table III, row 5.

Parameters:
showIcon - true to draw this symbol's icon, otherwise false.

setStatus

public void setStatus(String value)
Specifies this symbol's Status/Operational Condition field. A symbol'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 symbol's Status can define its operational condition. The recognized values depend on the specific MIL-STD-2525 symbology scheme the symbol belongs to:

Warfighting, Signals Intelligence, Stability Operations

Tactical Graphics

Emergency Management

Parameters:
value - the new value for the Status/Operational Condition field.
Throws:
IllegalArgumentException - if the specified value is null or is not one of the accepted status values.

NASA World Wind