| Method from javax.swing.text.html.CSS$FontWeight Detail: |
Object fromStyleConstants(StyleConstants key,
Object value) {
if (value.equals(Boolean.TRUE)) {
return parseCssValue("bold");
}
return parseCssValue("normal");
}
Converts a StyleConstants attribute value to
a CSS attribute value. If there is no conversion
returns null. By default, there is no conversion. |
int getValue() {
return weight;
}
|
boolean isBold() {
return (weight > 500);
}
|
Object parseCssValue(String value) {
FontWeight fw = new FontWeight();
fw.svalue = value;
if (value.equals("bold")) {
fw.weight = 700;
} else if (value.equals("normal")) {
fw.weight = 400;
} else {
// PENDING(prinz) add support for relative values
try {
fw.weight = Integer.parseInt(value);
} catch (NumberFormatException nfe) {
fw = null;
}
}
return fw;
}
|
Object toStyleConstants(StyleConstants key,
View v) {
return (weight > 500) ? Boolean.TRUE : Boolean.FALSE;
}
Converts a CSS attribute value to a StyleConstants
value. If there is no conversion, returns null.
By default, there is no conversion. |