JMSL Chart Programmer's Guide
|
3D Drawing Elements >> Text Attributes |
Text Attributes
Attribute FontName
FontName
is a string-valued attribute that specifies the logical font name or a font
face name. The default value is "SansSerif". Java always defines the font names
"Dialog", "DialogInput", "Monospaced", "Serif", "SansSerif", and "Symbol".
Depending on the system, additional font names may be defined.
Attribute FontSize
FontSize
is an integer-valued attribute that specifies the point size of the font.
The default value is 12.
Attribute FontStyle
FontStyle
is an integer-valued attribute that specifies the font style. This can be
a bitwise combination of Font.PLAIN
, Font.BOLD
and/or Font.ITALIC
.
The default value is Font.PLAIN
.
Attribute TextColor
TextColor
is a Color
-valued attribute that specifies the color in which the text
is drawn. The default value is Color.black
.
Attribute TextFormat
TextFormat
is a java.text.Format
-valued or a String-valued attribute that
specifies how to format string objects.
TextFormat
can also be set using a String
, which is used to generate a Format
object when the attribute is accessed. The Format object is created using the
value of locale in the chart node.
Some strings have special meanings (case is ignored in these strings):
"Date(SHORT)"
means use:DateFormat.getDateInstance
(
SHORT, locale)
"Date(MEDIUM)"
means useDateFormat.getDateInstance
(
MEDIUM, locale)
"Date(LONG)"
means use:DateFormat.getDateInstance(LONG, locale)
"Currency"
means useNumberFormat.getCurrencyInstance(locale)
"Percent"
means use:NumberFormat.getPercentInstance(locale)
If TextFormat
has a string value that is not one of the above, then
new
DecimalFormat
(value, new
DecimalFormatSymbols(locale)
)
is used. For example, if its value is "0.00"
, then numbers will be formatted with
exactly two digits after the decimal place. See DecimalFormat
for a detailed
description of these format patterns.
The default value of TextFormat
is the value returned by the factory method
NumberFormat.getInstance(locale)
.
© Visual Numerics, Inc. All rights reserved. |