Class DesireColorer
- java.lang.Object
-
- org.opentrafficsim.road.gtu.colorer.DesireColorer
-
- All Implemented Interfaces:
Serializable,Colorer<Gtu>,GtuColorer
- Direct Known Subclasses:
IncentiveColorer,TotalDesireColorer
public abstract class DesireColorer extends Object implements GtuColorer, Serializable
Super class with default coloring of left and right desire value.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$, $LastChangedDate$, by $Author$, initial version 13 apr. 2017
- Author:
- Alexander Verbraeck, Peter Knoppers, Wouter Schakel
- 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 DesireColorer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ColorgetColor(double dLeft, double dRight)Returns a color based on desire.List<GtuColorer.LegendEntry>getLegend()Return a list of legend entries (useful to make a legend of the colors used to render the GTUs).
-
-
-
Field Detail
-
NA
protected static final Color NA
N/A color.
-
-
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
-
getColor
protected final Color getColor(double dLeft, double dRight)
Returns a color based on desire.- Parameters:
dLeft- double; left desiredRight- double; right desire- Returns:
- color based on desire
-
-