Enum Class Primitive.Unit

java.lang.Object
java.lang.Enum<Primitive.Unit>
com.juliewoolie.dom.style.Primitive.Unit
All Implemented Interfaces:
Serializable, Comparable<Primitive.Unit>, Constable
Enclosing interface:
Primitive

public static enum Primitive.Unit extends Enum<Primitive.Unit>
Style units
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Base value is multiplied by the width of the '0' character
    Base value is 1/100th the size of a block in the game
    Represents an angle in degrees.
    Represents an angle in gradians.
    Base value is 1x the size of a block in the game
    No modification of the base value is done
    Base value is 1/100th of the size of the parent element
    Base value is multiplied by the size of a pixel
    Represents an angle in radians.
    Represents an angle in a number of turns around the circle.
    Base value is a percentage of the screen's height
    Base value is a percentage of the screen's width
  • Method Summary

    Modifier and Type
    Method
    Description
    Get an array of angular units.
    Get a string representation of the unit.
     
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • NONE

      public static final Primitive.Unit NONE
      No modification of the base value is done
    • PX

      public static final Primitive.Unit PX
      Base value is multiplied by the size of a pixel
    • CH

      public static final Primitive.Unit CH
      Base value is multiplied by the width of the '0' character
    • VW

      public static final Primitive.Unit VW
      Base value is a percentage of the screen's width
    • VH

      public static final Primitive.Unit VH
      Base value is a percentage of the screen's height
    • M

      public static final Primitive.Unit M
      Base value is 1x the size of a block in the game
    • CM

      public static final Primitive.Unit CM
      Base value is 1/100th the size of a block in the game
    • PERCENT

      public static final Primitive.Unit PERCENT
      Base value is 1/100th of the size of the parent element
    • DEG

      public static final Primitive.Unit DEG
      Represents an angle in degrees. A full circle is 360 degrees.
    • GRAD

      public static final Primitive.Unit GRAD
      Represents an angle in gradians. A full circle is 400 gradians.
    • RAD

      public static final Primitive.Unit RAD
      Represents an angle in radians. A full circle is approximately 6.2832 radians.
    • TURN

      public static final Primitive.Unit TURN
      Represents an angle in a number of turns around the circle. A full circle is 1 turn.
  • Method Details

    • values

      public static Primitive.Unit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Primitive.Unit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • angleUnits

      public static Primitive.Unit[] angleUnits()
      Get an array of angular units. (Includes NONE)
      Returns:
      Angle unit array
    • getUnit

      public String getUnit()
      Get a string representation of the unit.
      Returns:
      Unit CSS representation
    • toString

      public String toString()
      Overrides:
      toString in class Enum<Primitive.Unit>