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 Summary
Modifier and Type Method Description booleanequals(Object obj)SizeUnitsgetUnits()Return the unitsdoublegetValue()Return the valueinthashCode()booleanisAbsolute()Return whether or not this Size is an absolute value or a relative value.doublepixels()A convenience method for callingpixels(1)doublepixels(double multiplier, Font font)Convert this size into pixelsdoublepixels(Font font)If size is not an absolute size, return the product of font size in pixels and value.StringtoString() 
- 
Constructor Details
 - 
Method Details
- 
getValue
public double getValue()Return the value- Returns:
 - the value
 
 - 
getUnits
Return the units- Returns:
 - the units
 
 - 
isAbsolute
public boolean isAbsolute()Return whether or not this Size is an absolute value or a relative value.- Returns:
 - true if it is absolute, otherwise false
 
 - 
pixels
Convert 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
 
 - 
toString
 - 
hashCode
public int hashCode() - 
equals
 
 -