-
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
getValue
public double getValue()
Return the value
- Returns:
- the value
-
pixels
public double pixels(Font 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