Enum Class Unit

java.lang.Object
java.lang.Enum<Unit>
dev.prozilla.pine.common.math.dimension.Unit
All Implemented Interfaces:
Serializable, Comparable<Unit>, Constable

public enum Unit extends Enum<Unit>
Units used in dimensions of UI elements.
See Also:
  • Enum Constant Details

    • AUTO

      public static final Unit AUTO
      Automatic size, irrespective of dimension value.
    • PIXELS

      public static final Unit PIXELS
      Absolute size in pixels, equivalent to px in CSS.
    • ELEMENT_SIZE

      public static final Unit ELEMENT_SIZE
      Relative to size of the element, equivalent to vh in CSS.
    • VIEWPORT_WIDTH

      public static final Unit VIEWPORT_WIDTH
      Relative to viewport width, equivalent to vh in CSS. Value 100 corresponds to the full width of the viewport.
    • VIEWPORT_HEIGHT

      public static final Unit VIEWPORT_HEIGHT
      Relative to viewport height, equivalent to vh in CSS. Value 100 corresponds to the full height of the viewport.
    • PERCENTAGE

      public static final Unit PERCENTAGE
      Relative to parent size, equivelent to % in CSS.
  • Method Details

    • values

      public static 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 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
    • isFixed

      public static boolean isFixed(Unit unit)
    • isDynamic

      public static boolean isDynamic(Unit unit)
    • toString

      public static String toString(Unit unit)
    • isValid

      public static boolean isValid(String input)
    • parse

      public static Unit parse(String input) throws IllegalArgumentException
      Throws:
      IllegalArgumentException