Package megamek.client.ui.preferences
Class JIntNumberSpinnerPreference
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
megamek.client.ui.preferences.JIntNumberSpinnerPreference
- All Implemented Interfaces:
EventListener,ChangeListener
JIntNumberSpinnerPreference monitors the value of a JSpinner whose number model is for an int. It sets the saved
value when a dialog is loaded and changes it as it changes.
Call preferences.manage(new JIntNumberSpinnerPreference(JSpinner)) to use this preference, on a JSpinner with an int valued SpinnerNumberModel that has called setName
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddispose()Cleans the preference resources.intprotected StringgetValue()Gets the current value for the preference.protected voidinitialize(String value) Sets the initial value for the preference.voidsetIntValue(int intValue) voidstateChanged(ChangeEvent evt) Methods inherited from class megamek.client.ui.preferences.PreferenceElement
getName
-
Constructor Details
-
JIntNumberSpinnerPreference
- Throws:
Exception
-
-
Method Details
-
getWeakReference
-
getIntValue
public int getIntValue() -
setIntValue
public void setIntValue(int intValue) -
getValue
Description copied from class:PreferenceElementGets the current value for the preference.- Specified by:
getValuein classPreferenceElement- Returns:
- the value of the preference.
-
initialize
Description copied from class:PreferenceElementSets the initial value for the preference.- Specified by:
initializein classPreferenceElement- Parameters:
value- initial value.- Throws:
Exception- if there's an error during initialization
-
dispose
protected void dispose()Description copied from class:PreferenceElementCleans the preference resources.- Specified by:
disposein classPreferenceElement
-
stateChanged
- Specified by:
stateChangedin interfaceChangeListener
-