qflib 0.98.1

de.qfs.lib.config
Class JSplitPaneConfigWrapper

java.lang.Object
  |
  +--de.qfs.lib.config.ConfigWrapper
        |
        +--de.qfs.lib.config.JSplitPaneConfigWrapper
All Implemented Interfaces:
Configurable, java.util.EventListener, java.beans.PropertyChangeListener

public class JSplitPaneConfigWrapper
extends ConfigWrapper
implements java.beans.PropertyChangeListener

A ConfigWrapper for JSplitPane objects. The state saved is the location of the divider.

The JSplitPaneConfigWrapper has special constructors that configure it to force an initial setting of the divider which can otherwise be difficult to achieve due to timing problems.

Version:
$Revision: 1.13 $
Author:
Gregor Schmid

Field Summary
protected  javax.swing.JSplitPane pane
          The wrapped JSplitPane.
protected  boolean registered
          Whether the wrapper is registered with the Configuration.
 
Constructor Summary
JSplitPaneConfigWrapper()
          Create a new JSplitPaneConfigWrapper with the default name "splitpane".
JSplitPaneConfigWrapper(javax.swing.JSplitPane client, java.lang.String name, double defaultLocation)
          Create a new JSplitPaneConfigWrapper that will enforce the initial setting of the divider location.
JSplitPaneConfigWrapper(javax.swing.JSplitPane client, java.lang.String name, int defaultLocation)
          Create a new JSplitPaneConfigWrapper that will enforce the initial setting of the divider location.
 
Method Summary
 java.util.Properties getConfigurableState()
          Get the Configurable's state.
 void propertyChange(java.beans.PropertyChangeEvent e)
          Notify the JSplitPaneConfigWrapper of a change in the JSplitPane.
 void registrationChanged(Configuration config, java.lang.String name, boolean registered, boolean valuesKept)
          This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
protected  void setClient(java.lang.Object client)
          Set the client object for the ConfigWrapper.
 void setConfigurableState(java.util.Properties state)
          Set the Configurable's state.
 
Methods inherited from class de.qfs.lib.config.ConfigWrapper
addPackage, getConfigurableName, makeWrapper, makeWrapper, setConfigurableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pane

protected javax.swing.JSplitPane pane
The wrapped JSplitPane.

registered

protected boolean registered
Whether the wrapper is registered with the Configuration.
Constructor Detail

JSplitPaneConfigWrapper

public JSplitPaneConfigWrapper()
Create a new JSplitPaneConfigWrapper with the default name "splitpane".

JSplitPaneConfigWrapper

public JSplitPaneConfigWrapper(javax.swing.JSplitPane client,
                               java.lang.String name,
                               int defaultLocation)
Create a new JSplitPaneConfigWrapper that will enforce the initial setting of the divider location.
Parameters:
client - The JSplitPane to wrap.
name - The configurable name.
defaultLocation - The default divider location for the split pane if no state has been saved.

JSplitPaneConfigWrapper

public JSplitPaneConfigWrapper(javax.swing.JSplitPane client,
                               java.lang.String name,
                               double defaultLocation)
Create a new JSplitPaneConfigWrapper that will enforce the initial setting of the divider location.
Parameters:
client - The JSplitPane to wrap.
name - The configurable name.
defaultLocation - The default divider location for the split pane if no state has been saved.
Method Detail

setClient

protected void setClient(java.lang.Object client)
Set the client object for the ConfigWrapper.
Overrides:
setClient in class ConfigWrapper
Parameters:
client - The client object to set.

getConfigurableState

public java.util.Properties getConfigurableState()
Get the Configurable's state.
Overrides:
getConfigurableState in class ConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Returns:
An empty Properties object.

setConfigurableState

public void setConfigurableState(java.util.Properties state)
Set the Configurable's state.
Overrides:
setConfigurableState in class ConfigWrapper
Following copied from class: de.qfs.lib.config.ConfigWrapper
Parameters:
state - The state to set. Ignored.

registrationChanged

public void registrationChanged(Configuration config,
                                java.lang.String name,
                                boolean registered,
                                boolean valuesKept)
This callback is used to notify the Configurable whenever it is registered with or unregistered from the Configuration, so it can decide whether to notify the Configuration when its state changes.
Overrides:
registrationChanged in class ConfigWrapper
Parameters:
config - The affected Configuration.
name - The registration name of the Configurable which may be different from the Configurable's name.
registered - True if the Configurable was just registered, false if it was unregistered.
valuesKept - Whether the Configurable's values were kept, if it was just unregistered.

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
Notify the JSplitPaneConfigWrapper of a change in the JSplitPane.
Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - The event containing the details of the change.

qflib 0.98.1