Class DesiredSpeedColorer

    • Constructor Summary

      Constructors 
      Constructor Description
      DesiredSpeedColorer​(Speed minimumSpeed, Speed maximumSpeed)
      Construct a new SpeedGTUColorer.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.Color getColor​(GTU gtu)
      Get the color, based on the Drawable object.
      java.util.List<GTUColorer.LegendEntry> getLegend()
      Return a list of legend entries (useful to make a legend of the colors used to render the GTUs).
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DesiredSpeedColorer

        public DesiredSpeedColorer​(Speed minimumSpeed,
                                   Speed maximumSpeed)
        Construct a new SpeedGTUColorer.
        Parameters:
        minimumSpeed - Speed; the speed at (and below) which the returned color will be red
        maximumSpeed - Speed; the speed at (and above) which the returned color will be green
    • Method Detail

      • getColor

        public final java.awt.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 final java.util.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
      • toString

        public final java.lang.String toString()
        Overrides:
        toString in class java.lang.Object