Class AbstractAxisArrow

    • Field Detail

      • paths

        protected Path[] paths
        Path used to render the line.
      • positions

        protected java.lang.Iterable<? extends Position> positions
        Control points that define the shape.
      • arrowPositions

        protected java.util.List<? extends Position> arrowPositions
        Positions computed from the control points, used to draw the arrow path.
      • finalPointWidthOfRoute

        protected boolean finalPointWidthOfRoute
        Indicates whether the final control point marks the width of the route or the width of the arrowhead. Default is the width of the arrowhead.
    • Constructor Detail

      • AbstractAxisArrow

        public AbstractAxisArrow​(java.lang.String sidc)
        Create a new arrow graphic.
        Parameters:
        sidc - Symbol code the identifies the graphic.
      • AbstractAxisArrow

        public AbstractAxisArrow​(java.lang.String sidc,
                                 int numPaths)
        Create a new arrow graphic made up of more than one path. This constructor allocates the paths, and creates the requested number of paths. The first element in the array is the main path that outlines the arrow. Subclasses are responsible for configuring the other paths.
        Parameters:
        sidc - Symbol code the identifies the graphic.
        numPaths - Number of paths to create.
    • Method Detail

      • 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.
      • 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 class AbstractTacticalGraphic
        Parameters:
        owner - Current delegate owner.
      • isFinalPointWidthOfRoute

        public boolean isFinalPointWidthOfRoute()
        Indicates whether or not the final control point marks the width of the arrowhead or the width of the route. MIL-STD-2525C specifies that the final control point marks the edge of the arrow (pg. 517), and this is the default. However, some applications may prefer to specify the width of the route rather than the width of the arrowhead. In the diagram below, the default behavior is for the final control point to specify point A. When finalPointWidthOfRoute is true the final control point specifies point B instead.
                         A
                         |\
                         | \
         ----------------|  \
                         B   \
                             /
         ----------------|  /
                         | /
                         |/
         
        Returns:
        True if the final control point determines the width of the route instead of the width of the arrow head (point B in the diagram above).
      • setFinalPointWidthOfRoute

        public void setFinalPointWidthOfRoute​(boolean finalPointIsWidthOfRoute)
        Specifies whether or not the final control point marks the edge of the arrow head or the width of the route. See isFinalPointWidthOfRoute() for details.
        Parameters:
        finalPointIsWidthOfRoute - True if the final control point determines the width of the route instead of the width of the arrow head.
      • createShapePositions

        protected void createShapePositions​(DrawContext dc)
        Create the list of positions that describe the arrow.
        Parameters:
        dc - Current draw context.
      • createArrowHeadPositions

        protected double createArrowHeadPositions​(java.util.List<Position> leftPositions,
                                                  java.util.List<Position> rightPositions,
                                                  java.util.List<Position> arrowHeadPositions,
                                                  Globe globe)
        Create positions that make up the arrow head.

        The arrow head is defined by the first two control points, and the last point. Pt. 1' is the point on the center line at the base of the arrow head, and Pt. N' is the reflection of Pt. N about the center line.

                         Pt N
                         |\
         Left line       | \
         ----------------|  \
         Pt 2        Pt 1'   \ Pt 1
                             /
         ----------------|  /
         Right line      | /
                         |/Pt N'
         
        Parameters:
        leftPositions - List to collect positions on the left arrow line. This list receives the position where the left line meets the arrow head.
        rightPositions - List to collect positions on the right arrow line. This list receives the position where the right line meets the arrow head.
        arrowHeadPositions - List to collect positions that make up the arrow head. This list receives positions for Pt. N, Pt. 1, and Pt. N', in that order.
        globe - Current globe.
        Returns:
        The distance from the center line to the left and right lines.
      • createLinePositions

        protected void createLinePositions​(java.util.List<Position> leftPositions,
                                           java.util.List<Position> rightPositions,
                                           double halfWidth,
                                           Globe globe)
        Create positions that make up the left and right arrow lines.
        Parameters:
        leftPositions - List to collect positions on the left line.
        rightPositions - List to collect positions on the right line.
        halfWidth - Distance from the center line to the left or right lines. Half the width of the arrow's double lines.
        globe - Current globe.
      • createPath

        protected Path createPath()
        Create and configure the Path used to render this graphic.
        Returns:
        New path configured with defaults appropriate for this type of graphic.