Class Size
java.lang.Object
javafx.css.Size
Represents a size specified in a particular unit, such as 14px or 0.2em.
- Since:
- 9
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUnits()Return the units.doublegetValue()Returns the value.booleanReturns whether or not thisSizeis an absolute value or a relative value.doublepixels()A convenience method for callingpixels(1)doubleConverts this size into pixels.doubleIf size is not an absolute size, return the product of font size in pixels and value.
-
Constructor Details
-
Size
Constructs aSizeobject.- Parameters:
value- value of the sizeunits- unit of the size
-
-
Method Details
-
getValue
public double getValue()Returns the value.- Returns:
- the value
-
getUnits
-
isAbsolute
public boolean isAbsolute()Returns whether or not thisSizeis an absolute value or a relative value.- Returns:
- true if it is absolute, otherwise false
-
pixels
Converts this size into pixels.- Parameters:
multiplier- The multiplier for PERCENTAGE sizesfont- The font for EM sizes- Returns:
- the size in pixels
-
pixels
If size is not an absolute size, return the product of font size in pixels and value. Otherwise, return the absolute value.- Parameters:
font- the font- Returns:
- the size of pixels
-
pixels
public double pixels()A convenience method for callingpixels(1)- Returns:
- the size in pixels
-