Package org.gnome.rsvg
Enum Class Unit
- All Implemented Interfaces:
Serializable,Comparable<Unit>,Constable,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 java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionadvance measure of a '0' character (depends on the text orientation)centimetersem, or the current font sizex-height of the current fontinchesmillimeterspicas, or 1/6 inch (12 points)percentage values; where <literal>1.0</literal> means 100%.points, or 1/72 inchpixels -
Method Summary
Modifier and TypeMethodDescriptionintgetValue()Get the numeric value of this enumstatic Unitof(int value) Create a new Unit for the provided valuestatic Unitof(MemorySegment address) Create a new Unit for the value in the provided memory address.static UnitReturns the enum constant of this class with the specified name.static Unit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PERCENT
percentage values; where <literal>1.0</literal> means 100%. -
PX
pixels -
EM
em, or the current font size -
EX
x-height of the current font -
IN
inches -
CM
centimeters -
MM
millimeters -
PT
points, or 1/72 inch -
PC
picas, or 1/6 inch (12 points) -
CH
advance measure of a '0' character (depends on the text orientation)- Since:
- 2.58
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
of
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:
getValuein interfaceEnumeration- Returns:
- the enum value
-
of
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
-