|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WFont
public class WFont
A value class that describes a font.
| Nested Class Summary | |
|---|---|
static class |
WFont.GenericFamily
The generic font family. |
static class |
WFont.Size
The font size. |
static class |
WFont.Style
The font style. |
static class |
WFont.Variant
The font variant. |
static class |
WFont.Weight
The font weight. |
| Constructor Summary | |
|---|---|
WFont()
A default font (dependent on the user agent). |
|
WFont(WFont.GenericFamily family)
A font of a given family. |
|
| Method Summary | |
|---|---|
boolean |
equals(WFont other)
Indicates whether some other object is "equal to" this one. |
WLength |
getFixedSize()
Deprecated. This method has been renamed to getSizeLength() |
WFont.GenericFamily |
getGenericFamily()
Returns the font generic family. |
WFont.Size |
getSize()
Returns the font size. |
WFont.Size |
getSize(double mediumSize)
Returns the font size. |
WLength |
getSizeLength()
Returns the font size as a numerical value. |
WLength |
getSizeLength(double mediumSize)
Returns the font size as a numerical value. |
WString |
getSpecificFamilies()
Returns the font specific family names. |
WFont.Style |
getStyle()
Returns the font style. |
WFont.Variant |
getVariant()
Returns the font variant. |
WFont.Weight |
getWeight()
Returns the font weight. |
int |
getWeightValue()
Returns the font weight value. |
void |
setFamily(WFont.GenericFamily genericFamily)
Sets the font family. |
void |
setFamily(WFont.GenericFamily genericFamily,
java.lang.CharSequence specificFamilies)
Sets the font family. |
void |
setSize(WFont.Size size)
Sets the font size. |
void |
setSize(WFont.Size size,
WLength length)
Sets the font size (deprecated). |
void |
setSize(WLength size)
Sets the font size. |
void |
setStyle(WFont.Style style)
Sets the font style. |
void |
setVariant(WFont.Variant variant)
Sets the font variant. |
void |
setWeight(WFont.Weight weight)
Sets the font weight. |
void |
setWeight(WFont.Weight weight,
int value)
Sets the font weight. |
void |
updateDomElement(eu.webtoolkit.jwt.DomElement element,
boolean fontall,
boolean all)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WFont()
public WFont(WFont.GenericFamily family)
Creates a Medium font of the given family.
| Method Detail |
|---|
public boolean equals(WFont other)
public void setFamily(WFont.GenericFamily genericFamily,
java.lang.CharSequence specificFamilies)
The font family is specified using a generic family name, in addition to a comma-seperated list of specific font choices.
The first specific font that can be matched will be used, otherwise a generic font will be used.
Careful, for a font family name that contains a space, you need to add
quotes, to
setFamily(), e.g.
WFont mono;
mono.setFamily(WFont::Monospace, "'Courier New'");
mono.setSize(18);
public final void setFamily(WFont.GenericFamily genericFamily)
Calls
setFamily(genericFamily, new WString())
public WFont.GenericFamily getGenericFamily()
public WString getSpecificFamilies()
public void setStyle(WFont.Style style)
public WFont.Style getStyle()
public void setVariant(WFont.Variant variant)
public WFont.Variant getVariant()
public void setWeight(WFont.Weight weight,
int value)
When setting weight == Value, you may specify a value.
Valid values are between 100 and 900, and are rounded to multiples of 100.
public final void setWeight(WFont.Weight weight)
Calls setWeight(weight,
400)
public WFont.Weight getWeight()
public int getWeightValue()
public void setSize(WFont.Size size,
WLength length)
public void setSize(WFont.Size size)
Sets the font size using a predefined CSS size.
public void setSize(WLength size)
Sets the font size.
public WFont.Size getSize(double mediumSize)
public final WFont.Size getSize()
Returns getSize(16)
public WLength getFixedSize()
getSizeLength()
public WLength getSizeLength(double mediumSize)
Absolute size enumerations are converted to a length assuming a Medium font size of 16 px.
public final WLength getSizeLength()
Returns getSizeLength(16)
public void updateDomElement(eu.webtoolkit.jwt.DomElement element,
boolean fontall,
boolean all)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||