Package VASSAL.preferences
Class Prefs
java.lang.Object
VASSAL.preferences.Prefs
- All Implemented Interfaces:
Closeable
,AutoCloseable
- Direct Known Subclasses:
GlobalPrefs
A set of preferences. Each set of preferences is identified by a name, and different sets may share a common editor,
which is responsible for writing the preferences to disk.
See also:
See also:
GlobalOptions
- main nexus for preferences being added-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
Prefs
(PrefsEditor editor, File file) Prefs
(PrefsEditor editor, String name) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOption
(String category, Configurer o) void
addOption
(String category, Configurer o, String prompt) Add a configurable property to the preferences in the given categoryvoid
void
close()
getFile()
static Prefs
A global set of preferences that exists independent of any individual module.getStoredValue
(String key) Return the value of a given preference.static void
Initialize visible Global Preferences that are shared between the Module Manager and the Editor/Player.boolean
protected void
read()
static String
void
save()
Store this set of preferencesvoid
setDisableAutoWrite
(boolean b) void
void
write()
Deprecated, for removal: This API element is subject to removal in a future version.
-
Field Details
-
MODULES_DIR_KEY
Preferences key for the directory containing modules- See Also:
-
DISABLE_D3D
- See Also:
-
DISABLE_OGL_FBO
- See Also:
-
BAD_DATA_AUDIT_TRAILS
- See Also:
-
MAIN_WINDOW_REMEMBER
- See Also:
-
MAIN_WINDOW_HEIGHT
- See Also:
-
MAIN_WINDOW_WIDTH
- See Also:
-
OVERRIDE_DEFAULT_FONT_SIZE
- See Also:
-
TRANSLATABLE_SUPPORT
- See Also:
-
-
Constructor Details
-
Prefs
-
Prefs
-
-
Method Details
-
getEditor
-
getFile
-
isDisableAutoWrite
public boolean isDisableAutoWrite()- Returns:
- false -> overridden by GlobalPrefs
-
setDisableAutoWrite
public void setDisableAutoWrite(boolean b) - Parameters:
b
- - no action taken -> overridden by GlobalPrefs
-
addOption
-
addOption
-
addOption
Add a configurable property to the preferences in the given category- Parameters:
category
- the tab under which to add the Configurer's controls in the editor window. If null, do not add controls.prompt
- If non-null and the value was not read from the preferences file on initialization (i.e. first-time setup), prompt the user for an initial value
-
setValue
-
getOption
-
getValue
-
getStoredValue
-
read
protected void read() -
save
-
write
Deprecated, for removal: This API element is subject to removal in a future version.Save these preferences and write to disk.- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getGlobalPrefs
A global set of preferences that exists independent of any individual module.- Returns:
- the global
Prefs
object
-
sanitize
-