Package megamek.client.ui.preferences
Class JSplitPanePreference
java.lang.Object
megamek.client.ui.preferences.PreferenceElement
megamek.client.ui.preferences.JSplitPanePreference
- All Implemented Interfaces:
PropertyChangeListener,EventListener
JSplitPanePreference monitors the location of the split divider on a JSplitPane. It sets the saved value when a
dialog is loaded and changes it as it changes.
Call preferences.manage(new JSplitPanePreference(JSplitPane)) to use this preference, on a JSplitPane 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.voidvoidsetDividerLocation(int dividerLocation) Methods inherited from class megamek.client.ui.preferences.PreferenceElement
getName
-
Constructor Details
-
JSplitPanePreference
- Throws:
Exception
-
-
Method Details
-
getWeakReference
-
getDividerLocation
public int getDividerLocation() -
setDividerLocation
public void setDividerLocation(int dividerLocation) -
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
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-