Class ArrowPaintHelper

java.lang.Object
org.openstreetmap.josm.data.osm.visitor.paint.ArrowPaintHelper

public class ArrowPaintHelper extends Object
This class helps with painting arrows with fixed length along a path.
Since:
10827
  • Field Details

    • sin

      private final double sin
    • cos

      private final double cos
    • length

      private final double length
  • Constructor Details

    • ArrowPaintHelper

      public ArrowPaintHelper(double radians, double length)
      Creates a new arrow helper.
      Parameters:
      radians - The angle of the arrow. 0 means that it lies on the current line. In radians
      length - The length of the arrow lines.
  • Method Details

    • paintArrowAt

      public void paintArrowAt(MapPath2D path, MapViewState.MapViewPoint point, MapViewState.MapViewPoint fromDirection)
      Paint the arrow
      Parameters:
      path - The path to append the arrow to.
      point - The point to paint the tip at
      fromDirection - The direction the line is coming from.
    • getOnLineLength

      public double getOnLineLength()
      Gets the length of the arrow along the line segment.
      Returns:
      the length along the line
      Since:
      12154