Class PaintLine

java.lang.Object
org.opentrafficsim.draw.PaintLine

public final class PaintLine extends Object
Paint a line as a Path2D.Double

Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Peter Knoppers, Wouter Schakel
  • Method Details

    • getPath

      public static Path2D.Float getPath(org.djutils.draw.line.PolyLine2d line)
      Returns drawable path of the line.
      Parameters:
      line - PolyLine2d; array of points
      Returns:
      Path2D.Float drawable path.
    • getPath

      public static Path2D.Float getPath(org.djutils.draw.point.Point2d referencePoint, org.djutils.draw.line.PolyLine2d line)
      Returns drawable path of the line.
      Parameters:
      referencePoint - Point2d; the reference point
      line - PolyLine2d; array of points
      Returns:
      Path2D.Float drawable path.
    • getPath

      public static Path2D.Float getPath(org.djutils.draw.point.OrientedPoint2d referencePoint, org.djutils.draw.line.PolyLine2d line)
      Returns drawable path of the line.
      Parameters:
      referencePoint - OrientedPoint2d; the reference point
      line - PolyLine2d; array of points
      Returns:
      Path2D.Float drawable path.
    • paintLine

      public static void paintLine(Graphics2D graphics, Color color, double width, Path2D.Float path)
      Paint line.
      Parameters:
      graphics - Graphics2D; the graphics environment
      color - Color; the color to use
      width - double; the width to use
      path - Path2D.Float; drawable path