com.tensegrity.gui.swing
Interface ConfigurationPane


public interface ConfigurationPane

Common interface for iso-morphism of the configuration panes. These panes group components that are to displayed in some kind of "user-settings" dialog. THe changes made in the components are written back to attribute-set, so that changes can persist over many invocations of the component.
Commonly the usage of a configuration pane is as follows:
1. allocate 1 to many configuration panes and add them to a tabpane in their dialog. The dialog invokes getName() on the configuration-pane in order to obtain a name under which it can display the pane (e.g. "Miscelleanous" ...
2. make the container invoke loadValue on the configurationpane before displaying it for the first time. the configuration pane then has the chance to load its latest settings from persistent storage.
3a. if the user cancels the top level dialog, then invoke saveCurrentValues() on the configurationpane
3b. if the user applys or 'oks' the top level dialog then invoke the method sanityCheck() on the configuration pane to give it a chance to say "stop" to the top-levle dialog if the configured values do not make any sense. In such a case "false" is returned. If true is returned, then the configuration is considered to be meaningful.
4. Invoke saveCurrentValues() on the configurationpane, in order to give it a chance to save the current configuration to persistent storage.
5. Invoke configurationCommitted() on the configurationpane. Now the actual code that performs the configuration is being run. The configurationpane knows its own local settings naturally and can optionally query the global configuration-settings from the globaloptions map.

Version:
$Id: ConfigurationPane.java,v 1.6 2005/04/04 07:26:34 MichaelKegel Exp $
Author:
Stepan Rutz

Method Summary
 void configurationCommitted(java.util.Map globaloptions)
          Invoked when the configuration is commited.
 java.lang.String getName()
          Returns the name of this configurationpane.
 void loadValues()
          Makes the configurationpane read its current values from the attribute-set.
 boolean sanityCheck(java.lang.StringBuffer message)
          Invoked before the configuration is about to be committed.
 void saveCurrentValues()
          Makes the configurationpane write its current values to the the attribute set.
 

Method Detail

sanityCheck

public boolean sanityCheck(java.lang.StringBuffer message)
Invoked before the configuration is about to be committed. This callback allows the configuration pane to check whether the combination of all user selected values makes sense or whether it has to be rejected.

Parameters:
message - a stringbuffer that is filled by a sanityCheck in order to provide additional information.
Returns:
boolean indicating whether validation succeeded or not.

configurationCommitted

public void configurationCommitted(java.util.Map globaloptions)
Invoked when the configuration is commited.

Parameters:
globaloptions - map of globaloptions.

saveCurrentValues

public void saveCurrentValues()
Makes the configurationpane write its current values to the the attribute set. (For example when another configuration is made active).


loadValues

public void loadValues()
Makes the configurationpane read its current values from the attribute-set. (For example when the component it is in is re-initialized.


getName

public java.lang.String getName()
Returns the name of this configurationpane.

Returns:
the name of this configurationpane.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.