Class GlobalPrefs
java.lang.Object
VASSAL.preferences.Prefs
VASSAL.preferences.GlobalPrefs
- All Implemented Interfaces:
Closeable, AutoCloseable
A set of global preferences shared by all modules. This superclass exists primarily to make sure that the
Global Preferences file gets written whenever a preference setting is changed.
-
Field Summary
Fields inherited from class Prefs
BAD_DATA_AUDIT_TRAILS, DISABLE_D3D, DISABLE_OGL_FBO, MAIN_WINDOW_HEIGHT, MAIN_WINDOW_REMEMBER, MAIN_WINDOW_WIDTH, MODULES_DIR_KEY, OVERRIDE_DEFAULT_FONT_SIZE, TRANSLATABLE_SUPPORT -
Constructor Summary
ConstructorsConstructorDescriptionGlobalPrefs(PrefsEditor editor, File file) GlobalPrefs(PrefsEditor editor, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOption(String category, Configurer o, String prompt) Adds the preference, and adds a listener for property changes, so that global preference file will be automatically written after any change.booleanvoidSave the global preferencesvoidsetDisableAutoWrite(boolean b) Methods inherited from class Prefs
addOption, addOption, close, getEditor, getFile, getGlobalPrefs, getOption, getStoredValue, getValue, initSharedGlobalPrefs, read, sanitize, save, setValue, writeModifier and TypeMethodDescriptionvoidaddOption(String category, Configurer o) voidvoidclose()getFile()static PrefsA global set of preferences that exists independent of any individual module.getStoredValue(String key) Return the value of a given preference.static voidInitialize visible Global Preferences that are shared between the Module Manager and the Editor/Player.protected voidread()static Stringvoidsave()Store this set of preferencesvoidvoidwrite()Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
GlobalPrefs
-
GlobalPrefs
-
-
Method Details
-
isDisableAutoWrite
public boolean isDisableAutoWrite()- Overrides:
isDisableAutoWritein classPrefs- Returns:
- true if our auto-write function has been temporarily disabled.
-
setDisableAutoWrite
public void setDisableAutoWrite(boolean b) - Overrides:
setDisableAutoWritein classPrefs- Parameters:
b- true if auto-write function should be temporarily disabled; false to re-enable it.
-
saveGlobal
public void saveGlobal()Save the global preferences -
addOption
Adds the preference, and adds a listener for property changes, so that global preference file will be automatically written after any change.
-