Package megamek.common.preference
Class PreferenceStoreProxy
java.lang.Object
megamek.common.preference.PreferenceStoreProxy
- All Implemented Interfaces:
IPreferenceStore
- Direct Known Subclasses:
ButtonOrderPreferences
,ClientPreferences
,GUIPreferences
,UnitDisplayOrderPreferences
-
Field Summary
FieldsFields inherited from interface megamek.common.preference.IPreferenceStore
BOOLEAN_DEFAULT, DOUBLE_DEFAULT, FALSE, FLOAT_DEFAULT, INT_DEFAULT, LONG_DEFAULT, STRING_DEFAULT, TRUE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a preference change listener to this store.boolean
getBoolean
(String name) Returns the value of theboolean
preference with the given name.boolean
getDefaultBoolean
(String name) Returns the default value for theboolean
preference with the given name.double
getDefaultDouble
(String name) Returns the default value for thedouble
preference with the given name.float
getDefaultFloat
(String name) Returns the default value for thefloat
preference with the given name.int
getDefaultInt
(String name) Returns the default value for theint
preference with the given name.long
getDefaultLong
(String name) Returns the default value for thelong
preference with the given name.getDefaultString
(String name) Returns the default value for theString
preference with the given name.double
Returns the value of thedouble
preference with the given name.float
Returns the value of thefloat
preference with the given name.int
Returns the value of theint
preference with the given name.long
Returns the value of thelong
preference with the given name.Returns the value of theString
preference with the given name.void
Just sets the current value of the preference with the given name.void
Removes the given listener from this store.void
setDefault
(String name, boolean value) Sets the default value for theboolean
preference with the given name.void
setDefault
(String name, double value) Sets the default value for thedouble
preference with the given name.void
setDefault
(String name, float value) Sets the default value for thefloat
preference with the given name.void
setDefault
(String name, int value) Sets the default value for theint
preference with the given name.void
setDefault
(String name, long value) Sets the default value for thelong
preference with the given name.void
setDefault
(String name, String value) Sets the default value for thestring
preference with the given name.void
Sets the current value of theboolean
preference with the given name.void
Sets the current value of thedouble
preference with the given name.void
Sets the current value of thefloat
preference with the given name.void
Sets the current value of theint
preference with the given name.void
Sets the current value of thelong
preference with the given name.void
Sets the current value of theString
preference with the given name.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface megamek.common.preference.IPreferenceStore
getAdvancedProperties
-
Field Details
-
store
-
-
Constructor Details
-
PreferenceStoreProxy
public PreferenceStoreProxy()
-
-
Method Details
-
getDefaultBoolean
Description copied from interface:IPreferenceStore
Returns the default value for theboolean
preference with the given name.- Specified by:
getDefaultBoolean
in interfaceIPreferenceStore
-
getDefaultInt
Description copied from interface:IPreferenceStore
Returns the default value for theint
preference with the given name.- Specified by:
getDefaultInt
in interfaceIPreferenceStore
-
getDefaultLong
Description copied from interface:IPreferenceStore
Returns the default value for thelong
preference with the given name.- Specified by:
getDefaultLong
in interfaceIPreferenceStore
-
getDefaultString
Description copied from interface:IPreferenceStore
Returns the default value for theString
preference with the given name.- Specified by:
getDefaultString
in interfaceIPreferenceStore
-
getDefaultDouble
Description copied from interface:IPreferenceStore
Returns the default value for thedouble
preference with the given name.- Specified by:
getDefaultDouble
in interfaceIPreferenceStore
-
getDefaultFloat
Description copied from interface:IPreferenceStore
Returns the default value for thefloat
preference with the given name.- Specified by:
getDefaultFloat
in interfaceIPreferenceStore
-
getBoolean
Description copied from interface:IPreferenceStore
Returns the value of theboolean
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a boolean.- Specified by:
getBoolean
in interfaceIPreferenceStore
-
getInt
Description copied from interface:IPreferenceStore
Returns the value of theint
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a int.- Specified by:
getInt
in interfaceIPreferenceStore
-
getLong
Description copied from interface:IPreferenceStore
Returns the value of thelong
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a long.- Specified by:
getLong
in interfaceIPreferenceStore
-
getFloat
Description copied from interface:IPreferenceStore
Returns the value of thefloat
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a float.- Specified by:
getFloat
in interfaceIPreferenceStore
-
getDouble
Description copied from interface:IPreferenceStore
Returns the value of thedouble
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a double.- Specified by:
getDouble
in interfaceIPreferenceStore
-
getString
Description copied from interface:IPreferenceStore
Returns the value of theString
preference with the given name. Returns the predefined default value in case if there is no preference with the given name, or if the current value cannot be treated as a String.- Specified by:
getString
in interfaceIPreferenceStore
-
putValue
Description copied from interface:IPreferenceStore
Just sets the current value of the preference with the given name. does not fire preference change event- Specified by:
putValue
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for theboolean
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for theint
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for thelong
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for thefloat
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for thedouble
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setDefault
Description copied from interface:IPreferenceStore
Sets the default value for thestring
preference with the given name.- Specified by:
setDefault
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of theboolean
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of theint
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of thelong
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of thefloat
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of thedouble
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
setValue
Description copied from interface:IPreferenceStore
Sets the current value of theString
preference with the given name. A preference change event is reported if the current value of the preference changes from its previous value.- Specified by:
setValue
in interfaceIPreferenceStore
-
addPreferenceChangeListener
Description copied from interface:IPreferenceStore
Adds a preference change listener to this store.- Specified by:
addPreferenceChangeListener
in interfaceIPreferenceStore
- Parameters:
listener
- a preference change listener
-
removePreferenceChangeListener
Description copied from interface:IPreferenceStore
Removes the given listener from this store.- Specified by:
removePreferenceChangeListener
in interfaceIPreferenceStore
-