Enum Class Unit

java.lang.Object
java.lang.Enum<Unit>
org.gnome.rsvg.Unit
All Implemented Interfaces:
Serializable, Comparable<Unit>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum Unit extends Enum<Unit> implements Enumeration

Units for the RsvgLength struct. These have the same meaning as CSS length units.

If you test for the values of this enum, please note that librsvg may add other units in the future as its support for CSS improves. Please make your code handle unknown units gracefully (e.g. with a default case in a switch() statement).

  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    advance measure of a '0' character (depends on the text orientation)
    centimeters
    em, or the current font size
    x-height of the current font
    inches
    millimeters
    picas, or 1/6 inch (12 points)
    percentage values; where 1.0 means 100%.
    points, or 1/72 inch
    pixels
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Get the numeric value of this enum
    static Unit
    of(int value)
    Create a new Unit for the provided value
    static Unit
    of(MemorySegment address)
    Create a new Unit for the value in the provided memory address.
    static Unit
    Returns the enum constant of this class with the specified name.
    static Unit[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

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

    • PERCENT

      public static final Unit PERCENT
      percentage values; where 1.0 means 100%.
    • PX

      public static final Unit PX
      pixels
    • EM

      public static final Unit EM
      em, or the current font size
    • EX

      public static final Unit EX
      x-height of the current font
    • IN

      public static final Unit IN
      inches
    • CM

      public static final Unit CM
      centimeters
    • MM

      public static final Unit MM
      millimeters
    • PT

      public static final Unit PT
      points, or 1/72 inch
    • PC

      public static final Unit PC
      picas, or 1/6 inch (12 points)
    • CH

      public static final Unit CH
      advance measure of a '0' character (depends on the text orientation)
      Since:
      2.58
  • 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
    • of

      public static Unit of(int value)
      Create a new Unit for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static Unit of(MemorySegment address)
      Create a new Unit for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address