java.lang.Object
javafx.css.Size
public final class Size extends Object
Represents a size specified in a particular unit, such as 14px or 0.2em.
- Since:
- 9
- 
Constructor Summary
- 
Method SummaryModifier and Type Method Description SizeUnitsgetUnits()Return the units.doublegetValue()Returns the value.booleanisAbsolute()Returns whether or not thisSizeis an absolute value or a relative value.doublepixels()A convenience method for callingpixels(1)doublepixels(double multiplier, Font font)Converts this size into pixels.doublepixels(Font font)If size is not an absolute size, return the product of font size in pixels and value.
- 
Constructor Details- 
SizeConstructs aSizeobject.- Parameters:
- value- value of the size
- units- unit of the size
 
 
- 
- 
Method Details- 
getValuepublic double getValue()Returns the value.- Returns:
- the value
 
- 
getUnitsReturn the units.- Returns:
- the units
 
- 
isAbsolutepublic boolean isAbsolute()Returns whether or not thisSizeis an absolute value or a relative value.- Returns:
- true if it is absolute, otherwise false
 
- 
pixelsConverts this size into pixels.- Parameters:
- multiplier- The multiplier for PERCENTAGE sizes
- font- The font for EM sizes
- Returns:
- the size in pixels
 
- 
pixelsIf 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
 
- 
pixelspublic double pixels()A convenience method for callingpixels(1)- Returns:
- the size in pixels
 
 
-