com.vaadin.flow.component.
Enum Class Unit
All Implemented Interfaces:
Enum of supported units in Css sizes.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionUnit code representing the width of the "0" (zero).
Unit code representing centimeters.
Unit code representing the font-size of the relevant font.
Unit code representing the x-height of the relevant font.
Unit code representing inches.
Unit code representing millimeters.
Unit code representing in percentage of the containing element defined by terminal.
Unit code representing picas (12 points).
Unit code representing pixels.
Unit code representing points (1/72nd of an inch).
Unit code representing the font-size of the root font.
Unit code representing the viewport's height.
Unit code representing the viewport's larger dimension.
Unit code representing the viewport's smaller dimension.
Unit code representing the viewport's width.
-
Method Summary
Modifier and TypeMethodDescriptionstatic float
Gives size component as float of the css string representing a size.
Gives size unit of the css string representing a size.
static Unit
getUnitFromSymbol
(String symbol) Convert unit string symbol to Unit.
toString()
static Unit
Returns 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
-
PERCENTAGE
Unit code representing in percentage of the containing element defined by terminal.
-
PIXELS
Unit code representing pixels.
-
REM
Unit code representing the font-size of the root font.
-
EM
Unit code representing the font-size of the relevant font.
-
VW
Unit code representing the viewport's width.
-
VH
Unit code representing the viewport's height.
-
VMIN
Unit code representing the viewport's smaller dimension.
-
VMAX
Unit code representing the viewport's larger dimension.
-
POINTS
Unit code representing points (1/72nd of an inch).
-
PICAS
Unit code representing picas (12 points).
-
EX
Unit code representing the x-height of the relevant font.
-
MM
Unit code representing millimeters.
-
CH
Unit code representing the width of the "0" (zero).
-
CM
Unit code representing centimeters.
-
INCH
Unit code representing inches.
-
-
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 -
getSymbol
-
toString
-
getUnit
Gives size unit of the css string representing a size.
Parameters:
cssSize
- Css compliant size string such as "50px".Returns:
A Optional unit.
-
getSize
Gives size component as float of the css string representing a size.
Parameters:
cssSize
- Css compliant size string such as "50px".Returns:
Size as float, 0 if string contained only the unit.
-
getUnitFromSymbol
Convert unit string symbol to Unit.
Parameters:
symbol
- A String.Returns:
A Unit, Unit.PIXELS if symbol was null or not matching.
-