Class GtuTypeColorer

    • Field Detail

      • DEFAULT

        public static final GtuTypeColorer DEFAULT
        Default instance with colors for common GTUTypes.
    • Constructor Detail

      • GtuTypeColorer

        public GtuTypeColorer()
    • Method Detail

      • add

        public GtuTypeColorer add​(GtuType.DEFAULTS gtuTypeEnum)
        Adds a GTU type to the list with color from the default list.
        Parameters:
        gtuTypeEnum - GtuType.DEFAULTS; GTU type
        Returns:
        this GTUTypeColorer
      • add

        public GtuTypeColorer add​(GtuType gtuType)
        Adds a GTU type to the list with color based on the type.
        Parameters:
        gtuType - GtuType; GTU type
        Returns:
        this GTUTypeColorer
      • add

        public GtuTypeColorer add​(GtuType gtuType,
                                  Color color)
        Adds a GTU type to the list with given color.
        Parameters:
        gtuType - GtuType; GTU type
        color - Color; color
        Returns:
        this GTUTypeColorer
      • add

        public GtuTypeColorer add​(GtuType.DEFAULTS gtuTypeEnum,
                                  Color color)
        Adds a GTU type based on its enum to the list with given color.
        Parameters:
        gtuTypeEnum - GtuType.DEFAULTS; GTU type default enum
        color - Color; color
        Returns:
        this GTUTypeColorer
      • 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