Class DrawingInfoLine<D extends org.opentrafficsim.core.animation.Drawable>

java.lang.Object
org.opentrafficsim.core.animation.DrawingInfoLine<D>
Type Parameters:
D - The drawable type for which this is the DrawingInfo
All Implemented Interfaces:
DrawingInfo
Direct Known Subclasses:
DrawingInfoStripe

public class DrawingInfoLine<D extends org.opentrafficsim.core.animation.Drawable> extends Object implements DrawingInfo
DrawingInfoLine stores the drawing information about a line. This can be interpreted by a visualization or animation class.

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

Author:
Alexander Verbraeck
  • Constructor Details

    • DrawingInfoLine

      public DrawingInfoLine()
      Create an empty DrawingInfo object for a line.
    • DrawingInfoLine

      public DrawingInfoLine(Color lineColor, float lineWidth)
      Create a DrawingInfo object for a line.
      Parameters:
      lineColor - Color; the line color
      lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
    • DrawingInfoLine

      public DrawingInfoLine(Colorer<D> lineColorer, float lineWidth)
      Create a DrawingInfo object for a line.
      Parameters:
      lineColorer - Colorer<D>; the line colorer
      lineWidth - float; the line width, which could be relative and is open for interpretation by the visualization or animation class
  • Method Details

    • getLineColor

      public final Color getLineColor(D drawable)
      The returned color could be dependent on the state of the object representing the line. E.g., it turns red under certain circumstances.
      Parameters:
      drawable - D; the object that could influence the color of the line
      Returns:
      the color of the line
    • setLineColor

      public final void setLineColor(Color lineColor)
      Set the line color using a FixedColorer.
      Parameters:
      lineColor - Color; lineColor to set
    • setLineColorer

      public final void setLineColorer(Colorer<D> lineColorer)
      Set the line colorer.
      Parameters:
      lineColorer - Colorer<D>; lineColorer to set
    • getLineWidth

      public final float getLineWidth()
      Returns:
      lineWidth
    • setLineWidth

      public final void setLineWidth(float lineWidth)
      Parameters:
      lineWidth - float; lineWidth to set