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

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

public class DrawingInfoShape<D extends org.opentrafficsim.core.animation.Drawable> extends Object implements DrawingInfo
DrawingInfoLine stores the drawing information about a shape. 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

    • DrawingInfoShape

      public DrawingInfoShape()
      Create an empty DrawingInfo object for a shape.
    • DrawingInfoShape

      public DrawingInfoShape(Color lineColor, float lineWidth)
      Create a DrawingInfo object for a shape that is not filled.
      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
    • DrawingInfoShape

      public DrawingInfoShape(Color lineColor, float lineWidth, Color fillColor)
      Create a DrawingInfo object for a shape that is filled, with a contour 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
      fillColor - Color; the fill color
    • DrawingInfoShape

      public DrawingInfoShape(Color fillColor)
      Create a DrawingInfo object for a shape that is filled, without a contour line.
      Parameters:
      fillColor - Color; the fill color
    • DrawingInfoShape

      public DrawingInfoShape(Colorer<D> lineColorer, float lineWidth)
      Create a DrawingInfo object for a shape that is not filled.
      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
    • DrawingInfoShape

      public DrawingInfoShape(Colorer<D> lineColorer, float lineWidth, Colorer<D> fillColorer)
      Create a DrawingInfo object for a shape that is filled, with a contour 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
      fillColorer - Colorer<D>; the fill colorer
    • DrawingInfoShape

      public DrawingInfoShape(Colorer<D> fillColorer)
      Create a DrawingInfo object for a shape that is filled, without a contour line.
      Parameters:
      fillColorer - Colorer<D>; the fill colorer
  • Method Details

    • getFillColor

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

      public final void setFillColor(Color fillColor)
      Set the fill color using a FixedColorer.
      Parameters:
      fillColor - Color; fillColor to set
    • setFillColorer

      public final void setFillColorer(Colorer<D> fillColorer)
      Set the fill colorer.
      Parameters:
      fillColorer - Colorer<D>; fillColorer to set
    • 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; set lineWidth
    • isFilled

      public final boolean isFilled()
      Returns:
      filled
    • setFilled

      public final void setFilled(boolean filled)
      Parameters:
      filled - boolean; set filled
    • isStroked

      public final boolean isStroked()
      Returns:
      stroked
    • setStroked

      public final void setStroked(boolean stroked)
      Parameters:
      stroked - boolean; set stroked