|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.project.SettingsManager
public final class SettingsManager
Singleton class that manages storing and retrieving of settings that should
be kept permanently between two program runs. The methods
saveSettings
and restoreSettings
are
automatically being invoked from the TopFrame
class 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 | |
---|---|
java.lang.String |
LAST_STATE_PATH
|
Method Summary | |
---|---|
static SettingsManager |
getInstance()
|
void |
restoreLastState()
The last state is retrieved which is just a project. |
void |
restoreSettings()
Invokes deserialization from the settings file. |
void |
saveLastState()
Stores the current state to a special project last state . |
void |
saveSettings()
Saves all settings elements to an XML. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String LAST_STATE_PATH
Method Detail |
---|
public static SettingsManager getInstance()
public void restoreSettings()
setElement
method of each instance is
called.
Typically this method is invoked at program start.
public void saveSettings()
public void saveLastState()
public void restoreLastState()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |