- All Implemented Interfaces:
Serializable
,Comparable<SVGUnit>
,Constable
SVGUnit is used to describe the units valid for coordinates and lengths in
the SVG specification.
See also:
- Since:
- 1.16
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionCentimeters (1cm = 96px/2.54).The size of the element's font.The x-height of the element’s font.Inches (1in = 2.54cm = 96px).Millimeters (1mm = 1/10th of 1cm).Picas (1pc = 1/6th of 1in).Percent, a value that is some fraction of another reference value.Points (1pt = 1/72th of 1in).Pixels (1px = 1/96th of 1in).User unit, a value in the current coordinate system. -
Method Summary
Modifier and TypeMethodDescriptionint
getValue()
Return the value of this enumstatic SVGUnit
of
(int ordinal) Returns the enum constant for the given ordinal (its position in the enum declaration).static SVGUnit
Returns the enum constant of this class with the specified name.static SVGUnit[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
USER
User unit, a value in the current coordinate system. If used in the root element for the initial coordinate systems it corresponds to pixels.- Since:
- 1.16
-
EM
-
EX
-
PX
-
IN
-
CM
-
MM
-
PT
-
PC
-
PERCENT
Percent, a value that is some fraction of another reference value.- Since:
- 1.16
-
-
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
-
getValue
public int getValue()Return the value of this enum- Returns:
- the value
-
of
Returns the enum constant for the given ordinal (its position in the enum declaration).- Parameters:
ordinal
- the position in the enum declaration, starting from zero- Returns:
- the enum constant for the given ordinal
-