Class SectorRangeFan
- 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.areas.SectorRangeFan
-
- All Implemented Interfaces:
AVList,Draggable,Movable,Highlightable,PreRenderable,Renderable,MilStd2525TacticalGraphic,TacticalGraphic
public class SectorRangeFan extends AbstractMilStd2525TacticalGraphic implements PreRenderable
Implementation of the Sector Weapon/Sensor Range Fans graphic (2.X.4.3.4.2). The range fans are defined by a center position, list of radii, and list of left and right azimuths. If no azimuths are specified, the fans will be drawn as full circles.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Iterable<java.lang.String>altitudesAltitudes of the range fans.protected AnglearrowAngleLength of the arrowhead from base to tip, as a fraction of the Center Of Sector line length.protected SurfacePolygonarrowHeadPolygon to draw a filled arrow head on the Center Of Sector line.protected doublearrowLengthAngle of the arrowhead.protected static doubleAZIMUTH_LABEL_OFFSETAzimuth labels are placed to the side of the line that they label.protected java.text.NumberFormatazimuthFormatNumber format used to create azimuth labels.protected java.lang.Iterable<? extends Angle>azimuthsAzimuths of the range fans.protected AnglecenterAzimuthAzimuth of the Center Of Sector arrow.protected doublecenterOfSectorLengthLength of the Center Of Sector line, as a fraction of the last range fan radius.static AngleDEFAULT_ARROWHEAD_ANGLEDefault angle of the arrowhead.static doubleDEFAULT_ARROWHEAD_LENGTHDefault length of the arrowhead, as a fraction of the Center Of Sector line length.static doubleDEFAULT_CENTER_OF_SECTOR_LENGTHDefault length of the Center Of Sector line, as a fraction of the final range fan radius.static intDEFAULT_NUM_INTERVALSDefault number of intervals used to draw each arcs.static java.text.NumberFormatDEFAULT_NUMBER_FORMATDefault number format used to create azimuth and radius labels.protected intintervalsNumber of intervals used to draw each arcs.protected doublemaxRadiusMaximum radius in the range fan.protected java.util.List<Path>pathsRings that make up the range fan.protected PositionpositionPosition of the center of the range fan.protected java.lang.Iterable<java.lang.Double>radiiRadii of the range fans, in meters.protected java.text.NumberFormatradiusFormatNumber format used to create radius labels.protected TacticalSymbolsymbolSymbol drawn at the center of the range fan.protected TacticalSymbolAttributessymbolAttributesAttributes applied to the symbol.-
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 SectorRangeFan(java.lang.String sidc)Create the range fan.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidapplyDefaultAttributes(ShapeAttributes attributes)Apply defaults to the active attributes bundle.protected 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 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 doublecomputeAzimuthLabelOffset(double radius, double maxRadius)Compute an angular offset to apply to a azimuth label.protected AnglecomputeCenterSectorAngle(Angle finalLeftAzimuth, Angle finalRightAzimuth)Compute the angle of the Center Of Sector line.protected voidcreateArc(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 voidcreateAzimuthLabels()Create azimuth labels.protected java.lang.StringcreateAzimuthLabelString(Angle azimuth)Create text for an azimuth label.protected voidcreateCenterOfSectorArrow(DrawContext dc, Angle centerAzimuth, double finalRadius)Create shapes to draw the Center Of Sector arrow.protected voidcreateLabels()Create labels for the start and end of the path.protected PathcreatePath(java.util.List<Position> positions)Create and configure the Path used to render this graphic.protected SurfacePolygoncreatePolygon()Create and configure a SurfacePolygon to render the arrow head on the sector center line.protected java.lang.StringcreateRangeLabelString(double radius, java.lang.String altitude)Create text for a range label.protected voidcreateShapes(DrawContext dc)Create the paths required to draw the graphic.protected voiddetermineActiveAttributes()Determine active attributes for this frame.protected voiddetermineLabelPositions(DrawContext dc)Determine positions for the start and end labels.protected PositiondetermineRangeLabelPosition(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 voiddoRenderGraphic(DrawContext dc)Render the polygon.protected voiddoRenderGraphicModifiers(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.AnglegetArrowAngle()Indicates the angle of the arrowhead.doublegetArrowLength()Indicates the length of the arrowhead.java.text.NumberFormatgetAzimuthFormat()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.doublegetCenterOfSectorLength()Indicates the length of the Center Of Sector line.intgetIntervals()Indicates the number of intervals used to draw the arc in this graphic.java.lang.ObjectgetModifier(java.lang.String modifier)Indicates the current value of a text or graphic modifier.PositiongetPosition()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.NumberFormatgetRadiusFormat()Indicates the number format applied to radius values to create the radius labels.PositiongetReferencePosition()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.StringgetSymbol()Indicates a symbol drawn at the center of the range fan.protected AnglenormalizeAzimuth(Angle azimuth)Normalize an azimuth angle to the range [-180:180] degrees.voidpreRender(DrawContext dc)protected voidreset()Regenerate the graphics positions on the next frame.voidsetAltitudes(java.lang.Iterable<java.lang.String> altitudes)Specifies the altitudes of the rings that make up the range fan.voidsetArrowAngle(Angle arrowAngle)Specifies the angle of the arrowhead in the graphic.voidsetArrowLength(double arrowLength)Specifies the length of the arrowhead.voidsetAzimuthFormat(java.text.NumberFormat azimuthFormat)Specifies the number format applied to azimuth values to create the azimuth labels.voidsetAzimuths(java.lang.Iterable<? extends Angle> azimuths)Specifies the left and right azimuths of the range fans in this graphic.voidsetCenterOfSector(double centerOfSectorLength)Specifies the length of the Center Of Sector line.voidsetIntervals(int intervals)Specifies the number of intervals used to draw the arc in this graphic.voidsetModifier(java.lang.String modifier, java.lang.Object value)Specifies the value of a text or graphic modifier.voidsetPosition(Position position)Specifies the center position of the range ran.voidsetPositions(java.lang.Iterable<? extends Position> positions)Specifies the positions of the control points that place and orient the graphic.voidsetRadii(java.lang.Iterable<java.lang.Double> radii)Specifies the radii of the rings that make up the range fan.voidsetRadiusFormat(java.text.NumberFormat radiusFormat)Specifies the number format applied to radius values to create the radius labels.voidsetSymbol(java.lang.String sidc)Specifies a symbol to draw at the center of the range fan.-
Methods inherited from class gov.nasa.worldwind.symbology.milstd2525.AbstractMilStd2525TacticalGraphic
createSymbol, getDefaultMaterial, getIdentifier, getOutlineStippleFactor, getOutlineStipplePattern, getStatus, getText, mustShowHostileIndicator, setStatus
-
Methods inherited from class gov.nasa.worldwind.symbology.AbstractTacticalGraphic
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
-
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_NUM_INTERVALS
public static final int DEFAULT_NUM_INTERVALS
Default number of intervals used to draw each arcs.- See Also:
- Constant Field Values
-
DEFAULT_CENTER_OF_SECTOR_LENGTH
public static final double DEFAULT_CENTER_OF_SECTOR_LENGTH
Default length of the Center Of Sector line, as a fraction of the final range fan radius.- See Also:
- Constant Field Values
-
DEFAULT_ARROWHEAD_LENGTH
public static final double DEFAULT_ARROWHEAD_LENGTH
Default length of the arrowhead, as a fraction of the Center Of Sector line length.- See Also:
- Constant Field Values
-
DEFAULT_ARROWHEAD_ANGLE
public static final Angle DEFAULT_ARROWHEAD_ANGLE
Default angle of the arrowhead.
-
AZIMUTH_LABEL_OFFSET
protected static final double AZIMUTH_LABEL_OFFSET
Azimuth labels are placed to the side of the line that they label. This value specifies a percentage that is multiplied by the maximum radius in the range fan to compute a distance for this offset.- See Also:
- Constant Field Values
-
DEFAULT_NUMBER_FORMAT
public static final java.text.NumberFormat DEFAULT_NUMBER_FORMAT
Default number format used to create azimuth and radius labels.
-
arrowAngle
protected Angle arrowAngle
Length of the arrowhead from base to tip, as a fraction of the Center Of Sector line length.
-
arrowLength
protected double arrowLength
Angle of the arrowhead.
-
centerOfSectorLength
protected double centerOfSectorLength
Length of the Center Of Sector line, as a fraction of the last range fan radius.
-
intervals
protected int intervals
Number of intervals used to draw each arcs.
-
azimuthFormat
protected java.text.NumberFormat azimuthFormat
Number format used to create azimuth labels.
-
radiusFormat
protected java.text.NumberFormat radiusFormat
Number format used to create radius labels.
-
position
protected Position position
Position of the center of the range fan.
-
paths
protected java.util.List<Path> paths
Rings that make up the range fan.
-
arrowHead
protected SurfacePolygon arrowHead
Polygon to draw a filled arrow head on the Center Of Sector line.
-
symbol
protected TacticalSymbol symbol
Symbol drawn at the center of the range fan.
-
symbolAttributes
protected TacticalSymbolAttributes symbolAttributes
Attributes applied to the symbol.
-
radii
protected java.lang.Iterable<java.lang.Double> radii
Radii of the range fans, in meters.
-
azimuths
protected java.lang.Iterable<? extends Angle> azimuths
Azimuths of the range fans. The azimuths are specified in pairs, first the left azimuth, then the right azimuth.
-
altitudes
protected java.lang.Iterable<java.lang.String> altitudes
Altitudes of the range fans.
-
centerAzimuth
protected Angle centerAzimuth
Azimuth of the Center Of Sector arrow.
-
maxRadius
protected double maxRadius
Maximum radius in the range fan.
-
-
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.
-
getArrowAngle
public Angle getArrowAngle()
Indicates the angle of the arrowhead.- Returns:
- Angle of the arrowhead in the graphic.
-
setArrowAngle
public void setArrowAngle(Angle arrowAngle)
Specifies the angle of the arrowhead in the graphic.- Parameters:
arrowAngle- The angle of the arrowhead. Must be greater than zero degrees and less than 90 degrees.
-
getArrowLength
public double getArrowLength()
Indicates the length of the arrowhead.- Returns:
- The length of the arrowhead as a fraction of the total line length.
-
setArrowLength
public void setArrowLength(double arrowLength)
Specifies the length of the arrowhead.- Parameters:
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.
-
getCenterOfSectorLength
public double getCenterOfSectorLength()
Indicates the length of the Center Of Sector line.- Returns:
- The length of the Center Of Sector as a fraction of the final range fan radius.
-
setCenterOfSector
public void setCenterOfSector(double centerOfSectorLength)
Specifies the length of the Center Of Sector line.- Parameters:
centerOfSectorLength- Length of the Center Of Sector arrow as a fraction of the final range fan radius.
-
getIntervals
public int getIntervals()
Indicates the number of intervals used to draw the arc in this graphic.- Returns:
- Intervals used to draw arc.
-
setIntervals
public void setIntervals(int intervals)
Specifies the number of intervals used to draw the arc in this graphic. More intervals will result in a smoother looking arc.- Parameters:
intervals- Number of intervals for drawing the arc.
-
getAzimuthFormat
public java.text.NumberFormat getAzimuthFormat()
Indicates the number format applied to azimuth values to create the azimuth labels.- Returns:
- NumberFormat used to create azimuth labels.
-
setAzimuthFormat
public void setAzimuthFormat(java.text.NumberFormat azimuthFormat)
Specifies the number format applied to azimuth values to create the azimuth labels.- Parameters:
azimuthFormat- NumberFormat to create azimuth labels.
-
getRadiusFormat
public java.text.NumberFormat getRadiusFormat()
Indicates the number format applied to radius values to create the radius labels.- Returns:
- NumberFormat used to create radius labels.
-
setRadiusFormat
public void setRadiusFormat(java.text.NumberFormat radiusFormat)
Specifies the number format applied to radius values to create the radius labels.- Parameters:
radiusFormat- NumberFormat to create radius labels.
-
getPosition
public Position getPosition()
Indicates the center position of the range ran.- Returns:
- The range fan center position.
-
setPosition
public void setPosition(Position position)
Specifies the center position of the range ran.- Parameters:
position- The new center position.
-
setPositions
public void setPositions(java.lang.Iterable<? extends Position> positions)
Specifies the positions of the control points that place and orient the graphic.- Specified by:
setPositionsin interfaceTacticalGraphic- Parameters:
positions- Control points. This graphic uses only one control point, which determines the center of the circle.
-
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- Overrides:
setModifierin classAbstractMilStd2525TacticalGraphic- Parameters:
modifier- Key that identifies the modifier to set. The possible modifiers depends on the symbol set.value- New value for the modifier.
-
getModifier
public java.lang.Object getModifier(java.lang.String modifier)
Indicates the current value of a text or graphic modifier.- Specified by:
getModifierin interfaceTacticalGraphic- Overrides:
getModifierin classAbstractMilStd2525TacticalGraphic- 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.
-
getRadii
public java.lang.Iterable<java.lang.Double> getRadii()
Indicates the radii of the rings that make up the range fan.- Returns:
- List of radii, in meters. This method never returns null. If there are no rings this returns an empty list.
-
setRadii
public void setRadii(java.lang.Iterable<java.lang.Double> radii)
Specifies the radii of the rings that make up the range fan.- Parameters:
radii- List of radii, in meters. A circle will be created for each radius.
-
getAzimuths
public java.lang.Iterable<? extends Angle> getAzimuths()
Indicates the left and right azimuths of the fans in this graphic. The list contains pairs of azimuths, first left and then right.- Returns:
- Left and right azimuths, measured clockwise from North. This method never returns null. If there are no azimuths, returns an empty list.
-
setAzimuths
public void setAzimuths(java.lang.Iterable<? extends Angle> azimuths)
Specifies the left and right azimuths of the range fans in this graphic. The provided iterable must specify pairs of azimuths: first left azimuth, first right azimuth, second left, second right, etc.- Parameters:
azimuths- Left and right azimuths, measured clockwise from North.
-
getAltitudes
public java.lang.Iterable<java.lang.String> getAltitudes()
Indicates the altitudes of the rings that make up the range fan. Note that the range fan is always drawn on the surface. The altitude strings are displayed as text.- Returns:
- List of altitude strings. This method never returns null. If there are no altitudes, returns an empty list.
-
setAltitudes
public void setAltitudes(java.lang.Iterable<java.lang.String> altitudes)
Specifies the altitudes of the rings that make up the range fan. Note that the range fan is always drawn on the surface. The altitude strings are displayed as text.- Parameters:
altitudes- List of altitude strings.
-
getSymbol
public java.lang.String getSymbol()
Indicates a symbol drawn at the center of the range fan.- Returns:
- The identifier of a symbol drawn at the center of the range fan. May be null.
-
setSymbol
public void setSymbol(java.lang.String sidc)
Specifies a symbol to draw at the center of the range fan. Equivalent to setting theSymbologyConstants.SYMBOL_INDICATORmodifier. The symbol's position will be changed to match the range fan center position.- Parameters:
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.
-
getPositions
public java.lang.Iterable<? extends Position> getPositions()
Indicates the positions of the control points that place and orient the graphic.- Specified by:
getPositionsin interfaceTacticalGraphic- 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.- Specified by:
getReferencePositionin interfaceMovable- Returns:
- the object's reference position, or null if no reference position is available.
-
preRender
public void preRender(DrawContext dc)
- Specified by:
preRenderin interfacePreRenderable
-
doRenderGraphic
protected void doRenderGraphic(DrawContext dc)
Render the polygon.- Specified by:
doRenderGraphicin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.- See Also:
AbstractTacticalGraphic.doRenderTextModifiers(gov.nasa.worldwind.render.DrawContext),AbstractTacticalGraphic.doRenderGraphicModifiers(gov.nasa.worldwind.render.DrawContext)
-
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. Overridden to render symbol at the center of the range fan.- Overrides:
doRenderGraphicModifiersin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.
-
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:
applyDelegateOwnerin classAbstractTacticalGraphic- Parameters:
owner- Current delegate owner.
-
reset
protected void reset()
Regenerate the graphics positions on the next frame.
-
createShapes
protected void createShapes(DrawContext dc)
Create the paths required to draw the graphic.- Parameters:
dc- Current draw context.
-
createCenterOfSectorArrow
protected void createCenterOfSectorArrow(DrawContext dc, Angle centerAzimuth, double finalRadius)
Create shapes to draw the Center Of Sector arrow. This arrow bisects the final range fan.- Parameters:
dc- Current draw context.centerAzimuth- Azimuth of the Center Of Sector arrow.finalRadius- Radius, in meters, of the final range fan.
-
computeCenterSectorAngle
protected Angle computeCenterSectorAngle(Angle finalLeftAzimuth, Angle finalRightAzimuth)
Compute the angle of the Center Of Sector line. The center sector angle is computed as the average of the left and right azimuths of the last range fan in the graphic. MIL-STD-2525C does not specify how this angle should be computed, but the graphic template (pg. 693) suggests that the Center Of Sector line should bisect the last range fan arc.- Parameters:
finalLeftAzimuth- Left azimuth of the last range fan in the graphic.finalRightAzimuth- Right azimuth of the last range fan in the graphic.- Returns:
- Azimuth, from North, of the Center Of Sector line.
-
createArc
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. The arc is described by a radius, left azimuth, and right azimuth. The arc positions are added onto an existing list of positions, in left to right order (the arc draws from the left azimuth to the right azimuth).If the left and right azimuths are equal, then this methods adds a single position to the list at the desired azimuth and radius.
- Parameters:
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.
-
computeArrowheadPositions
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.- Parameters:
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.- Returns:
- Positions required to draw the arrow head.
-
createLabels
protected void createLabels()
Create labels for the start and end of the path.- Overrides:
createLabelsin classAbstractTacticalGraphic
-
createAzimuthLabels
protected void createAzimuthLabels()
Create azimuth labels.
-
createRangeLabelString
protected java.lang.String createRangeLabelString(double radius, java.lang.String altitude)Create text for a range label.- Parameters:
radius- Range of the ring, in meters.altitude- Altitude string.- Returns:
- Range label text for this ring.
-
createAzimuthLabelString
protected java.lang.String createAzimuthLabelString(Angle azimuth)
Create text for an azimuth label.- Parameters:
azimuth- Azimuth, measured clockwise from North.- Returns:
- Azimuth label text.
-
determineLabelPositions
protected void determineLabelPositions(DrawContext dc)
Determine positions for the start and end labels.- Overrides:
determineLabelPositionsin classAbstractTacticalGraphic- Parameters:
dc- Current draw context.
-
computeAzimuthLabelOffset
protected double computeAzimuthLabelOffset(double radius, double maxRadius)Compute an angular offset to apply to a azimuth label. This angle will be added to the azimuth of the label's azimuth in order to place the label a little bit to the side of the line that it applies to.- Parameters:
radius- Radius at which the label will be placed.maxRadius- Maximum radius in the range fan.- Returns:
- Angle, in radians, to add to the range fan azimuth in order to determine the label position.
-
determineRangeLabelPosition
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. The method finds a point to either the left or right of the center line, depending on which has more space for the label.- Parameters:
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.- Returns:
- Position for the range label on this ring.
-
normalizeAzimuth
protected Angle normalizeAzimuth(Angle azimuth)
Normalize an azimuth angle to the range [-180:180] degrees.- Parameters:
azimuth- Azimuth to normalize.- Returns:
- Normalized azimuth. Returns null if
azimuthis null.
-
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. Overridden to turn on shape interiors.- Overrides:
applyDefaultAttributesin classAbstractMilStd2525TacticalGraphic- Parameters:
attributes- Attributes bundle to receive defaults.
-
determineActiveAttributes
protected void determineActiveAttributes()
Determine active attributes for this frame. Overridden to update symbol attributes.- Overrides:
determineActiveAttributesin classAbstractTacticalGraphic
-
createPath
protected Path createPath(java.util.List<Position> positions)
Create and configure the Path used to render this graphic.- Parameters:
positions- Positions that define the path.- Returns:
- New path configured with defaults appropriate for this type of graphic.
-
createPolygon
protected SurfacePolygon createPolygon()
Create and configure a SurfacePolygon to render the arrow head on the sector center line.- Returns:
- New surface polygon.
-
-