Class FixedColorer<D extends Drawable>

  • Type Parameters:
    D - the Drawable type
    All Implemented Interfaces:
    Colorer<D>

    public class FixedColorer<D extends Drawable>
    extends java.lang.Object
    implements Colorer<D>
    FixedColorer stores a fixed color for drawing.

    Copyright (c) 2003-2020 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl. The source code and binary code of this software is proprietary information of Delft University of Technology.
    Author:
    Alexander Verbraeck
    • Constructor Detail

      • FixedColorer

        protected FixedColorer​(java.awt.Color color)
        Initialize the FixedColorer with a color.
        Parameters:
        color - Color; the fixed color to use
    • Method Detail

      • getColor

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

        public static <D extends Drawable> FixedColorer<D> create​(java.awt.Color color)
        Instantiate a singleton fixed colorer for a certain color.
        Type Parameters:
        D - the Drawable type
        Parameters:
        color - Color; the fixed color to use
        Returns:
        the FixedColorer
      • black

        public static <D extends Drawable> FixedColorer<D> black()
        Type Parameters:
        D - the Drawable type
        Returns:
        black color
      • blue

        public static <D extends Drawable> FixedColorer<D> blue()
        Type Parameters:
        D - the Drawable type
        Returns:
        blue color
      • cyan

        public static <D extends Drawable> FixedColorer<D> cyan()
        Type Parameters:
        D - the Drawable type
        Returns:
        cyan color
      • darkGray

        public static <D extends Drawable> FixedColorer<D> darkGray()
        Type Parameters:
        D - the Drawable type
        Returns:
        darkGray color
      • gray

        public static <D extends Drawable> FixedColorer<D> gray()
        Type Parameters:
        D - the Drawable type
        Returns:
        gray color
      • green

        public static <D extends Drawable> FixedColorer<D> green()
        Type Parameters:
        D - the Drawable type
        Returns:
        green color
      • lightGray

        public static <D extends Drawable> FixedColorer<D> lightGray()
        Type Parameters:
        D - the Drawable type
        Returns:
        lightGray color
      • magenta

        public static <D extends Drawable> FixedColorer<D> magenta()
        Type Parameters:
        D - the Drawable type
        Returns:
        magenta color
      • orange

        public static <D extends Drawable> FixedColorer<D> orange()
        Type Parameters:
        D - the Drawable type
        Returns:
        orange color
      • pink

        public static <D extends Drawable> FixedColorer<D> pink()
        Type Parameters:
        D - the Drawable type
        Returns:
        pink color
      • red

        public static <D extends Drawable> FixedColorer<D> red()
        Type Parameters:
        D - the Drawable type
        Returns:
        red color
      • white

        public static <D extends Drawable> FixedColorer<D> white()
        Type Parameters:
        D - the Drawable type
        Returns:
        white color
      • yellow

        public static <D extends Drawable> FixedColorer<D> yellow()
        Type Parameters:
        D - the Drawable type
        Returns:
        yellow color