Class MilStd2525PointGraphic
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.milstd2525.MilStd2525PointGraphic
-
- All Implemented Interfaces:
AVList
,Draggable
,Movable
,Highlightable
,Renderable
,MilStd2525TacticalGraphic
,TacticalGraphic
,TacticalPoint
public class MilStd2525PointGraphic extends AVListImpl implements MilStd2525TacticalGraphic, TacticalPoint, Draggable
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
Fields Modifier and Type Field Description protected TacticalSymbolAttributes
activeSymbolAttributes
Attributes to use for the current frame.protected static TacticalSymbolAttributes
defaultSymbolAttributes
protected boolean
dragEnabled
Indicates whether the object is draggable and provides additional information for dragging about this object.protected DraggableSupport
draggableSupport
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
Constructors Constructor Description MilStd2525PointGraphic(java.lang.String sidc)
Create a new point graphic.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
applyAttributesToSymbol(TacticalGraphicAttributes graphicAttributes, TacticalSymbolAttributes symbolAttributes)
Apply graphic attributes to the symbol.protected TacticalGraphicSymbol
createSymbol(java.lang.String sidc)
Create a tactical symbol to render this graphic.protected void
determineActiveAttributes()
Determine active attributes for this frame.protected void
doDrag(DragContext dragContext)
void
drag(DragContext dragContext)
Drag the object given the providedDragContext
.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.java.lang.Object
getDelegateOwner()
Returns the delegate owner of the graphic.static java.util.List<java.lang.String>
getEmsGraphics()
TacticalGraphicAttributes
getHighlightAttributes()
Indicate this graphic's attributes when it is in the highlighted state.java.lang.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 java.util.List<java.lang.String>
getMetocGraphics()
java.lang.Object
getModifier(java.lang.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.java.lang.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.java.lang.String
getStatus()
Indicates the current value of graphic's Status/Operational Condition field.static java.util.List<java.lang.String>
getSupportedGraphics()
Indicates the graphics supported by this class.static java.util.List<java.lang.String>
getTacGrpGraphics()
Indicates the graphics in MIL-STD-2525C Appendix B supported by this class.java.lang.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
isDragEnabled()
Indicates whether the object is enabled for dragging.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 thisRenderable
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(java.lang.Object owner)
Specifies the delegate owner of the graphic.void
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.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(java.lang.String modifier, java.lang.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(java.lang.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(java.lang.String value)
Specifies this graphic's Status/Operational Condition field.void
setText(java.lang.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, 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
-
symbol
protected TacticalGraphicSymbol symbol
Symbol used to render this graphic.
-
highlighted
protected boolean highlighted
Indicates whether or not the graphic is highlighted.
-
dragEnabled
protected boolean dragEnabled
Indicates whether the object is draggable and provides additional information for dragging about this object.
-
draggableSupport
protected DraggableSupport draggableSupport
-
normalAttributes
protected TacticalGraphicAttributes normalAttributes
Attributes to apply when the graphic is not highlighted. These attributes override defaults determined by the graphic's symbol code.
-
highlightAttributes
protected TacticalGraphicAttributes highlightAttributes
Attributes to apply when the graphic is highlighted. These attributes override defaults determined by the graphic's symbol code.
-
frameTimestamp
protected long frameTimestamp
Current frame timestamp.
-
activeSymbolAttributes
protected TacticalSymbolAttributes activeSymbolAttributes
Attributes to use for the current frame.
-
defaultSymbolAttributes
protected static TacticalSymbolAttributes defaultSymbolAttributes
-
-
Method Detail
-
createSymbol
protected TacticalGraphicSymbol createSymbol(java.lang.String sidc)
Create a tactical symbol to render this graphic.- Parameters:
sidc
- Symbol code that identifies the graphic.- Returns:
- A new tactical symbol.
-
isVisible
public boolean isVisible()
Indicates whether this graphic is drawn when in view.- Specified by:
isVisible
in interfaceTacticalGraphic
- Returns:
- true if this graphic is drawn when in view, otherwise false.
-
setVisible
public void setVisible(boolean visible)
Specifies whether this graphic is drawn when in view.- Specified by:
setVisible
in interfaceTacticalGraphic
- Parameters:
visible
- true if this graphic should be drawn when in view, otherwise false.
-
getModifier
public java.lang.Object getModifier(java.lang.String modifier)
Indicates the current value of a text or graphic modifier.- Specified by:
getModifier
in interfaceTacticalGraphic
- 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.
-
setModifier
public void setModifier(java.lang.String modifier, java.lang.Object value)
Specifies the value of a text or graphic modifier.- Specified by:
setModifier
in interfaceTacticalGraphic
- Parameters:
modifier
- Key that identifies the modifier to set. The possible modifiers depends on the symbol set.value
- New value for the modifier.
-
isShowTextModifiers
public boolean isShowTextModifiers()
Indicates whether this graphic draws its supplemental text modifiers.- Specified by:
isShowTextModifiers
in interfaceTacticalGraphic
- Returns:
- true if this graphic draws its text modifiers, otherwise false.
-
setShowTextModifiers
public void setShowTextModifiers(boolean showModifiers)
Specifies whether to draw this graphic's supplemental text modifiers.- Specified by:
setShowTextModifiers
in interfaceTacticalGraphic
- Parameters:
showModifiers
- true if this graphic should draw its text modifiers, otherwise false.
-
isShowGraphicModifiers
public boolean isShowGraphicModifiers()
Indicates whether this graphic draws its supplemental graphic modifiers.- Specified by:
isShowGraphicModifiers
in interfaceTacticalGraphic
- Returns:
- true if this graphic draws its graphic modifiers, otherwise false.
-
setShowGraphicModifiers
public void setShowGraphicModifiers(boolean showModifiers)
Specifies whether to draw this graphic's supplemental graphic modifiers.- Specified by:
setShowGraphicModifiers
in interfaceTacticalGraphic
- Parameters:
showModifiers
- true if this graphic should draw its graphic modifiers, otherwise false.
-
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 interfaceTacticalGraphic
- Returns:
- true if the graphic will display the location modifier. Note that not all graphics support this modifier.
-
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 interfaceTacticalGraphic
- Parameters:
show
- true if the graphic will display the location modifier. Note that not all graphics support this modifier.
-
isShowHostileIndicator
public boolean isShowHostileIndicator()
Indicates whether or not this graphic will display a text indicator when the graphic represents a hostile entity. See comments onsetShowHostileIndicator
for more information.- Specified by:
isShowHostileIndicator
in interfaceTacticalGraphic
- 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.
-
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 interfaceTacticalGraphic
- 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.
-
getIdentifier
public java.lang.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 interfaceTacticalGraphic
- Returns:
- An identifier for this graphic.
-
setText
public void setText(java.lang.String text)
Convenience method to specify a text modifier for the graphic. Calling this method is equivalent to callingsetModifier(SymbologyConstants.UNIQUE_DESIGNATION, text)
.- Specified by:
setText
in interfaceTacticalGraphic
- Parameters:
text
- New text modifier. May be null.- See Also:
TacticalGraphic.setModifier(String, Object)
-
getText
public java.lang.String getText()
Convenience method to access the text modifier of the graphic. Calling this method is equivalent to callinggetModifier(SymbologyConstants.UNIQUE_DESIGNATION)
.- Specified by:
getText
in interfaceTacticalGraphic
- Returns:
- Descriptive text for this graphic.
- See Also:
TacticalGraphic.getModifier(String)
-
getPositions
public java.lang.Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.- Specified by:
getPositions
in interfaceTacticalGraphic
- Returns:
- Always returns an Iterable with only one position.
-
setPositions
public void setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.- Specified by:
setPositions
in interfaceTacticalGraphic
- Parameters:
positions
- Control points. This graphic uses only one control point.
-
getAttributes
public TacticalGraphicAttributes getAttributes()
Indicates this graphic's attributes when it is in the normal (as opposed to highlighted) state.- Specified by:
getAttributes
in interfaceTacticalGraphic
- Returns:
- this graphic's attributes. May be null.
-
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 interfaceTacticalGraphic
- Parameters:
attributes
- new attributes. May be null, in which case default attributes are used.
-
getHighlightAttributes
public TacticalGraphicAttributes getHighlightAttributes()
Indicate this graphic's attributes when it is in the highlighted state.- Specified by:
getHighlightAttributes
in interfaceTacticalGraphic
- Returns:
- this graphic's highlight attributes. May be null.
-
setHighlightAttributes
public void setHighlightAttributes(TacticalGraphicAttributes attributes)
Specifies attributes for this graphic in the highlighted state. See comments onsetAttributes
for more information on how the attributes are interpreted.- Specified by:
setHighlightAttributes
in interfaceTacticalGraphic
- Parameters:
attributes
- Attributes to apply to the graphic when it is highlighted. May be null, in which default attributes are used.
-
getLabelOffset
public Offset getLabelOffset()
Indicates an offset used to position the graphic's main label relative to the label's geographic position. See comments onsetLabelOffset
for more information.- Specified by:
getLabelOffset
in interfaceTacticalGraphic
- Returns:
- The offset that determines how the graphic's label is placed relative to the graphic.
-
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 interfaceTacticalGraphic
- Parameters:
offset
- The offset that determines how the graphic's label is placed relative to the graphic.
-
getOffset
public Offset getOffset()
Indicates a location within the symbol to align with the symbol point. SeesetOffset
for more information.- Returns:
- the hot spot controlling the symbol's placement relative to the symbol point. null indicates default alignment.
-
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, andsetOffset(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.
-
getDelegateOwner
public java.lang.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 interfaceTacticalGraphic
- Returns:
- the object used as the pickable object returned during picking, or null to indicate the the graphic is returned during picking.
-
setDelegateOwner
public void setDelegateOwner(java.lang.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 interfaceTacticalGraphic
- Parameters:
owner
- the object to use as the pickable object returned during picking, or null to return the graphic.
-
getUnitsFormat
public UnitsFormat getUnitsFormat()
Indicates the unit format used to format values in text modifiers.- Specified by:
getUnitsFormat
in interfaceTacticalGraphic
- Returns:
- Units format used to format text modifiers.
-
setUnitsFormat
public void setUnitsFormat(UnitsFormat unitsFormat)
Specifies the unit format used to format values in text modifiers.- Specified by:
setUnitsFormat
in interfaceTacticalGraphic
- Parameters:
unitsFormat
- Format used to format text modifiers.
-
getPosition
public Position getPosition()
Indicates the position of the graphic.- Specified by:
getPosition
in interfaceTacticalPoint
- Returns:
- The position of the graphic.
-
setPosition
public void setPosition(Position position)
Specifies the position of the graphic.- Specified by:
setPosition
in interfaceTacticalPoint
- Parameters:
position
- New position.
-
getAltitudeMode
public int getAltitudeMode()
Indicates this symbol's altitude mode. SeesetAltitudeMode(int)
for a description of the valid altitude modes.- Returns:
- this symbol's altitude mode.
-
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:- WorldWind.CLAMP_TO_GROUND -- this graphic is placed on the terrain at the latitude and longitude of its position.
- WorldWind.RELATIVE_TO_GROUND -- this graphic is placed above the terrain at the latitude and longitude of its position and the distance specified by its elevation.
- WorldWind.ABSOLUTE -- this graphic is placed at its specified position.
This graphic assumes the altitude mode WorldWind.ABSOLUTE if the specified mode is not recognized.
- Parameters:
altitudeMode
- this symbol's new altitude mode.
-
getStatus
public java.lang.String getStatus()
Indicates the current value of graphic's Status/Operational Condition field.- Specified by:
getStatus
in interfaceMilStd2525TacticalGraphic
- Returns:
- this graphic's Status/Operational Condition field.
- See Also:
MilStd2525TacticalGraphic.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
- Specified by:
setStatus
in interfaceMilStd2525TacticalGraphic
- Parameters:
value
- the new value for the Status/Operational Condition field.
-
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 interfaceMovable
- Returns:
- the object's reference position, or null if no reference position is available.
-
move
public void move(Position delta)
Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
-
moveTo
public void moveTo(Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
-
isDragEnabled
public boolean isDragEnabled()
Description copied from interface:Draggable
Indicates whether the object is enabled for dragging.- Specified by:
isDragEnabled
in interfaceDraggable
- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:Draggable
Controls whether the object is enabled for dragging.- Specified by:
setDragEnabled
in interfaceDraggable
- Parameters:
enabled
-true
if the object is enabled, elsefalse
.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:Draggable
Drag the object given the providedDragContext
.- Specified by:
drag
in interfaceDraggable
- Parameters:
dragContext
- theDragContext
of this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
isHighlighted
public boolean isHighlighted()
Indicates whether to highlight the shape.- Specified by:
isHighlighted
in interfaceHighlightable
- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.- Specified by:
setHighlighted
in interfaceHighlightable
- Parameters:
highlighted
- true to highlight the shape, otherwise false.
-
render
public void render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.- Specified by:
render
in interfaceRenderable
- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
determineActiveAttributes
protected void determineActiveAttributes()
Determine active attributes for this frame.
-
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.
-
getSupportedGraphics
public static java.util.List<java.lang.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 java.util.List<java.lang.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.
-
getMetocGraphics
public static java.util.List<java.lang.String> getMetocGraphics()
-
getEmsGraphics
public static java.util.List<java.lang.String> getEmsGraphics()
-
-