NASA World Wind

gov.nasa.worldwind.symbology.milstd2525.graphics
Class TacticalGraphicSymbol

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.graphics.TacticalGraphicSymbol
All Implemented Interfaces:
AVList, MessageListener, Movable, Highlightable, OrderedRenderable, Renderable, TacticalSymbol, WWObject, PropertyChangeListener, EventListener

public class TacticalGraphicSymbol
extends AbstractTacticalSymbol

Implementation of TacticalSymbol to render point graphics defined by MIL-STD-2525C Appendix B (Tactical Graphics). This class implements the logic for rendering tactical point graphics, but actually implements the TacticalSymbol interface.

This class is not meant to be used directly by applications. Instead, apps should use MilStd2525PointGraphic, which implements the TacticalGraphic interface. (MilStd2525PointGraphic uses TacticalGraphicSymbol internally to render the point graphic.)

See Also:
MilStd2525PointGraphic

Nested Class Summary
static class TacticalGraphicSymbol.LabelLayout
           
static class TacticalGraphicSymbol.OffsetPair
           
 
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 Offset BELOW_BOTTOM_CENTER_OFFSET
           
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 DefaultLabelLayouts defaultLayouts
          Object that provides the default label layouts for each point graphic.
protected static DefaultOffsets defaultOffsets
          Object that provides the default offset for each point graphic.
protected  String maskedSymbolCode
          Symbol identifier with fields that do not influence the type of graphic replaced with hyphens.
protected  SymbolCode symbolCode
          Indicates a string identifier for this symbol.
 
Fields inherited from class gov.nasa.worldwind.symbology.AbstractTacticalSymbol
activeAttrs, activeIconTexture, activeModifiers, altitudeMode, BEogsh, currentGlyphs, currentLabels, currentLines, DEFAULT_DEPTH_OFFSET, DEFAULT_GLYPH_ATLAS, DEFAULT_MAX_TIME_SINCE_LAST_USED, DEFAULT_UNITS_FORMAT, 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
TacticalGraphicSymbol(String sidc)
          Constructs a new symbol with no position.
TacticalGraphicSymbol(String sidc, Position position)
          Constructs a new symbol with the specified position.
 
Method Summary
protected  Iterable addHyphenToDateRange(Iterable value, List<TacticalGraphicSymbol.OffsetPair> offsets)
          Add a hyphen to the first element in a list of dates to indicate a date range.
protected  void applyImplicitModifiers(AVList modifiers)
          Add implicit modifiers to the modifier list.
protected  void computeTransform(DrawContext dc)
           
 String getIdentifier()
          Indicates a string identifier for this symbol.
protected  List<TacticalGraphicSymbol.LabelLayout> getLayouts(String sidc)
          Indicates the label layouts designed to a particular graphic.
protected  int getMaxLabelLines(AVList modifiers)
           
 String getStatus()
          Indicates the current value of graphic's Status/Operational Condition field.
protected  void init(String sidc)
          Initialize the new symbol.
protected  boolean isShowDirectionOfMovement()
          Indicates whether or not this graphic supports the direction of movement indicator.
protected  void layoutDynamicModifiers(DrawContext dc, AVList modifiers)
          Layout dynamic modifiers around the symbol.
protected  void layoutLabel(DrawContext dc, Font font, TacticalGraphicSymbol.OffsetPair layout, String value, String mode)
           
protected  void layoutMultiLabel(DrawContext dc, Font font, List<TacticalGraphicSymbol.OffsetPair> layouts, Iterable values, String mode)
           
protected  void layoutTextModifiers(DrawContext dc, AVList modifiers)
          Layout text and graphic modifiers around the symbol.
 void setStatus(String value)
          Specifies this graphic's Status/Operational Condition field.
 
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalSymbol
addGlyph, addGlyph, addLabel, addLabel, addLine, addLine, assembleIconRetrieverParameters, 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, layoutGraphicModifiers, 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

BELOW_BOTTOM_CENTER_OFFSET

protected static final Offset BELOW_BOTTOM_CENTER_OFFSET

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

defaultLayouts

protected static DefaultLabelLayouts defaultLayouts
Object that provides the default label layouts for each point graphic.


defaultOffsets

protected static DefaultOffsets defaultOffsets
Object that provides the default offset for each point graphic. Most graphics are centered on their position, but some require a different offset.


maskedSymbolCode

protected String maskedSymbolCode
Symbol identifier with fields that do not influence the type of graphic replaced with hyphens. See SymbolCode.toMaskedString().


symbolCode

protected SymbolCode symbolCode
Indicates a string identifier for this symbol. The format of the identifier depends on the symbol set to which this graphic 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.

Constructor Detail

TacticalGraphicSymbol

public TacticalGraphicSymbol(String sidc)
Constructs a new symbol with no position.

Parameters:
sidc - Code that identifies the graphic.

TacticalGraphicSymbol

public TacticalGraphicSymbol(String sidc,
                             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:
sidc - Code that identifies the graphic.
position - The latitude, longitude, and altitude where the symbol is drawn.
Throws:
IllegalArgumentException - if the position is null.
Method Detail

addHyphenToDateRange

protected Iterable addHyphenToDateRange(Iterable value,
                                        List<TacticalGraphicSymbol.OffsetPair> offsets)
Add a hyphen to the first element in a list of dates to indicate a date range. This method only modifiers the date list if exactly two dates are displayed in the graphic.

Parameters:
value - Iterable of date modifiers.
offsets - Layouts for the date modifiers.
Returns:
Iterable of modified dates. This may be a new, modified list, or the same list as value if no modification was required.

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.

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.

getLayouts

protected List<TacticalGraphicSymbol.LabelLayout> getLayouts(String sidc)
Indicates the label layouts designed to a particular graphic.

Parameters:
sidc - Symbol ID to for which to determine layout.
Returns:
List of label layouts for the specified symbol.

getMaxLabelLines

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

getStatus

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

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

init

protected void init(String sidc)
Initialize the new symbol.

Parameters:
sidc - Code that identifies the graphic.

isShowDirectionOfMovement

protected boolean isShowDirectionOfMovement()
Indicates whether or not this graphic supports the direction of movement indicator. Only chemical, biological, radiological, and nuclear point graphics support this modifier (see MIL-STD-2525C, table XI, pg. 38).

Returns:
True if the graphic is chemical, biological, radiological, or nuclear.

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)

layoutLabel

protected void layoutLabel(DrawContext dc,
                           Font font,
                           TacticalGraphicSymbol.OffsetPair layout,
                           String value,
                           String mode)

layoutMultiLabel

protected void layoutMultiLabel(DrawContext dc,
                                Font font,
                                List<TacticalGraphicSymbol.OffsetPair> layouts,
                                Iterable values,
                                String mode)

layoutTextModifiers

protected void layoutTextModifiers(DrawContext dc,
                                   AVList modifiers)
Layout text and graphic modifiers around the symbol.

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

setStatus

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

Tactical graphics

Meteorological and Oceanographic

Emergency Management

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