org.objectweb.fractal.gui.graph.model
Interface GraphModel

All Known Implementing Classes:
BasicGraphModel

public interface GraphModel

A model associating coordinates to components.


Method Summary
 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.
 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 positions)
          Sets the coordinates of the given component from the given XML element.
 

Method Detail

getComponentColor

public Color getComponentColor(Component component)
TODO.

Parameters:
component -
Returns:

setComponentColor

public void setComponentColor(Component component,
                              Color color)
TODO.

Parameters:
component -
color -

getComponentPosition

public Rect getComponentPosition(Component component)
Returns the coordinates of the given component.

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:
setComponentPosition(org.objectweb.fractal.gui.model.Component, org.objectweb.fractal.gui.graph.model.Rect)

getComponentsPositions

public org.objectweb.fractal.adl.XMLElement getComponentsPositions(Component component)
                                                            throws Exception
Returns an XML element containing the coordinates of the given component.

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.
Throws:
Exception - if something goes wrong.
See Also:
setComponentsPositions(org.objectweb.fractal.gui.model.Component, org.objectweb.fractal.adl.XMLElement)

setComponentPosition

public void setComponentPosition(Component component,
                                 Rect position)
Sets the coordinates of the given component.

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

setComponentsPositions

public void setComponentsPositions(Component component,
                                   org.objectweb.fractal.adl.XMLElement positions)
                            throws Exception
Sets the coordinates of the given component from the given XML element.

Parameters:
component - the component whose coordinates must be set.
positions - 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:
getComponentsPositions(org.objectweb.fractal.gui.model.Component)