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 Summary
ConstructorsConstructorDescriptionCreate an empty DrawingInfo object for a line.DrawingInfoLine(Color lineColor, float lineWidth) Create a DrawingInfo object for a line.DrawingInfoLine(Colorer<D> lineColorer, float lineWidth) Create a DrawingInfo object for a line. -
Method Summary
Modifier and TypeMethodDescriptionfinal ColorgetLineColor(D drawable) The returned color could be dependent on the state of the object representing the line.final floatfinal voidsetLineColor(Color lineColor) Set the line color using a FixedColorer.final voidsetLineColorer(Colorer<D> lineColorer) Set the line colorer.final voidsetLineWidth(float lineWidth)
-
Constructor Details
-
DrawingInfoLine
public DrawingInfoLine()Create an empty DrawingInfo object for a line. -
DrawingInfoLine
Create a DrawingInfo object for a line.- Parameters:
lineColor- Color; the line colorlineWidth- float; the line width, which could be relative and is open for interpretation by the visualization or animation class
-
DrawingInfoLine
Create a DrawingInfo object for a line.- Parameters:
lineColorer- Colorer<D>; the line colorerlineWidth- float; the line width, which could be relative and is open for interpretation by the visualization or animation class
-
-
Method Details
-
getLineColor
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
Set the line color using a FixedColorer.- Parameters:
lineColor- Color; lineColor to set
-
setLineColorer
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
-