public final class Size
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private SizeUnits |
units |
private double |
value |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
SizeUnits |
getUnits()
Return the units
|
double |
getValue()
Return the value
|
int |
hashCode() |
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.
|
(package private) double |
points(double multiplier,
Font font)
Convert this size into points
|
(package private) double |
points(Font font)
Convert this size into Points units, a Point is 1/72 of a inch
|
java.lang.String |
toString() |
private final double value
private final SizeUnits units
public Size(double value, SizeUnits units)
public double getValue()
public SizeUnits getUnits()
public boolean isAbsolute()
double points(Font font)
double points(double multiplier, Font font)
multiplier
- The multiplier for PERCENTAGE sizesfont
- The font for EM sizespublic double pixels(double multiplier, Font font)
multiplier
- The multiplier for PERCENTAGE sizesfont
- The font for EM sizespublic double pixels(Font font)
font
- the fontpublic double pixels()
pixels(1)
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object