Class TaskColorer

  • All Implemented Interfaces:
    Colorer<Gtu>, GtuColorer

    public class TaskColorer
    extends Object
    implements GtuColorer
    Colorer for task demand with anticipation reliance indicated by interpolating towards white, for a specific task.

    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 30 jan. 2019
    Author:
    Alexander Verbraeck, Peter Knoppers, Wouter Schakel
    • Constructor Detail

      • TaskColorer

        public TaskColorer​(String id)
        Constructor.
        Parameters:
        id - String; id
    • Method Detail

      • getColor

        public Color getColor​(Gtu gtu)
        Get the color, based on the Drawable object.
        Specified by:
        getColor in interface Colorer<Gtu>
        Parameters:
        gtu - D; the object to determine the color for
        Returns:
        the (fill, line) color of the drawable object
      • getLegend

        public 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:
        getLegend in interface GtuColorer
        Returns:
        List<LegendEntry>; the list of legend entries; the caller should not (try to) modify this List