TextWeight.java

  1. package org.opentrafficsim.draw.core;

  2. import java.awt.font.TextAttribute;

  3. /**
  4.  * Weight of the text font in the explanation.
  5.  * <p>
  6.  * Copyright (c) 2013-2023 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  7.  * BSD-style license. See <a href="https://opentrafficsim.org/docs/license.html">OpenTrafficSim License</a>.
  8.  * </p>
  9.  * @author <a href="https://github.com/averbraeck">Alexander Verbraeck</a>
  10.  * @author <a href="https://tudelft.nl/staff/p.knoppers-1">Peter Knoppers</a>
  11.  * @author <a href="https://dittlab.tudelft.nl">Wouter Schakel</a>
  12.  */
  13. public enum TextWeight
  14. {
  15.     /** The lightest predefined weight. */
  16.     WEIGHT_EXTRA_LIGHT(TextAttribute.WEIGHT_EXTRA_LIGHT),

  17.     /** The standard light weight. */
  18.     WEIGHT_LIGHT(TextAttribute.WEIGHT_LIGHT),

  19.     /** An intermediate weight between WEIGHT_LIGHT and WEIGHT_STANDARD. */
  20.     WEIGHT_DEMILIGHT(TextAttribute.WEIGHT_DEMILIGHT),

  21.     /** The standard weight. */
  22.     WEIGHT_REGULAR(TextAttribute.WEIGHT_REGULAR),

  23.     /** A moderately heavier weight than WEIGHT_REGULAR. */
  24.     WEIGHT_SEMIBOLD(TextAttribute.WEIGHT_SEMIBOLD),

  25.     /** An intermediate weight between WEIGHT_REGULAR and WEIGHT_BOLD. */
  26.     WEIGHT_MEDIUM(TextAttribute.WEIGHT_MEDIUM),

  27.     /** A moderately lighter weight than WEIGHT_BOLD. */
  28.     WEIGHT_DEMIBOLD(TextAttribute.WEIGHT_DEMIBOLD),

  29.     /** The standard bold weight. */
  30.     WEIGHT_BOLD(TextAttribute.WEIGHT_BOLD),

  31.     /** A moderately heavier weight than WEIGHT_BOLD. */
  32.     WEIGHT_HEAVY(TextAttribute.WEIGHT_HEAVY),

  33.     /** An extra heavy weight. */
  34.     WEIGHT_EXTRABOLD(TextAttribute.WEIGHT_EXTRABOLD),

  35.     /** The heaviest predefined weight. */
  36.     WEIGHT_ULTRABOLD(TextAttribute.WEIGHT_ULTRABOLD);

  37.     /** the corresponding TextAttribute constant. */
  38.     private final Number value;

  39.     /**
  40.      * @param value Number; the corresponding TextAttribute constant
  41.      */
  42.     TextWeight(final Number value)
  43.     {
  44.         this.value = value;
  45.     }

  46.     /**
  47.      * @return value the corresponding TextAttribute constant
  48.      */
  49.     protected final Number getValue()
  50.     {
  51.         return this.value;
  52.     }

  53. }