Class SpeedGTUColorer
- java.lang.Object
-
- org.opentrafficsim.core.animation.gtu.colorer.SpeedGTUColorer
-
- All Implemented Interfaces:
Serializable,Colorer<GTU>,GTUColorer
public class SpeedGTUColorer extends Object implements GTUColorer, Serializable
Color GTU depending on their speed.Copyright (c) 2013-2022 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.- Version:
- $Revision: 4763 $, $LastChangedDate: 2018-11-19 11:04:56 +0100 (Mon, 19 Nov 2018) $, by $Author: averbraeck $,
initial version 27 mei 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.opentrafficsim.core.animation.gtu.colorer.GTUColorer
GTUColorer.LegendEntry
-
-
Constructor Summary
Constructors Constructor Description SpeedGTUColorer(Speed maximumSpeed)Construct a new SpeedGTUColorer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ColorgetColor(GTU gtu)Get the color, based on the Drawable object.List<GTUColorer.LegendEntry>getLegend()Return a list of legend entries (useful to make a legend of the colors used to render the GTUs).StringtoString()
-
-
-
Constructor Detail
-
SpeedGTUColorer
public SpeedGTUColorer(Speed maximumSpeed)
Construct a new SpeedGTUColorer.- Parameters:
maximumSpeed- Speed; the speed at (and above) which the returned color will be green
-
-
Method Detail
-
getLegend
public final List<GTUColorer.LegendEntry> getLegend()
Return a list of legend entries (useful to make a legend of the colors used to render the GTUs).- Specified by:
getLegendin interfaceGTUColorer- Returns:
- List<LegendEntry>; the list of legend entries; the caller should not (try to) modify this List
-
-