NASA World Wind

gov.nasa.worldwind.symbology.milstd2525
Class MilStd2525PointGraphic

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.symbology.milstd2525.MilStd2525PointGraphic
All Implemented Interfaces:
AVList, Movable, Highlightable, Renderable, MilStd2525TacticalGraphic, TacticalGraphic, TacticalPoint

public class MilStd2525PointGraphic
extends AVListImpl
implements MilStd2525TacticalGraphic, TacticalPoint

Implementation of MIL-STD-2525 point graphics. Point graphics are rendered in the same way as tactical symbols: by drawing an icon at constant screen size.


Field Summary
protected  TacticalSymbolAttributes activeSymbolAttributes
          Attributes to use for the current frame.
protected static TacticalSymbolAttributes defaultSymbolAttributes
           
protected  long frameTimestamp
          Current frame timestamp.
protected  TacticalGraphicAttributes highlightAttributes
          Attributes to apply when the graphic is highlighted.
protected  boolean highlighted
          Indicates whether or not the graphic is highlighted.
protected  TacticalGraphicAttributes normalAttributes
          Attributes to apply when the graphic is not highlighted.
protected  TacticalGraphicSymbol symbol
          Symbol used to render this graphic.
 
Constructor Summary
MilStd2525PointGraphic(String sidc)
          Create a new point graphic.
 
Method Summary
protected  void applyAttributesToSymbol(TacticalGraphicAttributes graphicAttributes, TacticalSymbolAttributes symbolAttributes)
          Apply graphic attributes to the symbol.
protected  TacticalGraphicSymbol createSymbol(String sidc)
          Create a tactical symbol to render this graphic.
protected  void determineActiveAttributes()
          Determine active attributes for this frame.
 int getAltitudeMode()
          Indicates this symbol's altitude mode.
 TacticalGraphicAttributes getAttributes()
          Indicates this graphic's attributes when it is in the normal (as opposed to highlighted) state.
 Object getDelegateOwner()
          Returns the delegate owner of the graphic.
static List<String> getEmsGraphics()
           
 TacticalGraphicAttributes getHighlightAttributes()
          Indicate this graphic's attributes when it is in the highlighted state.
 String getIdentifier()
          Indicates a string identifier for this graphic.
 Offset getLabelOffset()
          Indicates an offset used to position the graphic's main label relative to the label's geographic position.
static List<String> getMetocGraphics()
           
 Object getModifier(String modifier)
          Indicates the current value of a text or graphic modifier.
 Offset getOffset()
          Indicates a location within the symbol to align with the symbol point.
 Position getPosition()
          Indicates the position of the graphic.
 Iterable<? extends Position> getPositions()
          Indicates the positions of the control points that place and orient the graphic.
 Position getReferencePosition()
          A position associated with the object that indicates its aggregate geographic position.
 String getStatus()
          Indicates the current value of graphic's Status/Operational Condition field.
static List<String> getSupportedGraphics()
          Indicates the graphics supported by this class.
static List<String> getTacGrpGraphics()
          Indicates the graphics in MIL-STD-2525C Appendix B supported by this class.
 String getText()
          Convenience method to access the text modifier of the graphic.
 UnitsFormat getUnitsFormat()
          Indicates the unit format used to format values in text modifiers.
 boolean isHighlighted()
          Indicates whether to highlight the shape.
 boolean isShowGraphicModifiers()
          Indicates whether this graphic draws its supplemental graphic modifiers.
 boolean isShowHostileIndicator()
          Indicates whether or not this graphic will display a text indicator when the graphic represents a hostile entity.
 boolean isShowLocation()
          Indicates whether or not the graphic should display its location as a text modifier.
 boolean isShowTextModifiers()
          Indicates whether this graphic draws its supplemental text modifiers.
 boolean isVisible()
          Indicates whether this graphic is drawn when in view.
 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.
 void render(DrawContext dc)
          Causes this Renderable to render itself using the provided draw context.
 void setAltitudeMode(int altitudeMode)
          Specifies this graphic's altitude mode.
 void setAttributes(TacticalGraphicAttributes attributes)
          Specifies attributes for this graphic in the normal (as opposed to highlighted) state.
 void setDelegateOwner(Object owner)
          Specifies the delegate owner of the graphic.
 void setHighlightAttributes(TacticalGraphicAttributes attributes)
          Specifies attributes for this graphic in the highlighted state.
 void setHighlighted(boolean highlighted)
          Specifies whether to highlight the shape.
 void setLabelOffset(Offset offset)
          Specifies an offset used to position this graphic's main label relative to the label's geographic position.
 void setModifier(String modifier, Object value)
          Specifies the value of a text or graphic modifier.
 void setOffset(Offset offset)
          Specifies a location within the tactical symbol to align with the symbol point.
 void setPosition(Position position)
          Specifies the position of the graphic.
 void setPositions(Iterable<? extends Position> positions)
          Specifies the positions of the control points that place and orient the graphic.
 void setShowGraphicModifiers(boolean showModifiers)
          Specifies whether to draw this graphic's supplemental graphic modifiers.
 void setShowHostileIndicator(boolean show)
          Specifies whether or not to display a text indicator when the symbol or graphic represents a hostile entity.
 void setShowLocation(boolean show)
          Specifies whether or not the graphic should display its location as a text modifier.
 void setShowTextModifiers(boolean showModifiers)
          Specifies whether to draw this graphic's supplemental text modifiers.
 void setStatus(String value)
          Specifies this graphic's Status/Operational Condition field.
 void setText(String text)
          Convenience method to specify a text modifier for the graphic.
 void setUnitsFormat(UnitsFormat unitsFormat)
          Specifies the unit format used to format values in text modifiers.
 void setVisible(boolean visible)
          Specifies whether this graphic is drawn when in view.
 
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
 

Field Detail

activeSymbolAttributes

protected TacticalSymbolAttributes activeSymbolAttributes
Attributes to use for the current frame.


defaultSymbolAttributes

protected static TacticalSymbolAttributes defaultSymbolAttributes

frameTimestamp

protected long frameTimestamp
Current frame timestamp.


highlightAttributes

protected TacticalGraphicAttributes highlightAttributes
Attributes to apply when the graphic is highlighted. These attributes override defaults determined by the graphic's symbol code.


highlighted

protected boolean highlighted
Indicates whether or not the graphic is highlighted.


normalAttributes

protected TacticalGraphicAttributes normalAttributes
Attributes to apply when the graphic is not highlighted. These attributes override defaults determined by the graphic's symbol code.


symbol

protected TacticalGraphicSymbol symbol
Symbol used to render this graphic.

Constructor Detail

MilStd2525PointGraphic

public MilStd2525PointGraphic(String sidc)
Create a new point graphic.

Parameters:
sidc - MIL-STD-2525 SIDC code that identifies the graphic.
Method Detail

applyAttributesToSymbol

protected void applyAttributesToSymbol(TacticalGraphicAttributes graphicAttributes,
                                       TacticalSymbolAttributes symbolAttributes)
Apply graphic attributes to the symbol.

Parameters:
graphicAttributes - Tactical graphic attributes to apply to the tactical symbol.
symbolAttributes - Symbol attributes to be modified.

createSymbol

protected TacticalGraphicSymbol createSymbol(String sidc)
Create a tactical symbol to render this graphic.

Parameters:
sidc - Symbol code that identifies the graphic.
Returns:
A new tactical symbol.

determineActiveAttributes

protected void determineActiveAttributes()
Determine active attributes for this frame.


getAltitudeMode

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

Returns:
this symbol's altitude mode.

getAttributes

public TacticalGraphicAttributes getAttributes()
Indicates this graphic's attributes when it is in the normal (as opposed to highlighted) state.

Specified by:
getAttributes in interface TacticalGraphic
Returns:
this graphic's attributes. May be null.

getDelegateOwner

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

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

getEmsGraphics

public static List<String> getEmsGraphics()

getHighlightAttributes

public TacticalGraphicAttributes getHighlightAttributes()
Indicate this graphic's attributes when it is in the highlighted state.

Specified by:
getHighlightAttributes in interface TacticalGraphic
Returns:
this graphic's highlight attributes. May be null.

getIdentifier

public String getIdentifier()
Indicates a string identifier for this graphic. The format of the identifier depends on the symbol set to which the graphic belongs.

Specified by:
getIdentifier in interface TacticalGraphic
Returns:
An identifier for this graphic.

getLabelOffset

public Offset getLabelOffset()
Indicates an offset used to position the graphic's main label relative to the label's geographic position. See comments on setLabelOffset for more information.

Specified by:
getLabelOffset in interface TacticalGraphic
Returns:
The offset that determines how the graphic's label is placed relative to the graphic.

getMetocGraphics

public static List<String> getMetocGraphics()

getModifier

public Object getModifier(String modifier)
Indicates the current value of a text or graphic modifier.

Specified by:
getModifier in interface TacticalGraphic
Parameters:
modifier - Key that identifies the modifier to retrieve. The possible modifiers depends on the symbol set.
Returns:
The value of the modifier, or null if the modifier is not set.

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 the position of the graphic.

Specified by:
getPosition in interface TacticalPoint
Returns:
The position of the graphic.

getPositions

public Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.

Specified by:
getPositions in interface TacticalGraphic
Returns:
Always returns an Iterable with only one 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.

getStatus

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

Specified by:
getStatus in interface MilStd2525TacticalGraphic
Returns:
this graphic's Status/Operational Condition field.
See Also:
MilStd2525TacticalGraphic.setStatus(String)

getSupportedGraphics

public static List<String> getSupportedGraphics()
Indicates the graphics supported by this class.

Returns:
List of masked SIDC strings that identify graphics that this class supports.

getTacGrpGraphics

public static List<String> getTacGrpGraphics()
Indicates the graphics in MIL-STD-2525C Appendix B supported by this class.

Returns:
List of masked SIDC strings that identify graphics that this class supports.

getText

public String getText()
Convenience method to access the text modifier of the graphic. Calling this method is equivalent to calling getModifier(SymbologyConstants.UNIQUE_DESIGNATION).

Specified by:
getText in interface TacticalGraphic
Returns:
Descriptive text for this graphic.
See Also:
TacticalGraphic.getModifier(String)

getUnitsFormat

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

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

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 graphic draws its supplemental graphic modifiers.

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

isShowHostileIndicator

public boolean isShowHostileIndicator()
Indicates whether or not this graphic will display a text indicator when the graphic represents a hostile entity. See comments on setShowHostileIndicator for more information.

Specified by:
isShowHostileIndicator in interface TacticalGraphic
Returns:
true if an indicator may be drawn when this graphic represents a hostile entity, if supported by the graphic implementation. Note that some graphics may not display an indicator, even when representing a hostile entity.

isShowLocation

public boolean isShowLocation()
Indicates whether or not the graphic should display its location as a text modifier. Not all graphics support the location modifier.

Specified by:
isShowLocation in interface TacticalGraphic
Returns:
true if the graphic will display the location modifier. Note that not all graphics support this modifier.

isShowTextModifiers

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

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

isVisible

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

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

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.

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

setAltitudeMode

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

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

Parameters:
altitudeMode - this symbol's new altitude mode.

setAttributes

public void setAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the normal (as opposed to highlighted) state. If any fields in the attribute bundle are null, the default attribute will be used instead. For example, if the attribute bundle includes a setting for outline material but not for interior material the new outline material will override the default outline material, but the interior material will remain the default. The default attributes are determined by the symbol set, and may differ depending on the type of graphic.

Specified by:
setAttributes in interface TacticalGraphic
Parameters:
attributes - new attributes. May be null, in which case default attributes are used.

setDelegateOwner

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

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

setHighlightAttributes

public void setHighlightAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the highlighted state. See comments on setAttributes for more information on how the attributes are interpreted.

Specified by:
setHighlightAttributes in interface TacticalGraphic
Parameters:
attributes - Attributes to apply to the graphic when it is highlighted. May be null, in which default 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.

setLabelOffset

public void setLabelOffset(Offset offset)
Specifies an offset used to position this graphic's main label relative to the label's geographic position. The geographic position is determined by the type of graphic. For example, the label for an area graphic is typically placed at the center of the area polygon. Note that not all graphics have labels.

The offset can specify an absolute pixel value, or a an offset relative to the size of the label. For example, an offset of (-0.5, -0.5) in fraction units will center the label on its geographic position both horizontally and vertically.

Specified by:
setLabelOffset in interface TacticalGraphic
Parameters:
offset - The offset that determines how the graphic's label is placed relative to the graphic.

setModifier

public void setModifier(String modifier,
                        Object value)
Specifies the value of a text or graphic modifier.

Specified by:
setModifier in interface TacticalGraphic
Parameters:
modifier - Key that identifies the modifier to set. The possible modifiers depends on the symbol set.
value - New value for the modifier.

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 the position of the graphic.

Specified by:
setPosition in interface TacticalPoint
Parameters:
position - New position.

setPositions

public void setPositions(Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.

Specified by:
setPositions in interface TacticalGraphic
Parameters:
positions - Control points. This graphic uses only one control point.

setShowGraphicModifiers

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

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

setShowHostileIndicator

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

Specified by:
setShowHostileIndicator in interface TacticalGraphic
Parameters:
show - true if this graphic should display an indicator when this graphic represents a hostile entity and the graphic implementation supports such an indicator. Note that some graphics may not display an indicator, even when representing a hostile entity.

setShowLocation

public void setShowLocation(boolean show)
Specifies whether or not the graphic should display its location as a text modifier. Not all graphics support the location modifier. Setting showLocation on a graphic that does not support the modifier will have no effect.

Specified by:
setShowLocation in interface TacticalGraphic
Parameters:
show - true if the graphic will display the location modifier. Note that not all graphics support this modifier.

setShowTextModifiers

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

Specified by:
setShowTextModifiers in interface TacticalGraphic
Parameters:
showModifiers - true if this graphic should draw its text modifiers, otherwise false.

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

Specified by:
setStatus in interface MilStd2525TacticalGraphic
Parameters:
value - the new value for the Status/Operational Condition field.

setText

public void setText(String text)
Convenience method to specify a text modifier for the graphic. Calling this method is equivalent to calling setModifier(SymbologyConstants.UNIQUE_DESIGNATION, text).

Specified by:
setText in interface TacticalGraphic
Parameters:
text - New text modifier. May be null.
See Also:
TacticalGraphic.setModifier(String, Object)

setUnitsFormat

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

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

setVisible

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

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

NASA World Wind