Size (Java SE 10 & JDK 10 ) (original) (raw)
- 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
Constructors
Constructor Description Size(double value,SizeUnits units) Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type Method Description SizeUnits getUnits() Return the units double getValue() Return the value boolean isAbsolute() Return whether or not this Size is an absolute value or a relative value. double pixels() A convenience method for calling pixels(1) double pixels(double multiplier,Font font) Convert this size into pixels double pixels(Font font) If size is not an absolute size, return the product of font size in pixels and value. * ### Methods declared in class java.lang.[Object](../../java/lang/Object.html "class in java.lang") `[clone](../../java/lang/Object.html#clone%28%29), [equals](../../java/lang/Object.html#equals%28java.lang.Object%29), [finalize](../../java/lang/Object.html#finalize%28%29), [getClass](../../java/lang/Object.html#getClass%28%29), [hashCode](../../java/lang/Object.html#hashCode%28%29), [notify](../../java/lang/Object.html#notify%28%29), [notifyAll](../../java/lang/Object.html#notifyAll%28%29), [toString](../../java/lang/Object.html#toString%28%29), [wait](../../java/lang/Object.html#wait%28%29), [wait](../../java/lang/Object.html#wait%28long%29), [wait](../../java/lang/Object.html#wait%28long,int%29)`
Constructor Detail
* #### Size public Size(double value, [SizeUnits](../../javafx/css/SizeUnits.html "enum in javafx.css") units)
Method Detail
* #### getValue public double getValue() Return the value Returns: the value * #### getUnits public [SizeUnits](../../javafx/css/SizeUnits.html "enum in javafx.css") 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 public double pixels(double multiplier, [Font](../../javafx/scene/text/Font.html "class in javafx.scene.text") font) Convert this size into pixels Parameters: `multiplier` \- The multiplier for PERCENTAGE sizes `font` \- The font for EM sizes Returns: the size in pixels * #### pixels public double pixels([Font](../../javafx/scene/text/Font.html "class in javafx.scene.text") font) 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 calling `pixels(1)` Returns: the size in pixels
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.