Class LinearTarget
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.symbology.AbstractTacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
-
- gov.nasa.worldwind.symbology.milstd2525.graphics.lines.LinearTarget
-
- All Implemented Interfaces:
AVList
,Draggable
,Movable
,Highlightable
,Renderable
,MilStd2525TacticalGraphic
,TacticalGraphic
public class LinearTarget extends AbstractMilStd2525TacticalGraphic
Implementation of Linear Target graphics. This class implements the following graphics:- Linear Target (2.X.4.2.1)
- Linear Smoke Target (2.X.4.2.1.1)
- Final Protective Fire (FPF) (2.X.4.2.1.2)
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
additionalText
The value of an optional second text string for the graphic.protected static Offset
BOTTOM_LABEL_OFFSET
Offset applied to the graphic's lower label.static double
DEFAULT_VERTICAL_LENGTH
Default length of the arrowhead, as a fraction of the total line length.protected Position
endPosition
Second control point.protected Path[]
paths
Paths used to render the graphic.protected Position
startPosition
First control point.protected static Offset
TOP_LABEL_OFFSET
Offset applied to the graphic's upper label.protected double
verticalLength
Length of the vertical segments, as a fraction of the horizontal segment.-
Fields inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
maskedSymbolCode, OUTLINE_STIPPLE_FACTOR_ANTICIPATED, OUTLINE_STIPPLE_FACTOR_PRESENT, OUTLINE_STIPPLE_PATTERN, symbolCode
-
Fields inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
activeOverrides, activeShapeAttributes, DEFAULT_HIGHLIGHT_MATERIAL, DEFAULT_LABEL_INTERIOR_OPACITY, delegateOwner, dragEnabled, draggableSupport, frameTimestamp, highlightAttributes, highlighted, labelOffset, labels, modifiers, mustCreateLabels, normalAttributes, showGraphicModifiers, showHostileIndicator, showLocation, showTextModifiers, text, unitsFormat, visible
-
-
Constructor Summary
Constructors Constructor Description LinearTarget(java.lang.String sidc)
Create a new target graphic.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 java.util.List<Position>
computeVerticalSegmentPositions(Globe globe, Vec4 basePoint, Vec4 segment, double verticalLength)
Compute positions for one of the vertical segments in the graphic.protected void
createLabels()
Create labels for the graphic.protected Path
createPath(java.util.List<Position> positions)
Create and configure the Path used to render this graphic.protected void
createShapes(DrawContext dc)
Create the list of positions that describe the shape.protected void
determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.protected void
doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.java.lang.String
getAdditionalText()
Indicates an additional text identification for this graphic.protected Offset
getBottomLabelOffset()
Indicates the offset applied to the lower label.protected java.lang.String
getBottomLabelText()
Determine text for the graphic's bottom label.protected Offset
getDefaultLabelOffset()
Indicates the default offset applied to the graphic's main label.java.lang.Object
getModifier(java.lang.String key)
Indicates the current value of a text or graphic modifier.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.static java.util.List<java.lang.String>
getSupportedGraphics()
Indicates the graphics supported by this class.double
getVerticalLength()
Indicates the length of the vertical segments in the graphic.void
setAdditionalText(java.lang.String text)
Indicates an additional text identification for this graphic.void
setModifier(java.lang.String key, java.lang.Object value)
Specifies the value of a text or graphic modifier.void
setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.void
setVerticalLength(double length)
Specifies the length of the vertical segments in the graphic.-
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
applyDefaultAttributes, createSymbol, getDefaultMaterial, getIdentifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setStatus
-
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
addLabel, applyLabelAttributes, applyOverrideAttributes, computeGeometry, computeLabelInteriorOpacity, determineActiveAttributes, determineDelegateOwner, determinePerFrameAttributes, doDrag, doRenderGraphicModifiers, doRenderTextModifiers, drag, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDelegateOwner, getHighlightAttributes, getLabelMaterial, getLabelOffset, getUnitsFormat, isDragEnabled, isHighlighted, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, move, moveTo, onModifierChanged, render, setAttributes, setDelegateOwner, setDragEnabled, setHighlightAttributes, setHighlighted, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
-
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.render.Highlightable
isHighlighted, setHighlighted
-
Methods inherited from interface gov.nasa.worldwind.render.Renderable
render
-
Methods inherited from interface gov.nasa.worldwind.symbology.TacticalGraphic
getAttributes, getDelegateOwner, getHighlightAttributes, getLabelOffset, getUnitsFormat, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, setAttributes, setDelegateOwner, setHighlightAttributes, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
-
-
-
-
Field Detail
-
DEFAULT_VERTICAL_LENGTH
public static final double DEFAULT_VERTICAL_LENGTH
Default length of the arrowhead, as a fraction of the total line length.- See Also:
- Constant Field Values
-
verticalLength
protected double verticalLength
Length of the vertical segments, as a fraction of the horizontal segment.
-
TOP_LABEL_OFFSET
protected static final Offset TOP_LABEL_OFFSET
Offset applied to the graphic's upper label. This offset aligns the bottom edge of the label with the geographic position, in order to keep the label above the graphic as the zoom changes.
-
BOTTOM_LABEL_OFFSET
protected static final Offset BOTTOM_LABEL_OFFSET
Offset applied to the graphic's lower label. This offset aligns the top edge of the label with the geographic position, in order to keep the label above the graphic as the zoom changes.
-
startPosition
protected Position startPosition
First control point.
-
endPosition
protected Position endPosition
Second control point.
-
additionalText
protected java.lang.String additionalText
The value of an optional second text string for the graphic. This value is equivalent to the "T1" modifier defined by MIL-STD-2525C. It can be set usingsetAdditionalText(String)
, or by passing an Iterable tosetModifier(String, Object)
with a key ofSymbologyConstants.UNIQUE_DESIGNATION
(additional text is the second value in the iterable).
-
paths
protected Path[] paths
Paths used to render the graphic.
-
-
Method Detail
-
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.
-
getVerticalLength
public double getVerticalLength()
Indicates the length of the vertical segments in the graphic.- Returns:
- The length of the vertical segments as a fraction of the horizontal segment.
-
setVerticalLength
public void setVerticalLength(double length)
Specifies the length of the vertical segments in the graphic.- Parameters:
length
- Length of the vertical segments as a fraction of the horizontal segment. If the vertical length is 0.25, then the vertical segments will be one quarter of the horizontal segment length.
-
getAdditionalText
public java.lang.String getAdditionalText()
Indicates an additional text identification for this graphic. This value is equivalent to the "T1" modifier in MIL-STD-2525C (a second Unique Designation modifier).- Returns:
- The additional text. May be null.
-
setAdditionalText
public void setAdditionalText(java.lang.String text)
Indicates an additional text identification for this graphic. Setting this value is equivalent to setting the "T1" modifier in MIL-STD-2525C (a second Unique Designation modifier).- Parameters:
text
- The additional text. May be null.
-
getModifier
public java.lang.Object getModifier(java.lang.String key)
Description copied from class:AbstractMilStd2525TacticalGraphic
Indicates the current value of a text or graphic modifier.- Specified by:
getModifier
in interfaceTacticalGraphic
- Overrides:
getModifier
in classAbstractMilStd2525TacticalGraphic
- Parameters:
key
- 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 key, java.lang.Object value)
Description copied from class:AbstractMilStd2525TacticalGraphic
Specifies the value of a text or graphic modifier.- Specified by:
setModifier
in interfaceTacticalGraphic
- Overrides:
setModifier
in classAbstractMilStd2525TacticalGraphic
- Parameters:
key
- Key that identifies the modifier to set. The possible modifiers depends on the symbol set.value
- New value for the modifier.
-
setPositions
public void setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.- Parameters:
positions
- Control points that orient the graphic. Must provide at least three points.
-
getPositions
public java.lang.Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.- Returns:
- positions that orient the graphic. How many positions are returned depends on the type of graphic. Some graphics require only a single position, others require many.
-
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.- Returns:
- the object's reference position, or null if no reference position is available.
-
doRenderGraphic
protected void doRenderGraphic(DrawContext dc)
Render this graphic, without modifiers.- Specified by:
doRenderGraphic
in classAbstractTacticalGraphic
- Parameters:
dc
- Current draw context.- See Also:
AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext)
,AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
-
applyDelegateOwner
protected 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.- Specified by:
applyDelegateOwner
in classAbstractTacticalGraphic
- Parameters:
owner
- Current delegate owner.
-
createShapes
protected void createShapes(DrawContext dc)
Create the list of positions that describe the shape.- Parameters:
dc
- Current draw context.
-
computeVerticalSegmentPositions
protected java.util.List<Position> computeVerticalSegmentPositions(Globe globe, Vec4 basePoint, Vec4 segment, double verticalLength)
Compute positions for one of the vertical segments in the graphic.- Parameters:
globe
- Current globe.basePoint
- Point at which the vertical segment must meet the horizontal segment.segment
- Vector in the direction of the horizontal segment.verticalLength
- Length of the vertical segment, in meters.- Returns:
- Positions that make up the vertical segment.
-
createLabels
protected void createLabels()
Create labels for the graphic.- Overrides:
createLabels
in classAbstractTacticalGraphic
-
getBottomLabelText
protected java.lang.String getBottomLabelText()
Determine text for the graphic's bottom label.- Returns:
- Text for the bottom label. May return null if there is no bottom label.
-
determineLabelPositions
protected void determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.- Overrides:
determineLabelPositions
in classAbstractTacticalGraphic
- Parameters:
dc
- Current draw context.
-
getDefaultLabelOffset
protected Offset getDefaultLabelOffset()
Indicates the default offset applied to the graphic's main label. This offset may be overridden by the graphic attributes.- Overrides:
getDefaultLabelOffset
in classAbstractTacticalGraphic
- Returns:
- Offset to apply to the main label.
-
getBottomLabelOffset
protected Offset getBottomLabelOffset()
Indicates the offset applied to the lower label.- Returns:
- Offset applied to the bottom label.
-
-