org.objectweb.fractal.gui.dialog.model
Class BasicDialogModel

java.lang.Object
  extended byorg.objectweb.fractal.gui.dialog.model.BasicDialogModel
All Implemented Interfaces:
org.objectweb.fractal.api.control.BindingController, ConfigurationListener, DialogModel, SelectionListener

public class BasicDialogModel
extends java.lang.Object
implements DialogModel, ConfigurationListener, SelectionListener, org.objectweb.fractal.api.control.BindingController

Basic implementation of the DialogModel interface. This mode listens to the configuration and selection models in order to update itself when the configuration or the selection changes.


Field Summary
static java.lang.String CONFIGURATION_BINDING
          A mandatory client interface bound to a configuration model.
static java.lang.String SELECTION_BINDING
          A mandatory client interface bound to a selection model.
 
Constructor Summary
BasicDialogModel()
          Constructs a new BasicDialogModel component.
 
Method Summary
 void attributeChanged(Component component, java.lang.String attributeName, java.lang.String oldValue)
          Notifies this listener that the value of an attribute has changed.
 void attributeControllerChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the attribute controller of a component has changed.
 void bindFc(java.lang.String clientItfName, java.lang.Object serverItf)
           
 void changeCountChanged(Component component, long changeCount)
          Notifies this listener that all the change count of the configuration has changed.
 void clientInterfaceAdded(Component component, ClientInterface i, int index)
          Notifies this listener that a client interface has been added to a component.
 void clientInterfaceRemoved(Component component, ClientInterface i, int index)
          Notifies this listener that a client interface has been removed from a component.
 void componentControllerDescriptorChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the component controller descriptor of a component has changed.
 javax.swing.text.Document getAttrControllerFieldModel()
          Returns the model for the text field containing the component's attribute controller.
 javax.swing.table.TableModel getAttributesTableModel()
          Returns the model for the table representing the component's attributes.
 javax.swing.ListSelectionModel getAttributesTableSelectionModel()
          Returns the selection model for the table representing the component's attributes.
 javax.swing.table.TableModel getClientInterfacesTableModel()
          Returns the model for the table representing the external client interfaces.
 javax.swing.ListSelectionModel getClientInterfacesTableSelectionModel()
          Returns the selection model for the table representing the external client interfaces.
 javax.swing.text.Document getCompControllerDescFieldModel()
          Returns the model for the text field containing the component's controller descriptor.
 javax.swing.text.Document getImplementationFieldModel()
          Returns the model for the text field containing the component's implementation.
 javax.swing.text.Document getNameFieldModel()
          Returns the model for the text field containing the component's name.
 javax.swing.table.TableModel getServerInterfacesTableModel()
          Returns the model for the table representing the external server interfaces.
 InterfaceTableSelectionModel getServerInterfacesTableSelectionModel()
          Returns the selection model for the table representing the external server interfaces.
 javax.swing.text.Document getTmplControllerDescFieldModel()
          Returns the model for the text field containing the component's template controller descriptor.
 javax.swing.text.Document getTypeFieldModel()
          Returns the model for the text field containing the component's type.
 void implementationChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the implementation of a component has changed.
 void interfaceBound(ClientInterface citf, ServerInterface sitf)
          Notifies this listener that an interface has been bound.
 void interfaceCardinalityChanged(Interface i, boolean oldValue)
          Notifies this listener that the cardinality of an interface has changed.
 void interfaceContingencyChanged(Interface i, boolean oldValue)
          Notifies this listener that the contigency of an interface has changed.
 void interfaceNameChanged(Interface i, java.lang.String oldValue)
          Notifies this listener that the name of an interface has changed.
 void interfaceRebound(ClientInterface citf, ServerInterface oldSitf)
          Notifies this listener that an interface has been rebound.
 void interfaceSignatureChanged(Interface i, java.lang.String oldValue)
          Notifies this listener that the signature of an interface has changed.
 void interfaceUnbound(ClientInterface citf, ServerInterface sitf)
          Notifies this listener that an interface has been unbound.
 java.lang.String[] listFc()
           
 java.lang.Object lookupFc(java.lang.String clientItfName)
           
 void nameChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the name of a component has changed.
 void rootComponentChanged(Component oldValue)
          Notifies this listener that the root component has changed.
 void selectionChanged()
          Notifies this listener that the selection has changed.
 void serverInterfaceAdded(Component component, ServerInterface i, int index)
          Notifies this listener that a server interface has been added to a component.
 void serverInterfaceRemoved(Component component, ServerInterface i, int index)
          Notifies this listener that a server interface has been removed from a component.
 void subComponentAdded(Component parent, Component child, int index)
          Notifies this listener that a sub component has been added to a component.
 void subComponentRemoved(Component parent, Component child, int index)
          Notifies this listener that a sub component has been removed from a component.
 void templateControllerDescriptorChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the template controller descriptor of a component has changed.
 void typeChanged(Component component, java.lang.String oldValue)
          Notifies this listener that the type of a component has changed.
 void unbindFc(java.lang.String clientItfName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_BINDING

public static final java.lang.String CONFIGURATION_BINDING
A mandatory client interface bound to a configuration model. This configuration is used to get the component on which this dialog model is based (this component is the root component of the configuration).

See Also:
Constant Field Values

SELECTION_BINDING

public static final java.lang.String SELECTION_BINDING
A mandatory client interface bound to a selection model. This is the model on which the Swing list selection models of this model are based.

See Also:
Constant Field Values
Constructor Detail

BasicDialogModel

public BasicDialogModel()
Constructs a new BasicDialogModel component.

Method Detail

listFc

public java.lang.String[] listFc()
Specified by:
listFc in interface org.objectweb.fractal.api.control.BindingController

lookupFc

public java.lang.Object lookupFc(java.lang.String clientItfName)
Specified by:
lookupFc in interface org.objectweb.fractal.api.control.BindingController

bindFc

public void bindFc(java.lang.String clientItfName,
                   java.lang.Object serverItf)
Specified by:
bindFc in interface org.objectweb.fractal.api.control.BindingController

unbindFc

public void unbindFc(java.lang.String clientItfName)
Specified by:
unbindFc in interface org.objectweb.fractal.api.control.BindingController

getClientInterfacesTableModel

public javax.swing.table.TableModel getClientInterfacesTableModel()
Description copied from interface: DialogModel
Returns the model for the table representing the external client interfaces.

Specified by:
getClientInterfacesTableModel in interface DialogModel
Returns:
the model for the table representing the external client interfaces.

getClientInterfacesTableSelectionModel

public javax.swing.ListSelectionModel getClientInterfacesTableSelectionModel()
Description copied from interface: DialogModel
Returns the selection model for the table representing the external client interfaces.

Specified by:
getClientInterfacesTableSelectionModel in interface DialogModel
Returns:
the selection model for the table representing the external client interfaces.

getServerInterfacesTableModel

public javax.swing.table.TableModel getServerInterfacesTableModel()
Description copied from interface: DialogModel
Returns the model for the table representing the external server interfaces.

Specified by:
getServerInterfacesTableModel in interface DialogModel
Returns:
the model for the table representing the external server interfaces.

getServerInterfacesTableSelectionModel

public InterfaceTableSelectionModel getServerInterfacesTableSelectionModel()
Description copied from interface: DialogModel
Returns the selection model for the table representing the external server interfaces.

Specified by:
getServerInterfacesTableSelectionModel in interface DialogModel
Returns:
the selection model for the table representing the external server interfaces.

getAttributesTableModel

public javax.swing.table.TableModel getAttributesTableModel()
Description copied from interface: DialogModel
Returns the model for the table representing the component's attributes.

Specified by:
getAttributesTableModel in interface DialogModel
Returns:
the model for the table representing the component's attributes.

getAttributesTableSelectionModel

public javax.swing.ListSelectionModel getAttributesTableSelectionModel()
Description copied from interface: DialogModel
Returns the selection model for the table representing the component's attributes.

Specified by:
getAttributesTableSelectionModel in interface DialogModel
Returns:
the selection model for the table representing the component's attributes.

getNameFieldModel

public javax.swing.text.Document getNameFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's name.

Specified by:
getNameFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's name.

getTypeFieldModel

public javax.swing.text.Document getTypeFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's type.

Specified by:
getTypeFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's type.

getImplementationFieldModel

public javax.swing.text.Document getImplementationFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's implementation.

Specified by:
getImplementationFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's implementation.

getAttrControllerFieldModel

public javax.swing.text.Document getAttrControllerFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's attribute controller.

Specified by:
getAttrControllerFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's attribute controller.

getTmplControllerDescFieldModel

public javax.swing.text.Document getTmplControllerDescFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's template controller descriptor.

Specified by:
getTmplControllerDescFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's template controller descriptor.

getCompControllerDescFieldModel

public javax.swing.text.Document getCompControllerDescFieldModel()
Description copied from interface: DialogModel
Returns the model for the text field containing the component's controller descriptor.

Specified by:
getCompControllerDescFieldModel in interface DialogModel
Returns:
the model for the text field containing the component's controller descriptor.

changeCountChanged

public void changeCountChanged(Component component,
                               long changeCount)
Description copied from interface: ConfigurationListener
Notifies this listener that all the change count of the configuration has changed.

Specified by:
changeCountChanged in interface ConfigurationListener
Parameters:
changeCount - the new change count of the configuration.

rootComponentChanged

public void rootComponentChanged(Component oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the root component has changed.

Specified by:
rootComponentChanged in interface ConfigurationListener
Parameters:
oldValue - the old root component of the configuration.

nameChanged

public void nameChanged(Component component,
                        java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the name of a component has changed.

Specified by:
nameChanged in interface ConfigurationListener
Parameters:
component - the component whose name has changed.
oldValue - the old name of the component.

typeChanged

public void typeChanged(Component component,
                        java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the type of a component has changed.

Specified by:
typeChanged in interface ConfigurationListener
Parameters:
component - the component whose type has changed.
oldValue - the old type of the component.

implementationChanged

public void implementationChanged(Component component,
                                  java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the implementation of a component has changed.

Specified by:
implementationChanged in interface ConfigurationListener
Parameters:
component - the component whose implementation has changed.
oldValue - the old implementation of the component.

interfaceNameChanged

public void interfaceNameChanged(Interface i,
                                 java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the name of an interface has changed.

Specified by:
interfaceNameChanged in interface ConfigurationListener
Parameters:
i - the interface whose name has changed.
oldValue - the old name of the interface.

interfaceSignatureChanged

public void interfaceSignatureChanged(Interface i,
                                      java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the signature of an interface has changed.

Specified by:
interfaceSignatureChanged in interface ConfigurationListener
Parameters:
i - the interface whose signature has changed.
oldValue - the old signature of the interface.

interfaceContingencyChanged

public void interfaceContingencyChanged(Interface i,
                                        boolean oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the contigency of an interface has changed.

Specified by:
interfaceContingencyChanged in interface ConfigurationListener
Parameters:
i - the interface whose contingency has changed.
oldValue - the old contingency of the interface.

interfaceCardinalityChanged

public void interfaceCardinalityChanged(Interface i,
                                        boolean oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the cardinality of an interface has changed.

Specified by:
interfaceCardinalityChanged in interface ConfigurationListener
Parameters:
i - the interface whose cardinality has changed.
oldValue - the old cardinality of the interface.

clientInterfaceAdded

public void clientInterfaceAdded(Component component,
                                 ClientInterface i,
                                 int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a client interface has been added to a component.

Specified by:
clientInterfaceAdded in interface ConfigurationListener
Parameters:
component - the component into which the new interface has been added.
i - the interface that has been added.
index - the index of this interface in the client interface list of the component.

clientInterfaceRemoved

public void clientInterfaceRemoved(Component component,
                                   ClientInterface i,
                                   int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a client interface has been removed from a component.

Specified by:
clientInterfaceRemoved in interface ConfigurationListener
Parameters:
component - the component from which the interface has been removed.
i - the interface that has been removed.
index - the index of this interface in the client interface list of the component.

serverInterfaceAdded

public void serverInterfaceAdded(Component component,
                                 ServerInterface i,
                                 int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a server interface has been added to a component.

Specified by:
serverInterfaceAdded in interface ConfigurationListener
Parameters:
component - the component into which the new interface has been added.
i - the interface that has been added.
index - the index of this interface in the server interface list of the component.

serverInterfaceRemoved

public void serverInterfaceRemoved(Component component,
                                   ServerInterface i,
                                   int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a server interface has been removed from a component.

Specified by:
serverInterfaceRemoved in interface ConfigurationListener
Parameters:
component - the component from which the interface has been removed.
i - the interface that has been removed.
index - the index of this interface in the server interface list of the component.

interfaceBound

public void interfaceBound(ClientInterface citf,
                           ServerInterface sitf)
Description copied from interface: ConfigurationListener
Notifies this listener that an interface has been bound.

Specified by:
interfaceBound in interface ConfigurationListener
Parameters:
citf - the client interface that has been bound.
sitf - the server interface to which it has been bound.

interfaceRebound

public void interfaceRebound(ClientInterface citf,
                             ServerInterface oldSitf)
Description copied from interface: ConfigurationListener
Notifies this listener that an interface has been rebound.

Specified by:
interfaceRebound in interface ConfigurationListener
Parameters:
citf - the client interface that has been rebound.
oldSitf - the server interface to which it was bound.

interfaceUnbound

public void interfaceUnbound(ClientInterface citf,
                             ServerInterface sitf)
Description copied from interface: ConfigurationListener
Notifies this listener that an interface has been unbound.

Specified by:
interfaceUnbound in interface ConfigurationListener
Parameters:
citf - the client interface that has been unbound.
sitf - the server interface to which it was bound.

attributeControllerChanged

public void attributeControllerChanged(Component component,
                                       java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the attribute controller of a component has changed.

Specified by:
attributeControllerChanged in interface ConfigurationListener
Parameters:
component - the component whose attribute controller has changed.
oldValue - the old attribute controller of the component.

attributeChanged

public void attributeChanged(Component component,
                             java.lang.String attributeName,
                             java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the value of an attribute has changed.

Specified by:
attributeChanged in interface ConfigurationListener
Parameters:
component - the component whose attribute has changed.
attributeName - the name of the attribute whose value has changed.
oldValue - the old value of the attribute.

templateControllerDescriptorChanged

public void templateControllerDescriptorChanged(Component component,
                                                java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the template controller descriptor of a component has changed.

Specified by:
templateControllerDescriptorChanged in interface ConfigurationListener
Parameters:
component - the component whose template contoller descriptor has changed.
oldValue - the old value of the template controller descriptor.

componentControllerDescriptorChanged

public void componentControllerDescriptorChanged(Component component,
                                                 java.lang.String oldValue)
Description copied from interface: ConfigurationListener
Notifies this listener that the component controller descriptor of a component has changed.

Specified by:
componentControllerDescriptorChanged in interface ConfigurationListener
Parameters:
component - the component whose component contoller descriptor has changed.
oldValue - the old value of the component controller descriptor.

subComponentAdded

public void subComponentAdded(Component parent,
                              Component child,
                              int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a sub component has been added to a component.

Specified by:
subComponentAdded in interface ConfigurationListener
Parameters:
parent - the component into which the sub component has been added.
child - the sub component that has been added.
index - the index of this sub component in the sub component list of the parent component.

subComponentRemoved

public void subComponentRemoved(Component parent,
                                Component child,
                                int index)
Description copied from interface: ConfigurationListener
Notifies this listener that a sub component has been removed from a component.

Specified by:
subComponentRemoved in interface ConfigurationListener
Parameters:
parent - the component from which the sub component has been removed.
child - the sub component that has been removed.
index - the index of this sub component in the sub component list of the parent component.

selectionChanged

public void selectionChanged()
Description copied from interface: SelectionListener
Notifies this listener that the selection has changed.

Specified by:
selectionChanged in interface SelectionListener