cz.psika.numerist
Class Preferences
java.lang.Object
cz.psika.numerist.Preferences
- All Implemented Interfaces:
- Constants
public class Preferences
- extends java.lang.Object
- implements Constants
Class handler for application preferences.
- Author:
- Tomas Psika
Fields inherited from interface cz.psika.numerist.Constants |
APPLICATION_CONFIG_FILENAME, APPNAME, AUTHORS, CONFIG_DIAGRAM_COLUMN_COLOR, CONFIG_DIAGRAM_INNER_DIAGONAL_COLOR, CONFIG_DIAGRAM_OUTER_DIAGONAL_COLOR, CONFIG_DIAGRAM_ROW_COLOR, CONFIG_FAILURE, CONFIG_MAPPING_DEFAULT, CONFIG_MAPPING_SCHEMA, CONTACT_EMAIL, DECREMENT, defaultStyleName, FILE_MODIFIED, FILE_NOT_MODIFIED, FIRST_POSITION, FULL_DIAGRAM, INCREMENT, INSERT_BEFORE, INSIDE_MAIN_PANEL, INSIDE_TOP_PANEL, LICENSE, OK, PROJECT_SUPPORT_RELATIVE_URL, PROJECT_URL, RELEASE, styleFileSuffix, stylesDirectory, THUMBNAIL, VERSION, VIEW_MODE_DUAL, VIEW_MODE_SINGLE |
Method Summary |
void |
fetchUserPreferences()
Loads preferences saved in configuration file
When some invalid entries are found, configuration file will be repaired,
redundant entries will be ignored by application and appended in case of file repair |
static Preferences |
getInstance()
Get instance of preferences
Default preferences will be initialized within first call |
java.lang.String |
getPreference(java.lang.String key)
Getting preference value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PREFERENCE_APPLICATION_VIEW
public static final java.lang.String PREFERENCE_APPLICATION_VIEW
- See Also:
- Constant Field Values
PREFERENCE_DEFAULT_STYLE
public static final java.lang.String PREFERENCE_DEFAULT_STYLE
- See Also:
- Constant Field Values
PREFERENCE_DUAL_VIEW
public static final java.lang.String PREFERENCE_DUAL_VIEW
- See Also:
- Constant Field Values
PREFERENCE_SINGLE_VIEW
public static final java.lang.String PREFERENCE_SINGLE_VIEW
- See Also:
- Constant Field Values
getInstance
public static Preferences getInstance()
- Get instance of preferences
Default preferences will be initialized within first call
- Returns:
- single instance of
Preferences
object
getPreference
public java.lang.String getPreference(java.lang.String key)
- Getting preference value
- Parameters:
key
- preference key
- Returns:
- value of the preference
fetchUserPreferences
public void fetchUserPreferences()
- Loads preferences saved in configuration file
When some invalid entries are found, configuration file will be repaired,
redundant entries will be ignored by application and appended in case of file repair