com.jstatcom.project
Class SettingsManager
- java.lang.Object
-
- com.jstatcom.project.SettingsManager
-
public final class SettingsManager extends java.lang.ObjectSingleton class that manages storing and retrieving of settings that should be kept permanently between two program runs. The methodssaveSettingsandrestoreSettingsare automatically being invoked from theTopFrameclass when the application is quit or started, respectively.This class also loads the last state from a special project file. This way the application always restores the project settings that were used when it was quit.
The last state and the settings are store in two different XML files in the users home directory under a name starting with a ".", followed by the title of the application, and the suffix "_settings" and "_laststate", respectively.
-
-
Field Summary
Fields Modifier and Type Field and Description java.lang.StringLAST_STATE_PATH
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static SettingsManagergetInstance()voidrestoreLastState()The last state is retrieved which is just a project.voidrestoreSettings()Invokes deserialization from the settings file.voidsaveLastState()Stores the current state to a special project last state .voidsaveSettings()Saves all settings elements to an XML.
-
-
-
Method Detail
-
getInstance
public static SettingsManager getInstance()
-
restoreSettings
public void restoreSettings()
Invokes deserialization from the settings file. All settings elements are restored and thesetElementmethod of each instance is called.Typically this method is invoked at program start.
-
saveSettings
public void saveSettings()
Saves all settings elements to an XML.
-
saveLastState
public void saveLastState()
Stores the current state to a special project last state .
-
restoreLastState
public void restoreLastState()
The last state is retrieved which is just a project.
-
-
DMelt 3.0 © DataMelt by jWork.ORG