public class GTUTypeColorer extends Object implements GTUColorer, Serializable
Copyright (c) 2013-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
GTUColorer.LegendEntry| Modifier and Type | Field and Description |
|---|---|
static GTUTypeColorer |
DEFAULT
Default instance with colors for common GTUTypes.
|
| Constructor and Description |
|---|
GTUTypeColorer() |
| Modifier and Type | Method and Description |
|---|---|
GTUTypeColorer |
add(GTUType gtuType)
Adds a GTU type to the list with color from a default list.
|
GTUTypeColorer |
add(GTUType gtuType,
Color color)
Adds a GTU type to the list with given color.
|
Color |
getColor(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).
|
String |
toString() |
public static final GTUTypeColorer DEFAULT
public GTUTypeColorer add(GTUType gtuType)
gtuType - GTUType; GTU typepublic GTUTypeColorer add(GTUType gtuType, Color color)
gtuType - GTUType; GTU typecolor - Color; colorpublic List<GTUColorer.LegendEntry> getLegend()
getLegend in interface GTUColorerCopyright © 2014–2019 Delft University of Technology. All rights reserved.