Class Color

java.lang.Object
real_time_traffic_simulation_with_java.alias.Color

public final class Color extends Object
Utility classs: Stores all the sumo color code definitions to prevent user from generting so many color types, thus make the code easier to look and fix.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final de.tudresden.sumo.objects.SumoColor
    Sumo Color(0,0,0,0)
    static final de.tudresden.sumo.objects.SumoColor
    Sumo Color(0,0,255,0)
    static final javafx.scene.paint.Color
    Color to draw congested road
    static final de.tudresden.sumo.objects.SumoColor
    Sumo Color(0,255,0,0)
    static final javafx.scene.paint.Color
    Color to draw lane divider
    static final List<String>
    List of all color names that user can choose for the vehicle
    static final de.tudresden.sumo.objects.SumoColor
    Sumo Color(255,0,0,0)
    static final javafx.scene.paint.Color
    Color to draw road
    static final javafx.scene.paint.Color
    Color to draw road border
    static final de.tudresden.sumo.objects.SumoColor
    Sumo Color(255,255,255,0)
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Check if a given color name is valid and return color name (return WHITE if invalid)
    static String
    colorToString(de.tudresden.sumo.objects.SumoColor color)
    Convert SumoColor to its String representation, WHITE is default for unknown colors
    static de.tudresden.sumo.objects.SumoColor
    stringToColor(String colorName)
    Convert String representation of color to SumoColor, WHITE is default for invalid input or unknown colors

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ROAD

      public static final javafx.scene.paint.Color ROAD
      Color to draw road
    • ROAD_BORDER

      public static final javafx.scene.paint.Color ROAD_BORDER
      Color to draw road border
    • LANE_DIVIDER

      public static final javafx.scene.paint.Color LANE_DIVIDER
      Color to draw lane divider
    • CONGESTED_ROAD

      public static final javafx.scene.paint.Color CONGESTED_ROAD
      Color to draw congested road
    • RED

      public static final de.tudresden.sumo.objects.SumoColor RED
      Sumo Color(255,0,0,0)
    • BLUE

      public static final de.tudresden.sumo.objects.SumoColor BLUE
      Sumo Color(0,0,255,0)
    • GREEN

      public static final de.tudresden.sumo.objects.SumoColor GREEN
      Sumo Color(0,255,0,0)
    • BLACK

      public static final de.tudresden.sumo.objects.SumoColor BLACK
      Sumo Color(0,0,0,0)
    • WHITE

      public static final de.tudresden.sumo.objects.SumoColor WHITE
      Sumo Color(255,255,255,0)
    • ListofAllColor

      public static final List<String> ListofAllColor
      List of all color names that user can choose for the vehicle
  • Method Details

    • colorToString

      public static String colorToString(de.tudresden.sumo.objects.SumoColor color)
      Convert SumoColor to its String representation, WHITE is default for unknown colors
      Parameters:
      color - SumoColor instance
    • stringToColor

      public static de.tudresden.sumo.objects.SumoColor stringToColor(String colorName)
      Convert String representation of color to SumoColor, WHITE is default for invalid input or unknown colors
      Parameters:
      colorName - Name of the color
    • checkAvailableColor

      public static String checkAvailableColor(String colorName)
      Check if a given color name is valid and return color name (return WHITE if invalid)
      Parameters:
      colorName - Name of the color