TextWeight.java

  1. package org.opentrafficsim.core.animation;

  2. import java.awt.font.TextAttribute;

  3. /**
  4.  * Weight of the text font in the explanation.
  5.  * <p>
  6.  * Copyright (c) 2013-2016 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved. <br>
  7.  * BSD-style license. See <a href="http://opentrafficsim.org/docs/current/license.html">OpenTrafficSim License</a>.
  8.  * </p>
  9.  * $LastChangedDate: 2015-07-24 02:58:59 +0200 (Fri, 24 Jul 2015) $, @version $Revision: 1147 $, by $Author: averbraeck $,
  10.  * initial version Dec 11, 2016 <br>
  11.  * @author <a href="http://www.tbm.tudelft.nl/averbraeck">Alexander Verbraeck</a>
  12.  * @author <a href="http://www.tudelft.nl/pknoppers">Peter Knoppers</a>
  13.  * @author <a href="http://www.transport.citg.tudelft.nl">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.     /** A moderately heavier weight than WEIGHT_REGULAR. */
  29.     WEIGHT_SEMIBOLD(TextAttribute.WEIGHT_SEMIBOLD),

  30.     /** An intermediate weight between WEIGHT_REGULAR and WEIGHT_BOLD. */
  31.     WEIGHT_MEDIUM(TextAttribute.WEIGHT_MEDIUM),

  32.     /** A moderately lighter weight than WEIGHT_BOLD. */
  33.     WEIGHT_DEMIBOLD(TextAttribute.WEIGHT_DEMIBOLD),

  34.     /** The standard bold weight. */
  35.     WEIGHT_BOLD(TextAttribute.WEIGHT_BOLD),

  36.     /** A moderately heavier weight than WEIGHT_BOLD. */
  37.     WEIGHT_HEAVY(TextAttribute.WEIGHT_HEAVY),

  38.     /** An extra heavy weight. */
  39.     WEIGHT_EXTRABOLD(TextAttribute.WEIGHT_EXTRABOLD),

  40.     /** The heaviest predefined weight. */
  41.     WEIGHT_ULTRABOLD(TextAttribute.WEIGHT_ULTRABOLD);

  42.     /** the corresponding TextAttribute constant. */
  43.     private final Number value;

  44.     /**
  45.      * @param value the corresponding TextAttribute constant
  46.      */
  47.     TextWeight(final Number value)
  48.     {
  49.         this.value = value;
  50.     }

  51.     /**
  52.      * @return value the corresponding TextAttribute constant
  53.      */
  54.     protected final Number getValue()
  55.     {
  56.         return this.value;
  57.     }
  58.    
  59. }