Class IDGTUColorer
java.lang.Object
org.opentrafficsim.core.animation.gtu.colorer.IDGTUColorer
- All Implemented Interfaces:
Colorer<GTU>,GTUColorer
public class IDGTUColorer extends Object implements GTUColorer
Color GTUs based on their id. If the id ends on one or more digits, the value that those digits constitute is used.
Otherwise, the hash code of the string representation of the id is used.
Copyright (c) 2013-2020 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 28 mei 2015
- Author:
- Alexander Verbraeck, Peter Knoppers
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opentrafficsim.core.animation.gtu.colorer.GTUColorer
GTUColorer.LegendEntry -
Field Summary
Fields Modifier and Type Field Description static ArrayList<GTUColorer.LegendEntry>LEGENDThe legend. -
Constructor Summary
Constructors Constructor Description IDGTUColorer() -
Method Summary
-
Field Details
-
LEGEND
The legend.
-
-
Constructor Details
-
IDGTUColorer
public IDGTUColorer()
-
-
Method Details
-
getColor
Get the color, based on the Drawable object. -
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
-
toString
-