public class FontConverter extends Object implements Converter
Modifier and Type | Field and Description |
---|---|
static Class |
TEMPLATE
converter's return type
|
Constructor and Description |
---|
FontConverter() |
Modifier and Type | Method and Description |
---|---|
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 |
public static final Class TEMPLATE
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.public Class convertsTo()
Converters
conversTo method informs about the Class type the converter
is returning when its convert
method is calledconvertsTo
in interface Converter
Class
- the Class the converter is returning when its convert method is calledCopyright (c) 2002 - 2014 - Wolf Paulus - wolfpaulus.com. All rights reserved.