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
doRenderGraphicandapplyDelegateOwner(Object).
-
-
Field Summary
Fields Modifier and Type Field Description protected TacticalGraphicAttributesactiveOverridesOverride attributes for the current frame.protected ShapeAttributesactiveShapeAttributesShape attributes shared by all shapes that make up this graphic.protected static MaterialDEFAULT_HIGHLIGHT_MATERIALThe default highlight color.protected static doubleDEFAULT_LABEL_INTERIOR_OPACITYOpacity of label interiors.protected java.lang.ObjectdelegateOwnerObject returned during picking to represent this graphic.protected booleandragEnabledIndicates whether this object can be dragged.protected DraggableSupportdraggableSupportProvides additional information for dragging regarding this particular object.protected longframeTimestampCurrent frame timestamp.protected TacticalGraphicAttributeshighlightAttributesAttributes to apply when the graphic is highlighted.protected booleanhighlightedIndicates whether or not the graphic is highlighted.protected OffsetlabelOffsetOffset applied to the graphic's main label.protected java.util.List<TacticalGraphicLabel>labelsLabels to render with the graphic.protected AVListmodifiersMap of modifiers applied to this graphic.protected booleanmustCreateLabelsFlag to indicate that labels must be recreated before the graphic is rendered.protected TacticalGraphicAttributesnormalAttributesAttributes to apply when the graphic is not highlighted.protected booleanshowGraphicModifiersIndicates whether or not to render graphic modifiers.protected booleanshowHostileIndicatorIndicates whether or not to render the hostile/enemy modifier.protected booleanshowLocationIndicates whether or not to render the location modifier.protected booleanshowTextModifiersIndicates whether or not to render text modifiers.protected java.lang.StringtextThe graphic's text string.protected UnitsFormatunitsFormatUnit format used to format location and altitude for text modifiers.protected booleanvisibleIndicates 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 TacticalGraphicLabeladdLabel(java.lang.String text)protected voidapplyDefaultAttributes(ShapeAttributes attributes)Apply defaults to the active attributes bundle.protected abstract voidapplyDelegateOwner(java.lang.Object owner)Invoked each frame to apply to the current delegate owner to all renderable objects used to draw the graphic.protected voidapplyLabelAttributes()Apply the active attributes to the graphic's labels.protected voidapplyOverrideAttributes(TacticalGraphicAttributes graphicAttributes, ShapeAttributes shapeAttributes)Apply override attributes specified in a TacticalGraphicAttributes bundle to the active ShapeAttributes.protected voidcomputeGeometry(DrawContext dc)protected doublecomputeLabelInteriorOpacity(double textOpacity)Compute the opacity for the label interior.protected voidcreateLabels()protected voiddetermineActiveAttributes()Determine active attributes for this frame.protected voiddetermineDelegateOwner()Determine the delegate owner for the current frame, and apply the owner to all renderable objects used to draw the graphic.protected voiddetermineLabelPositions(DrawContext dc)Determine positions for the start and end labels.protected voiddeterminePerFrameAttributes(DrawContext dc)Determine geometry and attributes for this frame.protected voiddoDrag(DragContext dragContext)protected abstract voiddoRenderGraphic(DrawContext dc)Render this graphic, without modifiers.protected voiddoRenderGraphicModifiers(DrawContext dc)Render the graphic modifiers.protected voiddoRenderTextModifiers(DrawContext dc)Render the text modifiers.voiddrag(DragContext dragContext)Drag the object given the providedDragContext.protected java.lang.ObjectgetActiveDelegateOwner()Indicates the object attached to the pick list to represent this graphic.protected TacticalGraphicAttributesgetActiveOverrideAttributes()Get the override attributes that are active for this frame.protected ShapeAttributesgetActiveShapeAttributes()Get the active shape attributes for this frame.TacticalGraphicAttributesgetAttributes()Indicates this graphic's attributes when it is in the normal (as opposed to highlighted) state.protected OffsetgetDefaultLabelOffset()Indicates the default offset applied to the graphic's main label.java.lang.ObjectgetDelegateOwner()Returns the delegate owner of the graphic.TacticalGraphicAttributesgetHighlightAttributes()Indicate this graphic's attributes when it is in the highlighted state.protected MaterialgetLabelMaterial()Get the Material that should be used to draw labels.OffsetgetLabelOffset()Indicates an offset used to position the graphic's main label relative to the label's geographic position.java.lang.ObjectgetModifier(java.lang.String modifier)Indicates the current value of a text or graphic modifier.java.lang.StringgetText()Convenience method to access the text modifier of the graphic.UnitsFormatgetUnitsFormat()Indicates the unit format used to format values in text modifiers.booleanisDragEnabled()Indicates whether the object is enabled for dragging.booleanisHighlighted()Indicates whether to highlight the shape.booleanisShowGraphicModifiers()Indicates whether this graphic draws its supplemental graphic modifiers.booleanisShowHostileIndicator()Indicates whether or not this graphic will display a text indicator when the graphic represents a hostile entity.booleanisShowLocation()Indicates whether or not the graphic should display its location as a text modifier.booleanisShowTextModifiers()Indicates whether this graphic draws its supplemental text modifiers.booleanisVisible()Indicates whether this graphic is drawn when in view.voidmove(Position delta)Shift the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.voidmoveTo(Position position)Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.protected voidonModifierChanged()Invoked when a modifier is changed.voidrender(DrawContext dc)Causes thisRenderableto render itself using the provided draw context.voidsetAttributes(TacticalGraphicAttributes attributes)Specifies attributes for this graphic in the normal (as opposed to highlighted) state.voidsetDelegateOwner(java.lang.Object owner)Specifies the delegate owner of the graphic.voidsetDragEnabled(boolean enabled)Controls whether the object is enabled for dragging.voidsetHighlightAttributes(TacticalGraphicAttributes attributes)Specifies attributes for this graphic in the highlighted state.voidsetHighlighted(boolean highlighted)Specifies whether to highlight the shape.voidsetLabelOffset(Offset labelOffset)Specifies an offset used to position this graphic's main label relative to the label's geographic position.voidsetModifier(java.lang.String modifier, java.lang.Object value)Specifies the value of a text or graphic modifier.voidsetShowGraphicModifiers(boolean showModifiers)Specifies whether to draw this graphic's supplemental graphic modifiers.voidsetShowHostileIndicator(boolean showHostileIndicator)Specifies whether or not to display a text indicator when the symbol or graphic represents a hostile entity.voidsetShowLocation(boolean showLocation)Specifies whether or not the graphic should display its location as a text modifier.voidsetShowTextModifiers(boolean showModifiers)Specifies whether to draw this graphic's supplemental text modifiers.voidsetText(java.lang.String text)Convenience method to specify a text modifier for the graphic.voidsetUnitsFormat(UnitsFormat unitsFormat)Specifies the unit format used to format values in text modifiers.voidsetVisible(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_DESIGNATIONmodifier. 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:
getModifierin 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
nullif 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:
setModifierin 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:
isShowTextModifiersin 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:
setShowTextModifiersin 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:
isShowGraphicModifiersin 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:
setShowGraphicModifiersin 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 onsetShowHostileIndicatorfor more information.- Specified by:
isShowHostileIndicatorin 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:
setShowHostileIndicatorin 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:
isShowLocationin 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:
setShowLocationin 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:
getTextin 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:
setTextin 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:
isVisiblein 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:
setVisiblein 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:
getAttributesin 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:
setAttributesin 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:
getHighlightAttributesin 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 onsetAttributesfor more information on how the attributes are interpreted.- Specified by:
setHighlightAttributesin 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:
getDelegateOwnerin 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:
setDelegateOwnerin 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:
getUnitsFormatin 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:
setUnitsFormatin 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 onsetLabelOffsetfor more information.- Specified by:
getLabelOffsetin 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:
setLabelOffsetin 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:
isHighlightedin interfaceHighlightable- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.- Specified by:
setHighlightedin 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:DraggableIndicates whether the object is enabled for dragging.- Specified by:
isDragEnabledin interfaceDraggable- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:DraggableControls whether the object is enabled for dragging.- Specified by:
setDragEnabledin interfaceDraggable- Parameters:
enabled-trueif the object is enabled, elsefalse.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:DraggableDrag the object given the providedDragContext.- Specified by:
dragin interfaceDraggable- Parameters:
dragContext- theDragContextof this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
render
public void render(DrawContext dc)
Causes thisRenderableto render itself using the provided draw context.- Specified by:
renderin interfaceRenderable- Parameters:
dc- theDrawContextto 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
thisif 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 ofgraphicAttributeswill be applied toshapeAttributes.- Parameters:
graphicAttributes- Override attributes.shapeAttributes- Shape attributes to receive overrides.
-
-