org.objectweb.fractal.gui.graph.model
Class BasicGraphModel

java.lang.Object
  extended byorg.objectweb.fractal.gui.graph.model.BasicGraphModel
All Implemented Interfaces:
BindingController, GraphModel

public class BasicGraphModel
extends Object
implements GraphModel, BindingController

Basic implementation of the GraphModel interface.


Field Summary
static String GRAPH_MODEL_LISTENERS_BINDING
          A collection client interface bound to the listeners of this model.
 
Constructor Summary
BasicGraphModel()
          Constructs a new BasicGraphModel component.
 
Method Summary
 void bindFc(String clientItfName, Object serverItf)
          Binds the client interface whose name is given to a server interface.
 Color getComponentColor(Component component)
          TODO.
 Rect getComponentPosition(Component component)
          Returns the coordinates of the given component.
 org.objectweb.fractal.adl.XMLElement getComponentsPositions(Component component)
          Returns an XML element containing the coordinates of the given component.
 String[] listFc()
          Returns the names of the client interfaces of the component to which this interface belongs.
 Object lookupFc(String clientItfName)
          Returns the interface to which the given client interface is bound.
 void setComponentColor(Component component, Color color)
          TODO.
 void setComponentPosition(Component component, Rect position)
          Sets the coordinates of the given component.
 void setComponentsPositions(Component component, org.objectweb.fractal.adl.XMLElement xml)
          Sets the coordinates of the given component from the given XML element.
 void unbindFc(String clientItfName)
          Unbinds the given client interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GRAPH_MODEL_LISTENERS_BINDING

public static final String GRAPH_MODEL_LISTENERS_BINDING
A collection client interface bound to the listeners of this model.

See Also:
Constant Field Values
Constructor Detail

BasicGraphModel

public BasicGraphModel()
Constructs a new BasicGraphModel component.

Method Detail

listFc

public String[] listFc()
Description copied from interface: BindingController
Returns the names of the client interfaces of the component to which this interface belongs.

Specified by:
listFc in interface BindingController
Returns:
the names of the client interfaces of the component to which this interface belongs.

lookupFc

public Object lookupFc(String clientItfName)
Description copied from interface: BindingController
Returns the interface to which the given client interface is bound. More precisely, returns the server interface to which the client interface whose name is given is bound. This server interface is necessarily in the same address space as the client interface (see bindFc).

Specified by:
lookupFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
Returns:
the server interface to which the given interface is bound, or null if it is not bound.

bindFc

public void bindFc(String clientItfName,
                   Object serverItf)
Description copied from interface: BindingController
Binds the client interface whose name is given to a server interface. More precisely, binds the client interface of the component to which this interface belongs, and whose name is equal to the given name, to the given server interface. The given server interface must be in the same address space as the client interface.

Specified by:
bindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.
serverItf - a server interface.

unbindFc

public void unbindFc(String clientItfName)
Description copied from interface: BindingController
Unbinds the given client interface. More precisely, unbinds the client interface of the component to which this interface belongs, and whose name is equal to the given name.

Specified by:
unbindFc in interface BindingController
Parameters:
clientItfName - the name of a client interface of the component to which this interface belongs.

getComponentColor

public Color getComponentColor(Component component)
Description copied from interface: GraphModel
TODO.

Specified by:
getComponentColor in interface GraphModel
Parameters:
component -
Returns:

setComponentColor

public void setComponentColor(Component component,
                              Color color)
Description copied from interface: GraphModel
TODO.

Specified by:
setComponentColor in interface GraphModel
Parameters:
component -
color -

getComponentPosition

public Rect getComponentPosition(Component component)
Description copied from interface: GraphModel
Returns the coordinates of the given component.

Specified by:
getComponentPosition in interface GraphModel
Parameters:
component - the component whose coordinates must be returned.
Returns:
the coordinates of the given component. These coordinates are relative to the parent component of the given component: (0,0) is the top left corner of the inner area of the parent component, and (1,1) is the botton right corner of this area.
See Also:
GraphModel.setComponentPosition(org.objectweb.fractal.gui.model.Component, org.objectweb.fractal.gui.graph.model.Rect)

getComponentsPositions

public org.objectweb.fractal.adl.XMLElement getComponentsPositions(Component component)
Description copied from interface: GraphModel
Returns an XML element containing the coordinates of the given component.

Specified by:
getComponentsPositions in interface GraphModel
Parameters:
component - the component whose coordinates must be returned.
Returns:
an XML element containing the coordinates of the given component, and of all its direct and indirect sub components.
See Also:
GraphModel.setComponentsPositions(org.objectweb.fractal.gui.model.Component, org.objectweb.fractal.adl.XMLElement)

setComponentPosition

public void setComponentPosition(Component component,
                                 Rect position)
Description copied from interface: GraphModel
Sets the coordinates of the given component.

Specified by:
setComponentPosition in interface GraphModel
Parameters:
component - the component whose coordinates must be set.
position - the new coordinates of the given component.
See Also:
GraphModel.getComponentPosition(org.objectweb.fractal.gui.model.Component)

setComponentsPositions

public void setComponentsPositions(Component component,
                                   org.objectweb.fractal.adl.XMLElement xml)
                            throws Exception
Description copied from interface: GraphModel
Sets the coordinates of the given component from the given XML element.

Specified by:
setComponentsPositions in interface GraphModel
Parameters:
component - the component whose coordinates must be set.
xml - an XML element containing the new coordinates of the given component, and of all its direct and indirect sub components.
Throws:
Exception - if something goes wrong.
See Also:
GraphModel.getComponentsPositions(org.objectweb.fractal.gui.model.Component)