View Javadoc
1   package org.opentrafficsim.draw;
2   
3   import java.awt.font.TextAttribute;
4   
5   /**
6    * Weight of the text font in the explanation.
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://github.com/peter-knoppers">Peter Knoppers</a>
13   * @author <a href="https://github.com/wjschakel">Wouter Schakel</a>
14   */
15  public enum TextWeight
16  {
17      /** The lightest predefined weight. */
18      WEIGHT_EXTRA_LIGHT(TextAttribute.WEIGHT_EXTRA_LIGHT),
19  
20      /** The standard light weight. */
21      WEIGHT_LIGHT(TextAttribute.WEIGHT_LIGHT),
22  
23      /** An intermediate weight between WEIGHT_LIGHT and WEIGHT_STANDARD. */
24      WEIGHT_DEMILIGHT(TextAttribute.WEIGHT_DEMILIGHT),
25  
26      /** The standard weight. */
27      WEIGHT_REGULAR(TextAttribute.WEIGHT_REGULAR),
28  
29      /** A moderately heavier weight than WEIGHT_REGULAR. */
30      WEIGHT_SEMIBOLD(TextAttribute.WEIGHT_SEMIBOLD),
31  
32      /** An intermediate weight between WEIGHT_REGULAR and WEIGHT_BOLD. */
33      WEIGHT_MEDIUM(TextAttribute.WEIGHT_MEDIUM),
34  
35      /** A moderately lighter weight than WEIGHT_BOLD. */
36      WEIGHT_DEMIBOLD(TextAttribute.WEIGHT_DEMIBOLD),
37  
38      /** The standard bold weight. */
39      WEIGHT_BOLD(TextAttribute.WEIGHT_BOLD),
40  
41      /** A moderately heavier weight than WEIGHT_BOLD. */
42      WEIGHT_HEAVY(TextAttribute.WEIGHT_HEAVY),
43  
44      /** An extra heavy weight. */
45      WEIGHT_EXTRABOLD(TextAttribute.WEIGHT_EXTRABOLD),
46  
47      /** The heaviest predefined weight. */
48      WEIGHT_ULTRABOLD(TextAttribute.WEIGHT_ULTRABOLD);
49  
50      /** the corresponding TextAttribute constant. */
51      private final Number value;
52  
53      /**
54       * Constructor.
55       * @param value the corresponding TextAttribute constant
56       */
57      TextWeight(final Number value)
58      {
59          this.value = value;
60      }
61  
62      /**
63       * Returns the value.
64       * @return value the corresponding TextAttribute constant
65       */
66      protected final Number getValue()
67      {
68          return this.value;
69      }
70  
71  }