public class SectorRangeFan extends AbstractMilStd2525TacticalGraphic implements PreRenderable
Modifier and Type | Field and Description |
---|---|
protected java.lang.Iterable<java.lang.String> |
altitudes
Altitudes of the range fans.
|
protected Angle |
arrowAngle
Length of the arrowhead from base to tip, as a fraction of the Center Of Sector line length.
|
protected SurfacePolygon |
arrowHead
Polygon to draw a filled arrow head on the Center Of Sector line.
|
protected double |
arrowLength
Angle of the arrowhead.
|
protected static double |
AZIMUTH_LABEL_OFFSET
Azimuth labels are placed to the side of the line that they label.
|
protected java.text.NumberFormat |
azimuthFormat
Number format used to create azimuth labels.
|
protected java.lang.Iterable<? extends Angle> |
azimuths
Azimuths of the range fans.
|
protected Angle |
centerAzimuth
Azimuth of the Center Of Sector arrow.
|
protected double |
centerOfSectorLength
Length of the Center Of Sector line, as a fraction of the last range fan radius.
|
static Angle |
DEFAULT_ARROWHEAD_ANGLE
Default angle of the arrowhead.
|
static double |
DEFAULT_ARROWHEAD_LENGTH
Default length of the arrowhead, as a fraction of the Center Of Sector line length.
|
static double |
DEFAULT_CENTER_OF_SECTOR_LENGTH
Default length of the Center Of Sector line, as a fraction of the final range fan radius.
|
static int |
DEFAULT_NUM_INTERVALS
Default number of intervals used to draw each arcs.
|
static java.text.NumberFormat |
DEFAULT_NUMBER_FORMAT
Default number format used to create azimuth and radius labels.
|
protected int |
intervals
Number of intervals used to draw each arcs.
|
protected double |
maxRadius
Maximum radius in the range fan.
|
protected java.util.List<Path> |
paths
Rings that make up the range fan.
|
protected Position |
position
Position of the center of the range fan.
|
protected java.lang.Iterable<java.lang.Double> |
radii
Radii of the range fans, in meters.
|
protected java.text.NumberFormat |
radiusFormat
Number format used to create radius labels.
|
protected TacticalSymbol |
symbol
Symbol drawn at the center of the range fan.
|
protected TacticalSymbolAttributes |
symbolAttributes
Attributes applied to the symbol.
|
maskedSymbolCode, OUTLINE_STIPPLE_FACTOR_ANTICIPATED, OUTLINE_STIPPLE_FACTOR_PRESENT, OUTLINE_STIPPLE_PATTERN, symbolCode
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 and Description |
---|
SectorRangeFan(java.lang.String sidc)
Create the range fan.
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyDefaultAttributes(ShapeAttributes attributes)
Apply defaults to the active attributes bundle.
|
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> |
computeArrowheadPositions(DrawContext dc,
Position base,
Position tip,
double arrowLength,
Angle arrowAngle)
Compute the positions of the arrow head for the sector center line.
|
protected double |
computeAzimuthLabelOffset(double radius,
double maxRadius)
Compute an angular offset to apply to a azimuth label.
|
protected Angle |
computeCenterSectorAngle(Angle finalLeftAzimuth,
Angle finalRightAzimuth)
Compute the angle of the Center Of Sector line.
|
protected void |
createArc(DrawContext dc,
double radius,
Angle leftAzimuth,
Angle rightAzimuth,
java.util.List<Position> positions)
Create positions to draw an arc around the graphic's center position.
|
protected void |
createAzimuthLabels()
Create azimuth labels.
|
protected java.lang.String |
createAzimuthLabelString(Angle azimuth)
Create text for an azimuth label.
|
protected void |
createCenterOfSectorArrow(DrawContext dc,
Angle centerAzimuth,
double finalRadius)
Create shapes to draw the Center Of Sector arrow.
|
protected void |
createLabels()
Create labels for the start and end of the path.
|
protected Path |
createPath(java.util.List<Position> positions)
Create and configure the Path used to render this graphic.
|
protected SurfacePolygon |
createPolygon()
Create and configure a SurfacePolygon to render the arrow head on the sector center line.
|
protected java.lang.String |
createRangeLabelString(double radius,
java.lang.String altitude)
Create text for a range label.
|
protected void |
createShapes(DrawContext dc)
Create the paths required to draw the graphic.
|
protected void |
determineActiveAttributes()
Determine active attributes for this frame.
|
protected void |
determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.
|
protected Position |
determineRangeLabelPosition(Position center,
Angle centerAzimuth,
Angle leftAzimuth,
Angle rightAzimuth,
double radiusRadians)
Determine the position of a range label for a ring in the range fan.
|
protected void |
doRenderGraphic(DrawContext dc)
Render the polygon.
|
protected void |
doRenderGraphicModifiers(DrawContext dc)
Render the graphic modifiers.
|
java.lang.Iterable<java.lang.String> |
getAltitudes()
Indicates the altitudes of the rings that make up the range fan.
|
Angle |
getArrowAngle()
Indicates the angle of the arrowhead.
|
double |
getArrowLength()
Indicates the length of the arrowhead.
|
java.text.NumberFormat |
getAzimuthFormat()
Indicates the number format applied to azimuth values to create the azimuth labels.
|
java.lang.Iterable<? extends Angle> |
getAzimuths()
Indicates the left and right azimuths of the fans in this graphic.
|
double |
getCenterOfSectorLength()
Indicates the length of the Center Of Sector line.
|
int |
getIntervals()
Indicates the number of intervals used to draw the arc in this graphic.
|
java.lang.Object |
getModifier(java.lang.String modifier)
Indicates the current value of a text or graphic modifier.
|
Position |
getPosition()
Indicates the center position of the range ran.
|
java.lang.Iterable<? extends Position> |
getPositions()
Indicates the positions of the control points that place and orient the graphic.
|
java.lang.Iterable<java.lang.Double> |
getRadii()
Indicates the radii of the rings that make up the range fan.
|
java.text.NumberFormat |
getRadiusFormat()
Indicates the number format applied to radius values to create the radius labels.
|
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.
|
java.lang.String |
getSymbol()
Indicates a symbol drawn at the center of the range fan.
|
protected Angle |
normalizeAzimuth(Angle azimuth)
Normalize an azimuth angle to the range [-180:180] degrees.
|
void |
preRender(DrawContext dc) |
protected void |
reset()
Regenerate the graphics positions on the next frame.
|
void |
setAltitudes(java.lang.Iterable<java.lang.String> altitudes)
Specifies the altitudes of the rings that make up the range fan.
|
void |
setArrowAngle(Angle arrowAngle)
Specifies the angle of the arrowhead in the graphic.
|
void |
setArrowLength(double arrowLength)
Specifies the length of the arrowhead.
|
void |
setAzimuthFormat(java.text.NumberFormat azimuthFormat)
Specifies the number format applied to azimuth values to create the azimuth labels.
|
void |
setAzimuths(java.lang.Iterable<? extends Angle> azimuths)
Specifies the left and right azimuths of the range fans in this graphic.
|
void |
setCenterOfSector(double centerOfSectorLength)
Specifies the length of the Center Of Sector line.
|
void |
setIntervals(int intervals)
Specifies the number of intervals used to draw the arc in this graphic.
|
void |
setModifier(java.lang.String modifier,
java.lang.Object value)
Specifies the value of a text or graphic modifier.
|
void |
setPosition(Position position)
Specifies the center position of the range ran.
|
void |
setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.
|
void |
setRadii(java.lang.Iterable<java.lang.Double> radii)
Specifies the radii of the rings that make up the range fan.
|
void |
setRadiusFormat(java.text.NumberFormat radiusFormat)
Specifies the number format applied to radius values to create the radius labels.
|
void |
setSymbol(java.lang.String sidc)
Specifies a symbol to draw at the center of the range fan.
|
createSymbol, getDefaultMaterial, getIdentifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setStatus
addLabel, applyLabelAttributes, applyOverrideAttributes, computeGeometry, computeLabelInteriorOpacity, determineDelegateOwner, determinePerFrameAttributes, doDrag, doRenderTextModifiers, drag, getActiveDelegateOwner, getActiveOverrideAttributes, getActiveShapeAttributes, getAttributes, getDefaultLabelOffset, 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
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAttributes, getDelegateOwner, getHighlightAttributes, getLabelOffset, getUnitsFormat, isShowGraphicModifiers, isShowHostileIndicator, isShowLocation, isShowTextModifiers, isVisible, setAttributes, setDelegateOwner, setHighlightAttributes, setLabelOffset, setShowGraphicModifiers, setShowHostileIndicator, setShowLocation, setShowTextModifiers, setText, setUnitsFormat, setVisible
render
isHighlighted, setHighlighted
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected java.lang.Iterable<java.lang.String> altitudes
protected Angle arrowAngle
protected SurfacePolygon arrowHead
protected double arrowLength
protected static final double AZIMUTH_LABEL_OFFSET
protected java.text.NumberFormat azimuthFormat
protected java.lang.Iterable<? extends Angle> azimuths
protected Angle centerAzimuth
protected double centerOfSectorLength
public static final Angle DEFAULT_ARROWHEAD_ANGLE
public static final double DEFAULT_ARROWHEAD_LENGTH
public static final double DEFAULT_CENTER_OF_SECTOR_LENGTH
public static final int DEFAULT_NUM_INTERVALS
public static final java.text.NumberFormat DEFAULT_NUMBER_FORMAT
protected int intervals
protected double maxRadius
protected java.util.List<Path> paths
protected Position position
protected java.lang.Iterable<java.lang.Double> radii
protected java.text.NumberFormat radiusFormat
protected TacticalSymbol symbol
protected TacticalSymbolAttributes symbolAttributes
public SectorRangeFan(java.lang.String sidc)
sidc
- Symbol code the identifies the graphic.protected void applyDefaultAttributes(ShapeAttributes attributes)
applyDefaultAttributes
in class AbstractMilStd2525TacticalGraphic
attributes
- Attributes bundle to receive defaults.protected void applyDelegateOwner(java.lang.Object owner)
applyDelegateOwner
in class AbstractTacticalGraphic
owner
- Current delegate owner.protected java.util.List<Position> computeArrowheadPositions(DrawContext dc, Position base, Position tip, double arrowLength, Angle arrowAngle)
dc
- Current draw contextbase
- Position of the arrow's starting point.tip
- Position of the arrow head tip.arrowLength
- Length of the arrowhead as a fraction of the total line length.arrowAngle
- Angle of the arrow head.protected double computeAzimuthLabelOffset(double radius, double maxRadius)
radius
- Radius at which the label will be placed.maxRadius
- Maximum radius in the range fan.protected Angle computeCenterSectorAngle(Angle finalLeftAzimuth, Angle finalRightAzimuth)
finalLeftAzimuth
- Left azimuth of the last range fan in the graphic.finalRightAzimuth
- Right azimuth of the last range fan in the graphic.protected void createArc(DrawContext dc, double radius, Angle leftAzimuth, Angle rightAzimuth, java.util.List<Position> positions)
If the left and right azimuths are equal, then this methods adds a single position to the list at the desired azimuth and radius.
dc
- Current draw context.radius
- Radius of the circular segment, in meters.leftAzimuth
- Azimuth (from North) of the left side of the arc.rightAzimuth
- Azimuth (from North) of teh right side of the arc.positions
- List to collect positions for the arc.protected void createAzimuthLabels()
protected java.lang.String createAzimuthLabelString(Angle azimuth)
azimuth
- Azimuth, measured clockwise from North.protected void createCenterOfSectorArrow(DrawContext dc, Angle centerAzimuth, double finalRadius)
dc
- Current draw context.centerAzimuth
- Azimuth of the Center Of Sector arrow.finalRadius
- Radius, in meters, of the final range fan.protected void createLabels()
createLabels
in class AbstractTacticalGraphic
protected Path createPath(java.util.List<Position> positions)
positions
- Positions that define the path.protected SurfacePolygon createPolygon()
protected java.lang.String createRangeLabelString(double radius, java.lang.String altitude)
radius
- Range of the ring, in meters.altitude
- Altitude string.protected void createShapes(DrawContext dc)
dc
- Current draw context.protected void determineActiveAttributes()
determineActiveAttributes
in class AbstractTacticalGraphic
protected void determineLabelPositions(DrawContext dc)
determineLabelPositions
in class AbstractTacticalGraphic
dc
- Current draw context.protected Position determineRangeLabelPosition(Position center, Angle centerAzimuth, Angle leftAzimuth, Angle rightAzimuth, double radiusRadians)
center
- Center of the range fan.centerAzimuth
- Azimuth of the Center Of Sector arrow.leftAzimuth
- Left azimuth of this ring.rightAzimuth
- Right azimuth of this ring.radiusRadians
- Radius, in radians, at which to place the label.protected void doRenderGraphic(DrawContext dc)
doRenderGraphic
in class AbstractTacticalGraphic
dc
- Current draw context.AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext)
,
AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
protected void doRenderGraphicModifiers(DrawContext dc)
doRenderGraphicModifiers
in class AbstractTacticalGraphic
dc
- Current draw context.public java.lang.Iterable<java.lang.String> getAltitudes()
public Angle getArrowAngle()
public double getArrowLength()
public java.text.NumberFormat getAzimuthFormat()
public java.lang.Iterable<? extends Angle> getAzimuths()
public double getCenterOfSectorLength()
public int getIntervals()
public java.lang.Object getModifier(java.lang.String modifier)
getModifier
in interface TacticalGraphic
getModifier
in class AbstractMilStd2525TacticalGraphic
modifier
- Key that identifies the modifier to retrieve. The possible modifiers depends on the symbol set.null
if the modifier is not set.public Position getPosition()
public java.lang.Iterable<? extends Position> getPositions()
getPositions
in interface TacticalGraphic
public java.lang.Iterable<java.lang.Double> getRadii()
public java.text.NumberFormat getRadiusFormat()
public Position getReferencePosition()
getReferencePosition
in interface Movable
public static java.util.List<java.lang.String> getSupportedGraphics()
public java.lang.String getSymbol()
protected Angle normalizeAzimuth(Angle azimuth)
azimuth
- Azimuth to normalize.azimuth
is null.public void preRender(DrawContext dc)
preRender
in interface PreRenderable
protected void reset()
public void setAltitudes(java.lang.Iterable<java.lang.String> altitudes)
altitudes
- List of altitude strings.public void setArrowAngle(Angle arrowAngle)
arrowAngle
- The angle of the arrowhead. Must be greater than zero degrees and less than 90 degrees.public void setArrowLength(double arrowLength)
arrowLength
- Length of the arrowhead as a fraction of the total line length. If the arrowhead length is
0.25, then the arrowhead length will be one quarter of the total line length.public void setAzimuthFormat(java.text.NumberFormat azimuthFormat)
azimuthFormat
- NumberFormat to create azimuth labels.public void setAzimuths(java.lang.Iterable<? extends Angle> azimuths)
azimuths
- Left and right azimuths, measured clockwise from North.public void setCenterOfSector(double centerOfSectorLength)
centerOfSectorLength
- Length of the Center Of Sector arrow as a fraction of the final range fan radius.public void setIntervals(int intervals)
intervals
- Number of intervals for drawing the arc.public void setModifier(java.lang.String modifier, java.lang.Object value)
setModifier
in interface TacticalGraphic
setModifier
in class AbstractMilStd2525TacticalGraphic
modifier
- Key that identifies the modifier to set. The possible modifiers depends on the symbol set.value
- New value for the modifier.public void setPosition(Position position)
position
- The new center position.public void setPositions(java.lang.Iterable<? extends Position> positions)
setPositions
in interface TacticalGraphic
positions
- Control points. This graphic uses only one control point, which determines the center of the
circle.public void setRadii(java.lang.Iterable<java.lang.Double> radii)
radii
- List of radii, in meters. A circle will be created for each radius.public void setRadiusFormat(java.text.NumberFormat radiusFormat)
radiusFormat
- NumberFormat to create radius labels.public void setSymbol(java.lang.String sidc)
SymbologyConstants.SYMBOL_INDICATOR
modifier. The symbol's position will be changed to match the range fan
center position.sidc
- The identifier of a MIL-STD-2525C tactical symbol to draw at the center of the range fan. May be null
to indicate that no symbol is drawn.