Class SettingsStore
java.lang.Object
io.github.jbastgen.stemma.app.config.SettingsStore
Persists the settings as one small properties file in the portable configuration directory
(see
AppDirs). Reading never fails (missing or broken files give defaults); writing is atomic so a crash
cannot leave a half-written file, and keeps the keys other parts of the application wrote.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Pathsettings.propertiesin the portable configuration directory.file()The settings file.load()The backend settings stored in the file; invalid values fall back to the defaults.loadApp()Reads every global setting; whatever is missing or unreadable keeps its default.voidloadView(ViewSettings view) Takes the stored look and layout over intoview; whatever is not stored keeps its default.voidsave(BackendSettings settings) Stores the backend settings; everything else in the file stays as it is.voidWrites the global settings; keys of other parts of the file stay as they are.booleanWrites the look and layout if it differs from what is stored.
-
Constructor Details
-
SettingsStore
- Parameters:
file-settings.propertiesin the configuration folder
-
-
Method Details
-
defaultFile
settings.propertiesin the portable configuration directory. -
file
The settings file. -
loadApp
Reads every global setting; whatever is missing or unreadable keeps its default. -
saveApp
Writes the global settings; keys of other parts of the file stay as they are.- Throws:
IOException
-
load
The backend settings stored in the file; invalid values fall back to the defaults. -
save
Stores the backend settings; everything else in the file stays as it is.- Throws:
IOException
-
loadView
Takes the stored look and layout over intoview; whatever is not stored keeps its default. -
saveViewIfChanged
Writes the look and layout if it differs from what is stored. Returns whether it wrote.- Throws:
IOException
-