|
SWIXML 1.6 (#161) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.swixml.converters.FontConverter
public class FontConverter
The FontConverter class defines / describes
Field Summary | |
---|---|
static Class |
TEMPLATE
converter's return type |
Constructor Summary | |
---|---|
FontConverter()
|
Method Summary | |
---|---|
Object |
convert(Class type,
Attribute attr,
Localizer localizer)
Convert the value of the given Attribute object into an output object of the
specified type. |
Class |
convertsTo()
A Converters conversTo method informs about the Class type the converter
is returning when its convert method is called |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Class TEMPLATE
Constructor Detail |
---|
public FontConverter()
Method Detail |
---|
public Object convert(Class type, Attribute attr, Localizer localizer) throws Exception
Attribute
object into an output object of the
specified type.
Returns the Font
that the str
argument describes.
To ensure that this method returns the desired Font,
format the str
parameter in
one of two ways:
"fontfamilyname-style-pointsize" or
in which style is one of the three
case-insensitive strings:
"BOLD"
, "BOLDITALIC"
, or
"ITALIC"
, and pointsize is a decimal
representation of the point size.
For example, if you want a font that is Arial, bold, and
a point size of 18, you would call this method with:
"Arial-BOLD-18".
Font
has a size of 12. If you don't specify
a valid style, the returned Font has a style of PLAIN.
If you do not provide a valid font family name in
the str
argument, this method still returns
a valid font with a family name of "dialog".
To determine what font family names are available on
your system, use the
GraphicsEnvironment.getAvailableFontFamilyNames()
method.
If str
is null
, a new Font
is returned with the family name "dialog", a size of 12 and a
PLAIN style.
If str
is null
,
a new Font
is returned with the name "dialog", a
size of 12 and a PLAIN style.
convert
in interface Converter
type
- Class
Data type to which the Attribute's value should be convertedattr
- Attribute
the attribute, providing the value to be converted.
Font
object that str
describes, or a new default Font
if
str
is null
.
Exception
public Class convertsTo()
Converters
conversTo method informs about the Class type the converter
is returning when its convert
method is called
convertsTo
in interface Converter
Class
- the Class the converter is returning when its convert method is called
|
SWIXML 1.6 (#161) |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |