Package mars.settings
Class FontSetting
java.lang.Object
mars.settings.FontSetting
Class representing a persistent font setting and its current value.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Font
Decode aFont
object from a string with the formName
orName;Attributes
, whereAttributes
is a comma-separated list of optional attributes:Bold
: If present, sets the bold style flag.static String
Encode aFont
object as a string with the formName
orName;Attributes
, whereAttributes
is a comma-separated list of optional attributes:Bold
: Will be present if the bold style flag is set.get()
Get the value currently stored in this setting.Get the default value for this setting.getKey()
Get the key used to identify this setting inPreferences
.void
Set the value of this setting, updating persistent storage.void
setDefault
(Font value) Set the default value for this setting without updating the current value.void
setNonPersistent
(Font value) Set the value of this setting without updating persistent storage.
-
Method Details
-
getKey
Get the key used to identify this setting inPreferences
.- Returns:
- The string key for this setting.
-
get
Get the value currently stored in this setting.- Returns:
- The font value for this setting.
-
set
Set the value of this setting, updating persistent storage.- Parameters:
value
- The new font value for this setting.
-
getDefault
Get the default value for this setting.- Returns:
- The default font value for this setting.
-
setDefault
Set the default value for this setting without updating the current value.- Parameters:
value
- The new font string value for this setting.
-
setNonPersistent
Set the value of this setting without updating persistent storage.- Parameters:
value
- The new font value for this setting.
-
encode
Encode aFont
object as a string with the formName
orName;Attributes
, whereAttributes
is a comma-separated list of optional attributes:Bold
: Will be present if the bold style flag is set.Italic
: Will be present if the italic style flag is set.Size=N
: Specifies the font point sizeN
.
- Parameters:
font
- The font to encode as a string.- Returns:
- The encoded form of the given font, or null if the font is null.
- See Also:
-
decode
Decode aFont
object from a string with the formName
orName;Attributes
, whereAttributes
is a comma-separated list of optional attributes:Bold
: If present, sets the bold style flag.Italic
: If present, sets the italic style flag.Size=N
: Sets the font point size toN
. If not present, defaults to 12.
- Parameters:
string
- The string to decode as a font.- Returns:
- The font decoded from the given string.
- See Also:
-