Class TacticalGraphicSymbol
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwind.symbology.AbstractTacticalSymbol
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.TacticalGraphicSymbol
-
- All Implemented Interfaces:
AVList
,Draggable
,MessageListener
,Movable
,Highlightable
,Renderable
,TacticalSymbol
,WWObject
,java.beans.PropertyChangeListener
,java.util.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 theTacticalGraphic
interface. (MilStd2525PointGraphic uses TacticalGraphicSymbol internally to render the point graphic.)- See Also:
MilStd2525PointGraphic
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description 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, AbstractTacticalSymbol.OrderedSymbol
-
Nested classes/interfaces inherited from interface gov.nasa.worldwind.symbology.TacticalSymbol
TacticalSymbol.LODSelector
-
-
Field Summary
Fields Modifier and Type Field Description 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 java.lang.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, dragEnabled, draggableSupport, enableBatchPicking, enableBatchRendering, formattedPosition, frameNumber, glyphAtlas, glyphMap, highlightAttrs, highlighted, iconOffset, iconRect, iconRetriever, iconSize, iconTexture, LAYOUT_ABSOLUTE, LAYOUT_NONE, LAYOUT_RELATIVE, LOADING_IMAGE_PATH, LODSelector, MAX_SYMBOL_DIMENSION, maxTimeSinceLastUsed, modifierRetriever, modifiers, normalAttrs, offset, pickLayer, pickSupport, position, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, staticLayoutRect, staticScreenRect, thisFramesOrderedSymbol, unitsFormat, unresolvedGlyph, visible
-
-
Constructor Summary
Constructors Constructor Description TacticalGraphicSymbol(java.lang.String sidc)
Constructs a new symbol with no position.TacticalGraphicSymbol(java.lang.String sidc, Position position)
Constructs a new symbol with the specified position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Iterable
addHyphenToDateRange(java.lang.Iterable value, java.util.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, AbstractTacticalSymbol.OrderedSymbol osym)
java.lang.String
getIdentifier()
Indicates a string identifier for this symbol.protected java.util.List<TacticalGraphicSymbol.LabelLayout>
getLayouts(java.lang.String sidc)
Indicates the label layouts designed to a particular graphic.protected int
getMaxLabelLines(AVList modifiers)
java.lang.String
getStatus()
Indicates the current value of graphic's Status/Operational Condition field.protected void
init(java.lang.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, AbstractTacticalSymbol.OrderedSymbol osym)
Layout dynamic modifiers around the symbol.protected void
layoutLabel(DrawContext dc, java.awt.Font font, TacticalGraphicSymbol.OffsetPair layout, java.lang.String value, java.lang.String mode, AbstractTacticalSymbol.OrderedSymbol osym)
protected void
layoutMultiLabel(DrawContext dc, java.awt.Font font, java.util.List<TacticalGraphicSymbol.OffsetPair> layouts, java.lang.Iterable values, java.lang.String mode, AbstractTacticalSymbol.OrderedSymbol osym)
protected void
layoutTextModifiers(DrawContext dc, AVList modifiers, AbstractTacticalSymbol.OrderedSymbol osym)
Layout text and graphic modifiers around the symbol.void
setStatus(java.lang.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, doDrag, doDrawOrderedRenderable, drag, draw, drawBatched, drawGlyphs, drawGraphicModifiers, drawIcon, drawLabels, drawLines, drawOrderedRenderable, drawTextModifiers, endDrawing, getActiveAttributes, getAltitudeMode, getAttributes, getDelegateOwner, getDepthOffset, getFormattedPosition, getGlyph, getGlyphAtlas, getHighlightAttributes, getIconRetriever, getLODSelector, getMaxSymbolDimension, getModifier, getModifierRetriever, getOffset, getPosition, getReferencePosition, getUnitsFormat, intersectsFrustum, isDragEnabled, 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, setDragEnabled, setEnableBatchPicking, setEnableBatchRendering, setGlyphAtlas, setHighlightAttributes, setHighlighted, setIconRetriever, setLODSelector, 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, 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.event.MessageListener
onMessage
-
-
-
-
Field Detail
-
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.
-
defaultLayouts
protected static DefaultLabelLayouts defaultLayouts
Object that provides the default label layouts for each point graphic.
-
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
-
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 toAbstractTacticalSymbol.setModifier(String, Object)
. Initiallynull
.
-
maskedSymbolCode
protected java.lang.String maskedSymbolCode
Symbol identifier with fields that do not influence the type of graphic replaced with hyphens. SeeSymbolCode.toMaskedString()
.
-
-
Constructor Detail
-
TacticalGraphicSymbol
public TacticalGraphicSymbol(java.lang.String sidc)
Constructs a new symbol with no position.- Parameters:
sidc
- Code that identifies the graphic.
-
TacticalGraphicSymbol
public TacticalGraphicSymbol(java.lang.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:
java.lang.IllegalArgumentException
- if the position isnull
.
-
-
Method Detail
-
getStatus
public java.lang.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)
-
setStatus
public void setStatus(java.lang.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
- STATUS_ANTICIPATED
- STATUS_SUSPECTED
- STATUS_PRESENT
- STATUS_KNOWN
Meteorological and Oceanographic
- Not supported
Emergency Management
- STATUS_ANTICIPATED
- STATUS_PRESENT
- Parameters:
value
- the new value for the Status/Operational Condition field.- Throws:
java.lang.IllegalArgumentException
- if the specified value isnull
or is not one of the accepted status values.
-
init
protected void init(java.lang.String sidc)
Initialize the new symbol.- Parameters:
sidc
- Code that identifies the graphic.
-
getIdentifier
public java.lang.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 classAbstractTacticalSymbol
-
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 classAbstractTacticalSymbol
- Parameters:
modifiers
- List of modifiers. This method may modify this list by adding implicit modifiers.
-
layoutTextModifiers
protected void layoutTextModifiers(DrawContext dc, AVList modifiers, AbstractTacticalSymbol.OrderedSymbol osym)
Layout text and graphic modifiers around the symbol.- Overrides:
layoutTextModifiers
in classAbstractTacticalSymbol
- Parameters:
dc
- Current draw context.modifiers
- Modifiers applied to this graphic.osym
- The OrderedSymbol to hold the per-frame data.- See Also:
AbstractTacticalSymbol.layoutDynamicModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList, gov.nasa.worldwind.symbology.AbstractTacticalSymbol.OrderedSymbol)
-
getLayouts
protected java.util.List<TacticalGraphicSymbol.LabelLayout> getLayouts(java.lang.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.
-
layoutDynamicModifiers
protected void layoutDynamicModifiers(DrawContext dc, AVList modifiers, AbstractTacticalSymbol.OrderedSymbol osym)
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 classAbstractTacticalSymbol
- Parameters:
dc
- Current draw context.modifiers
- Current modifiers.osym
- The OrderedSymbol to hold the per-frame data.- See Also:
AbstractTacticalSymbol.layoutStaticModifiers(gov.nasa.worldwind.render.DrawContext, gov.nasa.worldwind.avlist.AVList, gov.nasa.worldwind.symbology.AbstractTacticalSymbol.OrderedSymbol)
-
addHyphenToDateRange
protected java.lang.Iterable addHyphenToDateRange(java.lang.Iterable value, java.util.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.
-
layoutLabel
protected void layoutLabel(DrawContext dc, java.awt.Font font, TacticalGraphicSymbol.OffsetPair layout, java.lang.String value, java.lang.String mode, AbstractTacticalSymbol.OrderedSymbol osym)
-
layoutMultiLabel
protected void layoutMultiLabel(DrawContext dc, java.awt.Font font, java.util.List<TacticalGraphicSymbol.OffsetPair> layouts, java.lang.Iterable values, java.lang.String mode, AbstractTacticalSymbol.OrderedSymbol osym)
-
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.
-
computeTransform
protected void computeTransform(DrawContext dc, AbstractTacticalSymbol.OrderedSymbol osym)
- Overrides:
computeTransform
in classAbstractTacticalSymbol
-
-