Class DirectedSurfacePolyline

    • Field Detail

      • DEFAULT_ARROW_LENGTH

        public static final double DEFAULT_ARROW_LENGTH
        Default arrow length, in meters.
        See Also:
        Constant Field Values
      • DEFAULT_ARROW_ANGLE

        public static final Angle DEFAULT_ARROW_ANGLE
        Default arrow angle.
      • DEFAULT_MAX_SCREEN_SIZE

        public static final double DEFAULT_MAX_SCREEN_SIZE
        Default maximum screen size of the arrowheads, in pixels.
        See Also:
        Constant Field Values
      • arrowLength

        protected double arrowLength
        The length, in meters, of the arrowhead, from tip to base.
      • arrowAngle

        protected Angle arrowAngle
        The angle of the arrowhead tip.
      • maxScreenSize

        protected double maxScreenSize
        The maximum screen size, in pixels, of the direction arrowheads.
    • Constructor Detail

      • DirectedSurfacePolyline

        public DirectedSurfacePolyline()
        Constructs a new directed surface polyline with the default attributes and no locations.
      • DirectedSurfacePolyline

        public DirectedSurfacePolyline​(DirectedSurfacePolyline source)
        Creates a shallow copy of the specified source shape.
        Parameters:
        source - the shape to copy.
      • DirectedSurfacePolyline

        public DirectedSurfacePolyline​(ShapeAttributes normalAttrs)
        Constructs a new directed surface polyline with the specified normal (as opposed to highlight) attributes and no locations. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.
        Parameters:
        normalAttrs - the normal attributes. May be null, in which case default attributes are used.
      • DirectedSurfacePolyline

        public DirectedSurfacePolyline​(java.lang.Iterable<? extends LatLon> iterable)
        Constructs a new directed surface polyline with the default attributes and the specified iterable of locations.

        Note: If fewer than two locations is specified, no polyline is drawn.

        Parameters:
        iterable - the polyline locations.
        Throws:
        java.lang.IllegalArgumentException - if the locations iterable is null.
      • DirectedSurfacePolyline

        public DirectedSurfacePolyline​(ShapeAttributes normalAttrs,
                                       java.lang.Iterable<? extends LatLon> iterable)
        Constructs a new directed surface polyline with the specified normal (as opposed to highlight) attributes and the specified iterable of locations. Modifying the attribute reference after calling this constructor causes this shape's appearance to change accordingly.

        Note: If fewer than two locations is specified, no polyline is drawn.

        Parameters:
        normalAttrs - the normal attributes. May be null, in which case default attributes are used.
        iterable - the polyline locations.
        Throws:
        java.lang.IllegalArgumentException - if the locations iterable is null.
    • Method Detail

      • getArrowLength

        public double getArrowLength()
        Indicates the length, in meters, of the direction arrowheads, from base to tip.
        Returns:
        The geographic length of the direction arrowheads.
      • setArrowLength

        public void setArrowLength​(double arrowLength)
        Specifies the length, in meters, of the direction arrowheads, from base to tip.
        Parameters:
        arrowLength - length, in meters, of the direction arrowheads. The length must be greater than zero.
      • getMaxScreenSize

        public double getMaxScreenSize()
        Indicates the maximum screen size, in pixels, of the direction arrowheads. The arrowheads are drawn a fixed geographic, but they are not allowed to get bigger than maxScreenSize pixels.
        Returns:
        The maximum screen size, in pixels, of the direction arrowheads, measured tip to base.
      • setMaxScreenSize

        public void setMaxScreenSize​(double maxScreenSize)
        Specifies the maximum screen size, in pixels, of the direction arrowheads. The arrowheads are drawn at a fixed geographic size, but they will not allowed to get bigger than maxScreenSize pixels.
        Parameters:
        maxScreenSize - the maximum screen size, in pixels, of the direction arrowheads, measured tip to base.
      • getArrowAngle

        public Angle getArrowAngle()
        Indicates the angle of the direction arrowheads. A larger angle draws a fat arrowhead, and a smaller angle draws a narrow arrow head.
        Returns:
        The angle of the direction arrowhead tip.
      • setArrowAngle

        public void setArrowAngle​(Angle arrowAngle)
        Specifies the angle of the direction arrowheads. A larger angle draws a fat arrowhead, and a smaller angle draws a narrow arrow.
        Parameters:
        arrowAngle - angle of the direction arrowhead tip. Valid values are between 0 degrees and 90 degrees.
      • drawOutline

        protected void drawOutline​(DrawContext dc,
                                   SurfaceTileDrawContext sdc)

        Overridden to also draw direction arrows.

        Overrides:
        drawOutline in class AbstractSurfaceShape
        Parameters:
        dc - the current draw context.
        sdc - the context containing a geographic region and screen viewport corresponding to a surface tile.
      • computeArrowheadGeometry

        protected void computeArrowheadGeometry​(DrawContext dc,
                                                SurfaceTileDrawContext sdc,
                                                LatLon begin,
                                                LatLon end)
        Compute the geometry of a direction arrow for a polyline segment.
        Parameters:
        dc - the current draw context.
        sdc - the context containing a geographic region and screen viewport corresponding to a surface tile.
        begin - the polyline segment's beginning location.
        end - the polyline segment's ending location.