jap
Class JAPConfModuleSystem

java.lang.Object
  extended by jap.JAPConfModuleSystem
All Implemented Interfaces:
JAPHelpContext.IHelpContext

public class JAPConfModuleSystem
extends java.lang.Object
implements JAPHelpContext.IHelpContext

This is the implementation for the configuration module system. It manages the configuration modules and displays the configuration tree and the configuration module content area.


Field Summary
private  javax.swing.JPanel m_configurationCardsPanel
          Stores the panel where the content of the configuration modules is displayed.
private  javax.swing.JTree m_configurationTree
          Stores the configuration tree.
private  JAPHelpContext.IHelpContext m_currentHelpContext
           
private  java.util.Hashtable m_registratedModules
          This table stores all registered instances of AbstractJAPConfModule.
private  javax.swing.JPanel m_rootPanel
          Stores the root panel for the whole configuration module system.
private  java.util.Hashtable m_symbolicNamesToHelpContext
           
private  java.util.Hashtable m_symbolicNamesToTreeNodes
          This table stores all associations between the symbolic names of the configuration modules used to access the modules from outside (keys) and the nodes of the modules within the configuration tree.
private  java.util.Hashtable m_treeNodesToSymbolicNames
          This table stores all associations between the tree nodes of the configuration modules (keys) and the symbolic names used to access the modules from outside.
 
Constructor Summary
JAPConfModuleSystem()
          Creates a new instance of JAPConfModuleSystem with an empty configuration tree.
 
Method Summary
 javax.swing.tree.DefaultMutableTreeNode addComponent(javax.swing.tree.DefaultMutableTreeNode a_parentNode, java.awt.Component a_component, java.lang.String a_nodeNameIdentifier, java.lang.String a_symbolicName, java.lang.String a_helpContext)
          Adds a configuration component to the module system and inserts it in the configuration tree.
 javax.swing.tree.DefaultMutableTreeNode addConfigurationModule(javax.swing.tree.DefaultMutableTreeNode a_parentNode, AbstractJAPConfModule a_module, java.lang.String a_symbolicName)
          Adds a configuration module to the module system and inserts it in the configuration tree.
 void createSavePoints()
          Processes a create savepoints event on all registered instances of AbstractJAPConfModule.
 javax.swing.JTree getConfigurationTree()
          Returns the configuration tree.
 javax.swing.tree.DefaultMutableTreeNode getConfigurationTreeRootNode()
          Returns the (invisible) root node of the configuration tree.
 AbstractJAPConfModule getCurrentModule()
           
 java.lang.String getHelpContext()
          Returns the name of the module that is currently shown.
 java.awt.Component getHelpExtractionDisplayContext()
           
 javax.swing.JPanel getRootPanel()
          Returns the root panel of the module system (where the configuration tree and the module content are displayed on).
protected  void initObservers()
           
 void processCancelPressedEvent()
          Processes the configuration 'Cancel' button pressed event on all registered instances of AbstractJAPConfModule.
 boolean processOkPressedEvent()
          Processes the configuration 'OK' button pressed event on all registered instances of AbstractJAPConfModule.
 void processResetToDefaultsPressedEvent()
          Processes the configuration 'Reset to defaults' button pressed event on all registered instances of AbstractJAPConfModule.
 void processUpdateValuesEvent(boolean a_bSync)
          Processes an update values event on all registered instances of AbstractJAPConfModule.
protected  void revalidate()
           
 void selectNode(java.lang.String a_symbolicName)
          This method can be used to select a specific module from the outside and bring it to the front of the configuration dialog.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_rootPanel

private javax.swing.JPanel m_rootPanel
Stores the root panel for the whole configuration module system. The configuration tree and the module cards are created on this panel.


m_configurationCardsPanel

private javax.swing.JPanel m_configurationCardsPanel
Stores the panel where the content of the configuration modules is displayed.


m_configurationTree

private javax.swing.JTree m_configurationTree
Stores the configuration tree.


m_registratedModules

private java.util.Hashtable m_registratedModules
This table stores all registered instances of AbstractJAPConfModule. The key for each module in the table is the node of this module within the configuration tree.


m_treeNodesToSymbolicNames

private java.util.Hashtable m_treeNodesToSymbolicNames
This table stores all associations between the tree nodes of the configuration modules (keys) and the symbolic names used to access the modules from outside.


m_symbolicNamesToTreeNodes

private java.util.Hashtable m_symbolicNamesToTreeNodes
This table stores all associations between the symbolic names of the configuration modules used to access the modules from outside (keys) and the nodes of the modules within the configuration tree. It is the reverse-table of m_treeNodesToSymbolicNames.


m_symbolicNamesToHelpContext

private java.util.Hashtable m_symbolicNamesToHelpContext

m_currentHelpContext

private JAPHelpContext.IHelpContext m_currentHelpContext
Constructor Detail

JAPConfModuleSystem

public JAPConfModuleSystem()
Creates a new instance of JAPConfModuleSystem with an empty configuration tree. A lot of initialization is done here.

Method Detail

addConfigurationModule

public javax.swing.tree.DefaultMutableTreeNode addConfigurationModule(javax.swing.tree.DefaultMutableTreeNode a_parentNode,
                                                                      AbstractJAPConfModule a_module,
                                                                      java.lang.String a_symbolicName)
Adds a configuration module to the module system and inserts it in the configuration tree.

Parameters:
a_parentNode - The parent node of the new module in the configuration tree.
a_module - The module to insert within the configuration tree.
a_symbolicName - A unique symbolic name for the new configuration module. This is used when the module shall be selected from the outside.
Returns:
The node of the inserted module within the configuration tree.

addComponent

public javax.swing.tree.DefaultMutableTreeNode addComponent(javax.swing.tree.DefaultMutableTreeNode a_parentNode,
                                                            java.awt.Component a_component,
                                                            java.lang.String a_nodeNameIdentifier,
                                                            java.lang.String a_symbolicName,
                                                            java.lang.String a_helpContext)
Adds a configuration component to the module system and inserts it in the configuration tree. This method is only for compatibility with some old structures in JAP and will be removed soon. Only addConfigurationModule() should be used for the future.

Parameters:
a_parentNode - The parent node of the new component in the configuration tree.
a_component - The component to insert within the configuration tree. If this value is null, an unselectable node will be created.
a_nodeNameIdentifier - A name (resolvable via JAPMessages.getString()) used as the node name of the new component in the configuration tree.
a_symbolicName - A unique symbolic name for the new configuration component. This is used when the component shall be selected from the outside. This value is only evaluated, if a_component is not null.
Returns:
The node of the inserted module within the configuration tree.

getConfigurationTreeRootNode

public javax.swing.tree.DefaultMutableTreeNode getConfigurationTreeRootNode()
Returns the (invisible) root node of the configuration tree.

Returns:
The root node of the configuration tree.

getConfigurationTree

public javax.swing.JTree getConfigurationTree()
Returns the configuration tree. This can be used for doing some format-operations on the tree from the outside.

Returns:
The configuration tree.

getHelpContext

public java.lang.String getHelpContext()
Returns the name of the module that is currently shown.

Specified by:
getHelpContext in interface JAPHelpContext.IHelpContext
Returns:
the name of the module that is currently shown

getHelpExtractionDisplayContext

public java.awt.Component getHelpExtractionDisplayContext()
Specified by:
getHelpExtractionDisplayContext in interface JAPHelpContext.IHelpContext

getCurrentModule

public AbstractJAPConfModule getCurrentModule()

getRootPanel

public javax.swing.JPanel getRootPanel()
Returns the root panel of the module system (where the configuration tree and the module content are displayed on).

Returns:
The root panel of the module system.

initObservers

protected void initObservers()

revalidate

protected void revalidate()

selectNode

public void selectNode(java.lang.String a_symbolicName)
This method can be used to select a specific module from the outside and bring it to the front of the configuration dialog.

Parameters:
a_symbolicName - The symbolic name of the module (or component) to select. This name was specified when addConfigurationModule() or addComponent() was called.

processOkPressedEvent

public boolean processOkPressedEvent()
Processes the configuration 'OK' button pressed event on all registered instances of AbstractJAPConfModule.

Returns:
True, if everything is ok or false, if one module returned a veto to this event.

processCancelPressedEvent

public void processCancelPressedEvent()
Processes the configuration 'Cancel' button pressed event on all registered instances of AbstractJAPConfModule.


processResetToDefaultsPressedEvent

public void processResetToDefaultsPressedEvent()
Processes the configuration 'Reset to defaults' button pressed event on all registered instances of AbstractJAPConfModule.


processUpdateValuesEvent

public void processUpdateValuesEvent(boolean a_bSync)
Processes an update values event on all registered instances of AbstractJAPConfModule.


createSavePoints

public void createSavePoints()
Processes a create savepoints event on all registered instances of AbstractJAPConfModule. This method must be called everytime when the configuration dialog is displayed.