com.tensegrity.graph.controller
Interface GraphController

All Superinterfaces:
Observable

public interface GraphController
extends Observable

The interface GraphController defines the behavior for classes responsible for notifying Graph and VisualGraphView objects about changes that have taken place in both a model and in a view. A GraphController therefore manages the views that are attached to a given graph.

Constructing a GraphController is done by means of a com.tensegrity.graph.view.GraphControllerFactory, which will hide the particular implementation classes from client code.

Version:
$Id: GraphController.java,v 1.20 2005/01/27 16:27:45 AndreasEbbert Exp $
Author:
Stepan Rutz
See Also:
Graph, VisualGraph, VisualGraphView

Method Summary
 void addVisualGraph(VisualGraphView visualgraphview)
          Adds a VisualGraphView to the list of controlled views.
 void addVisualGraphs(java.util.List visualgraphs)
          Adds all the VisualGraphView instances from the given list to the controller.
 void destroy()
          This method is invoked when the application does not longer need the graph controller.
 void disable()
          Disables the graph controller temporarily until enable() is invoked.
 void enable()
          Enables the graph controller (the default state) after it was disabled before.
 Graph getGraph()
          Returns the graph model instance that is being controlled.
 java.util.List getVisualGraphs()
          Returns the graph/view instances that are being controlled.
 boolean isEnabled()
          Returns whether the controller is enabled or disabled.
 void removeVisualGraph(VisualGraphView visualgraphview)
          Removes a VisualGraphView from the list of controlled views.
 void setPriviledgedVisualGraph(VisualGraphView visualgraphview)
          Sets the preferred view of the controller.
 void synchronize()
          Tells the controller to synchronize itself.
 void synchronize(java.lang.Object info)
          Tells the controller to synchronize itself.
 
Methods inherited from interface com.tensegrity.generic.util.Observable
addObserver, clearChanged, deleteObserver, deleteObservers, getObservers, notifyObservers, notifyObservers, setChanged
 

Method Detail

destroy

public void destroy()
This method is invoked when the application does not longer need the graph controller. The controller can perform cleanup work here (for example unregistering event listeners). By contract it is not allowed to reuse a GraphController that was destroy()'ed previously.


getGraph

public Graph getGraph()
Returns the graph model instance that is being controlled.

Returns:
the graph model instance that is being controlled.

Find more information in the class documentation


isEnabled

public boolean isEnabled()
Returns whether the controller is enabled or disabled.

Returns:
true when the controller is enabled, otherwise false.

disable

public void disable()
Disables the graph controller temporarily until enable() is invoked.


enable

public void enable()
Enables the graph controller (the default state) after it was disabled before. If it is enabled already, this call has no effect.


getVisualGraphs

public java.util.List getVisualGraphs()
Returns the graph/view instances that are being controlled.

Returns:
the graph/view instances that are being controlled.

addVisualGraphs

public void addVisualGraphs(java.util.List visualgraphs)
Adds all the VisualGraphView instances from the given list to the controller. (Convenience method.)

Parameters:
visualgraphs - list of visualgraphs to add to the controller.

addVisualGraph

public void addVisualGraph(VisualGraphView visualgraphview)
Adds a VisualGraphView to the list of controlled views.

Parameters:
visualgraphview - the VisualGraphView to be under the control of this controller.

Find more information in the class documentation


removeVisualGraph

public void removeVisualGraph(VisualGraphView visualgraphview)
Removes a VisualGraphView from the list of controlled views.

Parameters:
visualgraphview - the VisualGraphView to be removed from the control of this controller.

Find more information in the class documentation


setPriviledgedVisualGraph

public void setPriviledgedVisualGraph(VisualGraphView visualgraphview)
Sets the preferred view of the controller.

Parameters:
visualgraphview - the preferred (master) view.
Throws:
InvalidArgumentException - if the argument is not valid (e.g. it doesn't point to a registered view or is null).

synchronize

public void synchronize()
Tells the controller to synchronize itself. Whatever specifically happens is up to the controller.


synchronize

public void synchronize(java.lang.Object info)
Tells the controller to synchronize itself. Whatever specifically happens is up to the controller.

Parameters:
info - additional information object.


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.