|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WLength
public class WLength
A value class that describes a CSS length.
The class combines a value with a unit. There is a special value auto which has a different meaning depending on the context.
| Nested Class Summary | |
|---|---|
static class |
WLength.Unit
The unit. |
| Field Summary | |
|---|---|
static WLength |
Auto
An 'auto' length. |
| Constructor Summary | |
|---|---|
WLength()
Creates an 'auto' length. |
|
WLength(double value)
Creates a length with value and unit. |
|
WLength(double value,
WLength.Unit unit)
Creates a length with value and unit. |
|
WLength(int value)
Creates a length with value and unit. |
|
WLength(int value,
WLength.Unit unit)
Creates a length with value and unit. |
|
WLength(long value)
Creates a length with value and unit. |
|
WLength(long value,
WLength.Unit unit)
Creates a length with value and unit. |
|
WLength(java.lang.String s)
Creates a length by parsing the argument as a css length string. |
|
| Method Summary | |
|---|---|
boolean |
equals(WLength other)
Indicates whether some other object is "equal to" this one. |
java.lang.String |
getCssText()
Returns the CSS text. |
WLength.Unit |
getUnit()
Returns the unit. |
double |
getValue()
Returns the value. |
boolean |
isAuto()
Returns whether the length is 'auto'. |
double |
toPixels()
Returns the (approximate) length in pixels. |
double |
toPixels(double fontSize)
Returns the (approximate) length in pixels. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static WLength Auto
WLength()| Constructor Detail |
|---|
public WLength()
Specifies an 'auto' length.
Autopublic WLength(java.lang.String s)
This supports all CSS length formats that have an API counterpart.
public WLength(double value,
WLength.Unit unit)
This constructor is also used for the implicit conversion of a double to
a WLength, assuming a pixel unit.
public WLength(double value)
Calls this(value,
WLength.Unit.Pixel)
public WLength(int value,
WLength.Unit unit)
This constructor is also used for the implicit conversion of a int to a
WLength, assuming a pixel unit.
public WLength(int value)
Calls this(value,
WLength.Unit.Pixel)
public WLength(long value,
WLength.Unit unit)
This constructor is also used for the implicit conversion of a long to a
WLength, assuming a pixel unit.
public WLength(long value)
Calls this(value,
WLength.Unit.Pixel)
| Method Detail |
|---|
public boolean isAuto()
WLength(),
Autopublic double getValue()
getUnit()public WLength.Unit getUnit()
getValue()public java.lang.String getCssText()
public boolean equals(WLength other)
public double toPixels(double fontSize)
When the length isAuto(), 0 is returned,
otherwise the approximate length in pixels.
public final double toPixels()
Returns toPixels(16.0)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||