Package gov.nasa.worldwind.symbology
Class AbstractTacticalGraphic
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.AbstractTacticalGraphic
-
- All Implemented Interfaces:
AVList
,Draggable
,Movable
,Highlightable
,Renderable
,TacticalGraphic
- Direct Known Subclasses:
AbstractMilStd2525TacticalGraphic
public abstract class AbstractTacticalGraphic extends AVListImpl implements TacticalGraphic, Renderable, Draggable
Base class for tactical graphics. See the TacticalGraphic Tutorial for instructions on using TacticalGraphic in an application. This base class provides functionality for creating and rendering a graphic that is made up of one or more shapes, and text labels.Implementations must implement at least
doRenderGraphic
andapplyDelegateOwner(Object)
.
-
-
Field Summary
Fields Modifier and Type Field Description protected TacticalGraphicAttributes
activeOverrides
Override attributes for the current frame.protected ShapeAttributes
activeShapeAttributes
Shape attributes shared by all shapes that make up this graphic.protected static Material
DEFAULT_HIGHLIGHT_MATERIAL
The default highlight color.protected static double
DEFAULT_LABEL_INTERIOR_OPACITY
Opacity of label interiors.protected java.lang.Object
delegateOwner
Object returned during picking to represent this graphic.protected boolean
dragEnabled
Indicates whether this object can be dragged.protected DraggableSupport
draggableSupport
Provides additional information for dragging regarding this particular object.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 Offset
labelOffset
Offset applied to the graphic's main label.protected java.util.List<TacticalGraphicLabel>
labels
Labels to render with the graphic.protected AVList
modifiers
Map of modifiers applied to this graphic.protected boolean
mustCreateLabels
Flag to indicate that labels must be recreated before the graphic is rendered.protected TacticalGraphicAttributes
normalAttributes
Attributes to apply when the graphic is not highlighted.protected boolean
showGraphicModifiers
Indicates whether or not to render graphic modifiers.protected boolean
showHostileIndicator
Indicates whether or not to render the hostile/enemy modifier.protected boolean
showLocation
Indicates whether or not to render the location modifier.protected boolean
showTextModifiers
Indicates whether or not to render text modifiers.protected java.lang.String
text
The graphic's text string.protected UnitsFormat
unitsFormat
Unit format used to format location and altitude for text modifiers.protected boolean
visible
Indicates whether or not to render the graphic.
-
Constructor Summary
Constructors Constructor Description AbstractTacticalGraphic()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected TacticalGraphicLabel
addLabel(java.lang.String text)
protected void
applyDefaultAttributes(ShapeAttributes attributes)
Apply defaults to the active attributes bundle.protected abstract void
applyDelegateOwner(java.lang.Object owner)
Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic.protected void
applyLabelAttributes()
Apply the active attributes to the graphic's labels.protected void
applyOverrideAttributes(TacticalGraphicAttributes graphicAttributes, ShapeAttributes shapeAttributes)
Apply override attributes specified in a TacticalGraphicAttributes bundle to the active ShapeAttributes.protected void
computeGeometry(DrawContext dc)
protected double
computeLabelInteriorOpacity(double textOpacity)
Compute the opacity for the label interior.protected void
createLabels()
protected void
determineActiveAttributes()
Determine active attributes for this frame.protected void
determineDelegateOwner()
Determine the delegate owner for the current frame, and apply the owner to all renderable objects used to draw the graphic.protected void
determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.protected void
determinePerFrameAttributes(DrawContext dc)
Determine geometry and attributes for this frame.protected void
doDrag(DragContext dragContext)
protected abstract void
doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.protected void
doRenderGraphicModifiers(DrawContext dc)
Render the graphic modifiers.protected void
doRenderTextModifiers(DrawContext dc)
Render the text modifiers.void
drag(DragContext dragContext)
Drag the object given the providedDragContext
.protected java.lang.Object
getActiveDelegateOwner()
Indicates the object attached to the pick list to represent this graphic.protected TacticalGraphicAttributes
getActiveOverrideAttributes()
Get the override attributes that are active for this frame.protected ShapeAttributes
getActiveShapeAttributes()
Get the active shape attributes for this frame.TacticalGraphicAttributes
getAttributes()
Indicates this graphic's attributes when it is in the normal (as opposed to highlighted) state.protected Offset
getDefaultLabelOffset()
Indicates the default offset applied to the graphic's main label.java.lang.Object
getDelegateOwner()
Returns the delegate owner of the graphic.TacticalGraphicAttributes
getHighlightAttributes()
Indicate this graphic's attributes when it is in the highlighted state.protected Material
getLabelMaterial()
Get the Material that should be used to draw labels.Offset
getLabelOffset()
Indicates an offset used to position the graphic's main label relative to the label's geographic position.java.lang.Object
getModifier(java.lang.String modifier)
Indicates the current value of a text or graphic modifier.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.protected void
onModifierChanged()
Invoked when a modifier is changed.void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.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 labelOffset)
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
setShowGraphicModifiers(boolean showModifiers)
Specifies whether to draw this graphic's supplemental graphic modifiers.void
setShowHostileIndicator(boolean showHostileIndicator)
Specifies whether or not to display a text indicator when the symbol or graphic represents a hostile entity.void
setShowLocation(boolean showLocation)
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
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
-
Methods inherited from interface gov.nasa.worldwind.Movable
getReferencePosition
-
Methods inherited from interface gov.nasa.worldwind.symbology.TacticalGraphic
getIdentifier, getPositions, setPositions
-
-
-
-
Field Detail
-
DEFAULT_HIGHLIGHT_MATERIAL
protected static final Material DEFAULT_HIGHLIGHT_MATERIAL
The default highlight color.
-
DEFAULT_LABEL_INTERIOR_OPACITY
protected static final double DEFAULT_LABEL_INTERIOR_OPACITY
Opacity of label interiors. This value is multiplied by the label text opacity to determine the final interior opacity.- See Also:
- Constant Field Values
-
text
protected java.lang.String text
The graphic's text string. This field corresponds to theSymbologyConstants.UNIQUE_DESIGNATION
modifier. Note that this field is not used if an Iterable is specified as the unique designation.
-
highlighted
protected boolean highlighted
Indicates whether or not the graphic is highlighted.
-
visible
protected boolean visible
Indicates whether or not to render the graphic.
-
showTextModifiers
protected boolean showTextModifiers
Indicates whether or not to render text modifiers.
-
showGraphicModifiers
protected boolean showGraphicModifiers
Indicates whether or not to render graphic modifiers.
-
dragEnabled
protected boolean dragEnabled
Indicates whether this object can be dragged.
-
draggableSupport
protected DraggableSupport draggableSupport
Provides additional information for dragging regarding this particular object.
-
showHostileIndicator
protected boolean showHostileIndicator
Indicates whether or not to render the hostile/enemy modifier. This modifier is displayed by default.
-
showLocation
protected boolean showLocation
Indicates whether or not to render the location modifier.
-
delegateOwner
protected java.lang.Object delegateOwner
Object returned during picking to represent this graphic.
-
unitsFormat
protected UnitsFormat unitsFormat
Unit format used to format location and altitude for text modifiers.
-
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.
-
labelOffset
protected Offset labelOffset
Offset applied to the graphic's main label.
-
labels
protected java.util.List<TacticalGraphicLabel> labels
Labels to render with the graphic.
-
modifiers
protected AVList modifiers
Map of modifiers applied to this graphic. Note that implementations may not store all modifiers in this map. Some modifiers may be handled specially.
-
frameTimestamp
protected long frameTimestamp
Current frame timestamp.
-
activeOverrides
protected TacticalGraphicAttributes activeOverrides
Override attributes for the current frame.
-
activeShapeAttributes
protected ShapeAttributes activeShapeAttributes
Shape attributes shared by all shapes that make up this graphic. The graphic's active attributes are copied into this attribute bundle on each frame.
-
mustCreateLabels
protected boolean mustCreateLabels
Flag to indicate that labels must be recreated before the graphic is rendered.
-
-
Method Detail
-
doRenderGraphic
protected abstract void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.- Parameters:
dc
- Current draw context.- See Also:
doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext)
,doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
-
applyDelegateOwner
protected abstract void applyDelegateOwner(java.lang.Object owner)
Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic. This base class will apply the delegate owner to Label objects. Subclasses must implement this method to apply the delegate owner to any Renderables that they will draw in order to render the graphic.- Parameters:
owner
- Current delegate owner.
-
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.
-
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 showHostileIndicator)
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:
showHostileIndicator
- 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.
-
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 showLocation)
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:
showLocation
- true if the graphic will display the location modifier. Note that not all graphics support this modifier.
-
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)
-
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)
-
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.
-
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.
-
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.
-
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 labelOffset)
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:
labelOffset
- The offset that determines how the graphic's label is placed relative to the graphic.
-
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.
-
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)
-
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
-
determinePerFrameAttributes
protected void determinePerFrameAttributes(DrawContext dc)
Determine geometry and attributes for this frame. This method only determines attributes the first time that it is called for each frame. Multiple calls in the same frame will have no effect.- Parameters:
dc
- Current draw context.
-
doRenderTextModifiers
protected void doRenderTextModifiers(DrawContext dc)
Render the text modifiers.- Parameters:
dc
- Current draw context.
-
doRenderGraphicModifiers
protected void doRenderGraphicModifiers(DrawContext dc)
Render the graphic modifiers. This base class does not render anything, but subclasses may override this method to draw graphic modifiers.- Parameters:
dc
- Current draw context.
-
onModifierChanged
protected void onModifierChanged()
Invoked when a modifier is changed. This implementation marks the label text as invalid causing it to be recreated based on the new modifiers.
-
determineLabelPositions
protected void determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.- Parameters:
dc
- Current draw context.
-
createLabels
protected void createLabels()
-
addLabel
protected TacticalGraphicLabel addLabel(java.lang.String text)
-
computeGeometry
protected void computeGeometry(DrawContext dc)
-
determineDelegateOwner
protected void determineDelegateOwner()
Determine the delegate owner for the current frame, and apply the owner to all renderable objects used to draw the graphic.
-
getActiveDelegateOwner
protected java.lang.Object getActiveDelegateOwner()
Indicates the object attached to the pick list to represent this graphic.- Returns:
- Delegate owner, if specified, or
this
if an owner is not specified.
-
determineActiveAttributes
protected void determineActiveAttributes()
Determine active attributes for this frame.
-
applyLabelAttributes
protected void applyLabelAttributes()
Apply the active attributes to the graphic's labels.
-
computeLabelInteriorOpacity
protected double computeLabelInteriorOpacity(double textOpacity)
Compute the opacity for the label interior. By default, the label interior is opacity is computed as 70% of the text opacity.- Parameters:
textOpacity
- Opacity of the label text.- Returns:
- Opacity of the label interior as a floating point number between 0.0 and 1.0.
-
getDefaultLabelOffset
protected Offset getDefaultLabelOffset()
Indicates the default offset applied to the graphic's main label. This offset may be overridden by the graphic attributes.- Returns:
- Offset to apply to the main label.
-
getActiveOverrideAttributes
protected TacticalGraphicAttributes getActiveOverrideAttributes()
Get the override attributes that are active for this frame.- Returns:
- Override attributes. Values set in this bundle override defaults specified by the symbol set.
-
getActiveShapeAttributes
protected ShapeAttributes getActiveShapeAttributes()
Get the active shape attributes for this frame. The active attributes are created by applying application specified overrides to the default attributes specified by the symbol set.- Returns:
- Active shape attributes.
-
getLabelMaterial
protected Material getLabelMaterial()
Get the Material that should be used to draw labels. If no override material has been specified, the graphic's outline Material is used for the labels.- Returns:
- The Material that should be used when drawing labels. May change each frame.
-
applyDefaultAttributes
protected void applyDefaultAttributes(ShapeAttributes attributes)
Apply defaults to the active attributes bundle. The default attributes are determined by the type of graphic. This method is called each frame to reset the active shape attributes to the appropriate default state. Override attributes specified by the application may be applied after the defaults have been set.- Parameters:
attributes
- Attributes bundle to receive defaults.
-
applyOverrideAttributes
protected void applyOverrideAttributes(TacticalGraphicAttributes graphicAttributes, ShapeAttributes shapeAttributes)
Apply override attributes specified in a TacticalGraphicAttributes bundle to the active ShapeAttributes. Any non-null properties ofgraphicAttributes
will be applied toshapeAttributes
.- Parameters:
graphicAttributes
- Override attributes.shapeAttributes
- Shape attributes to receive overrides.
-
-