TextWidth.java

  1. package org.opentrafficsim.draw.core;

  2. import java.awt.font.TextAttribute;

  3. /**
  4.  * Width of the text font in the explanation.
  5.  * <p>
  6.  * Copyright (c) 2013-2020 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 TextWidth
  16. {
  17.     /** condensed font. */
  18.     WIDTH_CONDENSED(TextAttribute.WIDTH_CONDENSED),

  19.     /** moderately condensed font. */
  20.     WIDTH_SEMI_CONDENSED(TextAttribute.WIDTH_SEMI_CONDENSED),

  21.     /** regular font. */
  22.     WIDTH_REGULAR(TextAttribute.WIDTH_REGULAR),

  23.     /** moderately extended font. */
  24.     WIDTH_SEMI_EXTENDED(TextAttribute.WIDTH_SEMI_EXTENDED),

  25.     /** extended font. */
  26.     WIDTH_EXTENDED(TextAttribute.WIDTH_EXTENDED);

  27.     /** the corresponding TextAttribute constant. */
  28.     private final Number value;

  29.     /**
  30.      * @param value Number; the corresponding TextAttribute constant
  31.      */
  32.     TextWidth(final Number value)
  33.     {
  34.         this.value = value;
  35.     }

  36.     /**
  37.      * @return value the corresponding TextAttribute constant
  38.      */
  39.     protected final Number getValue()
  40.     {
  41.         return this.value;
  42.     }

  43. }