org.objectweb.fractal.gui.model
Class AbstractComponent

java.lang.Object
  extended byorg.objectweb.fractal.gui.model.AbstractComponent
All Implemented Interfaces:
Component
Direct Known Subclasses:
BasicComponent, SharedComponent

public abstract class AbstractComponent
extends java.lang.Object
implements Component

Abstract implementation of the Component interface.


Field Summary
protected  Component parent
          The parent component of this component.
 
Fields inherited from interface org.objectweb.fractal.gui.model.Component
ATTRIBUTE_CONTROLLER_CLASS_INVALID, ATTRIBUTE_CONTROLLER_CLASS_NOT_FOUND, ATTRIBUTE_CONTROLLER_MISSING, IMPLEMENTATION_CLASS_INVALID, IMPLEMENTATION_CLASS_NOT_FOUND, IMPLEMENTATION_MISSING, INTERFACES_INVALID, NAME_MISSING, OK
 
Constructor Summary
AbstractComponent()
           
 
Method Summary
 boolean contains(Component child)
          Returns true if this component contains the given sub component.
 boolean containsMasterOfExternalComponent(Component c)
          Returns true if the given component contains a master component but does not contain all its slaves.
 boolean containsSlaveOfExternalComponent(Component c)
          Returns true if the given component contains a slave component but does not contain its master.
 Configuration getConfiguration()
          Returns the configuration to which this component belongs.
 Component getParent()
          Returns the parent component of this component.
 java.lang.Object[] getPath()
          Returns the path of this component from the root component.
 Component getRootComponent()
          Returns the root component of the configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.fractal.gui.model.Component
addClientInterface, addServerInterface, addSubComponent, bind, getAttribute, getAttributeController, getAttributeNames, getClientInterface, getClientInterfaces, getComponentControllerDescriptor, getImplementation, getMasterComponent, getName, getServerInterface, getServerInterfaces, getSlaveComponents, getStatus, getSubComponent, getSubComponents, getTemplateControllerDescriptor, getType, isComposite, isShared, rebind, removeClientInterface, removeServerInterface, removeSubComponent, setAttribute, setAttributeController, setComponentControllerDescriptor, setImplementation, setName, setStatus, setTemplateControllerDescriptor, setType, unbind
 

Field Detail

parent

protected Component parent
The parent component of this component. May be null if this component is a root component.

Constructor Detail

AbstractComponent

public AbstractComponent()
Method Detail

getParent

public Component getParent()
Description copied from interface: Component
Returns the parent component of this component.

Specified by:
getParent in interface Component
Returns:
the parent component of this component, or null if this component is the root component.

getConfiguration

public Configuration getConfiguration()
Returns the configuration to which this component belongs.

Specified by:
getConfiguration in interface Component
Returns:
the configuration to which this component belongs.

getRootComponent

public Component getRootComponent()
Description copied from interface: Component
Returns the root component of the configuration. This method just calls getParent until the root component is found.

Specified by:
getRootComponent in interface Component
Returns:
the root component of the configuration.

getPath

public java.lang.Object[] getPath()
Description copied from interface: Component
Returns the path of this component from the root component.

Specified by:
getPath in interface Component
Returns:
an ordered array of all the ancestors of this component, from the root component to this component, included.

contains

public boolean contains(Component child)
Description copied from interface: Component
Returns true if this component contains the given sub component.

Specified by:
contains in interface Component
Parameters:
child - a component.
Returns:
true if this component contains the given sub component.

containsSlaveOfExternalComponent

public boolean containsSlaveOfExternalComponent(Component c)
Description copied from interface: Component
Returns true if the given component contains a slave component but does not contain its master.

Specified by:
containsSlaveOfExternalComponent in interface Component
Parameters:
c - a component.
Returns:
true if the given component contains a slave component but does not contain its master.

containsMasterOfExternalComponent

public boolean containsMasterOfExternalComponent(Component c)
Description copied from interface: Component
Returns true if the given component contains a master component but does not contain all its slaves.

Specified by:
containsMasterOfExternalComponent in interface Component
Parameters:
c - a component.
Returns:
true if the given component contains a master component but does not contain all its slaves.