View Javadoc
1   package org.opentrafficsim.swing.gui;
2   
3   import java.awt.Color;
4   
5   /**
6    * Contains a background color, foreground color and a font name, to be set throughout all components.
7    * <p>
8    * Copyright (c) 2013-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
9    * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
10   * </p>
11   * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
12   * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
13   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
14   */
15  public enum Appearance
16  {
17  
18      /** MOTUS mimic. Grid and nodes not visible. */
19      MOTUS("Motus", new Color(236, 233, 216), Color.BLACK, Color.BLACK, "Verdana"),
20  
21      /** Green. */
22      FOSIM("Fosim", new Color(240, 240, 240), Color.BLACK, new Color(0, 128, 0), "Dialog"),
23  
24      /** Dark. */
25      DARK("Dark", new Color(96, 96, 96), Color.WHITE, Color.DARK_GRAY, "Dialog"),
26  
27      /** Gray. */
28      GRAY("Gray", Color.LIGHT_GRAY, Color.BLACK, new Color(96, 96, 96), "Dialog"),
29  
30      /** Bright. */
31      BRIGHT("Bright", Color.LIGHT_GRAY, Color.BLACK, Color.WHITE, "Dialog"),
32  
33      /** Legacy, as the initial OTS had. */
34      LEGACY("Legacy", new Color(238, 238, 238), Color.BLACK, Color.WHITE, "Dialog"),
35  
36      /** Red. */
37      RED("Red", new Color(208, 192, 192), Color.RED.darker().darker(), new Color(208, 192, 192).darker(), "Dialog"),
38  
39      /** Green. */
40      GREEN("Green", new Color(192, 208, 192), Color.GREEN.darker().darker(), new Color(192, 208, 192).darker(), "Dialog"),
41  
42      /** Blue. */
43      BLUE("Blue", new Color(192, 192, 208), Color.BLUE.darker().darker(), new Color(192, 192, 208).darker(), "Dialog");
44  
45      /** Name. */
46      private final String name;
47  
48      /** Background color. */
49      private final Color background;
50  
51      /** Foreground color. */
52      private final Color foreground;
53  
54      /** Backdrop color. (network panel) */
55      private final Color backdrop;
56  
57      /** font name. */
58      private final String font;
59  
60      /**
61       * Constructor.
62       * @param name String; name
63       * @param background Color; background color
64       * @param foreground Color; foreground color
65       * @param backdrop Color; backdrop color (network panel)
66       * @param font String; font name
67       */
68      Appearance(final String name, final Color background, final Color foreground, final Color backdrop, final String font)
69      {
70          this.name = name;
71          this.background = background;
72          this.foreground = foreground;
73          this.backdrop = backdrop;
74          this.font = font;
75      }
76  
77      /**
78       * Returns the name.
79       * @return String; name
80       */
81      public final String getName()
82      {
83          return this.name;
84      }
85  
86      /**
87       * Returns the background color.
88       * @return Color; color
89       */
90      public final Color getBackground()
91      {
92          return this.background;
93      }
94  
95      /**
96       * Returns the foreground color.
97       * @return Color; color
98       */
99      public final Color getForeground()
100     {
101         return this.foreground;
102     }
103 
104     /**
105      * Returns the backdrop color.
106      * @return Color; color
107      */
108     public final Color getBackdrop()
109     {
110         return this.backdrop;
111     }
112 
113     /**
114      * Returns the font name.
115      * @return String; font name
116      */
117     public final String getFont()
118     {
119         return this.font;
120     }
121 
122 }