Cytoscape 2.8.0 API

cytoscape.view
Class GraphViewController

java.lang.Object
  extended by cytoscape.view.GraphViewController
All Implemented Interfaces:
GraphPerspectiveChangeListener, EventListener

public class GraphViewController
extends Object
implements GraphPerspectiveChangeListener


Field Summary
static GraphViewHandler DEFAULT_GRAPH_VIEW_HANDLER
           
protected  Map gpToGv
           
protected  Map graphViewToHandler
           
 
Constructor Summary
GraphViewController()
          Empty constructor, initializes class members to empty HashMaps.
GraphViewController(GraphView[] graph_views)
          Constructor, assigns GraphViewController.DEFAULT_GRAPH_VIEW_HANDLER to all the given giny.view.GraphView objects in the array.
GraphViewController(GraphView[] graph_views, Map gv_to_handler)
          Constructor, specifies the cytoscape.view.GraphViewHandler objects for the given giny.view.GraphView objects in the arrays.
 
Method Summary
 boolean addGraphView(GraphView graph_view)
          Adds to the set of giny.view.GraphView objects that this GraphViewController keeps synchronized with their giny.model.GraphPerspective objects.
 boolean addGraphView(GraphView graph_view, GraphViewHandler gv_handler)
          Adds to the set of giny.view.GraphView objects that this GraphViewController keeps synchronized to their giny.model.GraphPerspective objects.
 boolean containsGraphView(GraphView graph_view)
          Whether or not the given giny.view.GraphView is kept synchronized with its giny.model.GraphPerspective member by this GraphViewController.
 GraphViewHandler getGraphViewHandler(GraphView graph_view)
          Gets the cytoscape.view.GraphViewHandler for the given giny.view.GraphView
 Map getGraphViewHandlersMap()
          Gets a Map with giny.view.GraphView objects as keys, and cytoscape.view.GraphViewHandler objects as values, two or more different keys can share the same value.
 GraphView[] getGraphViews()
          Gets an array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method
 void graphPerspectiveChanged(GraphPerspectiveChangeEvent event)
          Invoked when a graph change to any of the giny.model.GraphPerspective objects accessed through giny.view.GraphView.getGraphPerspective() of this object's graphViews is made.
 GraphView[] removeAllGraphViews()
          Removes all of the current giny.view.GraphView objects that this GraphViewController keeps synchronized to their corresponding giny.model.GraphPerspective members.
 GraphViewHandler removeGraphView(GraphView graph_view)
          If this GraphViewController contains the given giny.view.GraphView, then it is removed from it, and it no longer listens for change events from the removed giny.view.GraphView's giny.model.GraphPerspective.
 void resumeListening()
          It adds this GraphViewController as a listener for all giny.model.GraphPerspective that were temporarily "removed" by calling stopListening(), it updates the GraphViews of the GraphPerspectives so that they are synchronized to reflect changes that may have occured while not listening.
 void resumeListening(GraphView graph_view)
          It adds this GraphViewController listener to the giny.model.GraphPerspective of the given giny.view.GraphView that was temporarily "removed" by a call to stopListening(GraphView), it updates graph_view so that it's synchronized to its GraphPerspective due to changes that may have occured while not listening.
 boolean setGraphViewHandler(GraphView graph_view, GraphViewHandler gv_handler)
          If the given giny.view.GraphView object belongs to this GraphViewController, then its GraphViewHandler is set to the given one.
 void setGraphViews(GraphView[] graph_views)
          Sets the array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method, the DEFAULT_GRAPH_VIEW_HANDLER is set for all the views.
 void setGraphViews(GraphView[] graph_views, Map gv_to_handler)
          Sets the array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method, the cytoscape.view.GraphViewHandler objects for the GraphViews are obtained from the given Map, if a GraphView in the array is not a key in the Map then DEFAULT_GRAPH_VIEW_HANDLER is used.
 void stopListening()
          It temporarily removes this GraphViewController as a listener for all giny.model.GraphPerspective objects that it currently listens to
 void stopListening(GraphView graph_view)
          It temporarily removes this GraphViewController listener from the giny.model.GraphPerspective object that the given giny.view.GraphView views.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graphViewToHandler

protected Map graphViewToHandler

gpToGv

protected Map gpToGv

DEFAULT_GRAPH_VIEW_HANDLER

public static final GraphViewHandler DEFAULT_GRAPH_VIEW_HANDLER
Constructor Detail

GraphViewController

public GraphViewController()
Empty constructor, initializes class members to empty HashMaps.


GraphViewController

public GraphViewController(GraphView[] graph_views)
Constructor, assigns GraphViewController.DEFAULT_GRAPH_VIEW_HANDLER to all the given giny.view.GraphView objects in the array.

Parameters:
graph_views - an array of giny.view.GraphView objects that this GraphViewController will keep synchronized to their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method.

GraphViewController

public GraphViewController(GraphView[] graph_views,
                           Map gv_to_handler)
Constructor, specifies the cytoscape.view.GraphViewHandler objects for the given giny.view.GraphView objects in the arrays.

Parameters:
graph_views - an array of giny.view.GraphView objects that this GraphViewController will keep synchronized to their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method
gv_to_handler - a Map with giny.view.GraphView objects as keys, and cytoscape.view.GraphViewHandler objects as values, two or more different keys can share the same value, the DEFAULT_GRAPH_VIEW_HANDLER will be set for giny.view.GraphView objects that are not keys in the given Map
Method Detail

setGraphViews

public void setGraphViews(GraphView[] graph_views)
Sets the array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method, the DEFAULT_GRAPH_VIEW_HANDLER is set for all the views. Any previous GraphView objects are removed from this listener

Parameters:
graph_views - an array of giny.view.GraphView objects

setGraphViews

public void setGraphViews(GraphView[] graph_views,
                          Map gv_to_handler)
Sets the array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method, the cytoscape.view.GraphViewHandler objects for the GraphViews are obtained from the given Map, if a GraphView in the array is not a key in the Map then DEFAULT_GRAPH_VIEW_HANDLER is used. Any previous GraphView objects are removed from this listener

Parameters:
graph_views - an array of giny.view.GraphView objects
gv_to_handler - a Map with giny.view.GraphView for keys and cytoscape.view.GraphViewHandler objects for values

getGraphViews

public GraphView[] getGraphViews()
Gets an array of giny.view.GraphView objects that this GraphViewController will keep synchronized with their corresponding giny.model.GraphPerspective objects available through their getGraphPerspective() method

Returns:
an array of giny.view.GraphView objects

getGraphViewHandlersMap

public Map getGraphViewHandlersMap()
Gets a Map with giny.view.GraphView objects as keys, and cytoscape.view.GraphViewHandler objects as values, two or more different keys can share the same value.

Returns:
the Map that specifies what cytoscape.view.GraphViewHandler objects handle the giny.view.GraphView objects in this controller.

getGraphViewHandler

public GraphViewHandler getGraphViewHandler(GraphView graph_view)
Gets the cytoscape.view.GraphViewHandler for the given giny.view.GraphView

Returns:
a cytoscape.view.GraphViewHandler, or null if this GraphViewController does not control the given giny.view.GraphView

removeGraphView

public GraphViewHandler removeGraphView(GraphView graph_view)
If this GraphViewController contains the given giny.view.GraphView, then it is removed from it, and it no longer listens for change events from the removed giny.view.GraphView's giny.model.GraphPerspective.

Parameters:
graph_view - the giny.view.GraphView that will be removed
Returns:
the removed giny.view.GraphView's cytoscape.view.GraphViewHandler, or null if it is not in this GraphViewController

addGraphView

public boolean addGraphView(GraphView graph_view)
Adds to the set of giny.view.GraphView objects that this GraphViewController keeps synchronized with their giny.model.GraphPerspective objects. DEFAULT_GRAPH_VIEW_HANDLER is used for the given giny.view.GraphView

Parameters:
graph_view - the giny.view.GraphView to be added
Returns:
true if succesfully added, false otherwise (if it was already added)
See Also:
GraphViewController.setGraphViewHandler

addGraphView

public boolean addGraphView(GraphView graph_view,
                            GraphViewHandler gv_handler)
Adds to the set of giny.view.GraphView objects that this GraphViewController keeps synchronized to their giny.model.GraphPerspective objects. The given GraphViewHandler is used for the given giny.view.GraphView object.

Parameters:
graph_view - the giny.view.GraphView to be added
gv_to_handler - the GraphViewHandler that will handle change events from graph_view's giny.model.GraphPerspective member
Returns:
true if succesfully added, false otherwise (if graph_view is already in this controller)
See Also:
setGraphViewHandler

setGraphViewHandler

public boolean setGraphViewHandler(GraphView graph_view,
                                   GraphViewHandler gv_handler)
If the given giny.view.GraphView object belongs to this GraphViewController, then its GraphViewHandler is set to the given one.

Parameters:
graph_view - the giny.view.GraphView to be updated
gv_handler - the GraphViewHandler that will handle change events from graph_view's giny.model.GraphPerspective
Returns:
true if the method was successful, false otherwise (if graph_view is not in this controller)

removeAllGraphViews

public GraphView[] removeAllGraphViews()
Removes all of the current giny.view.GraphView objects that this GraphViewController keeps synchronized to their corresponding giny.model.GraphPerspective members. This GraphViewController will no longer receive events from giny.model.GraphPerspectives after this call.

Returns:
the array of removed giny.view.GraphView objects

containsGraphView

public boolean containsGraphView(GraphView graph_view)
Whether or not the given giny.view.GraphView is kept synchronized with its giny.model.GraphPerspective member by this GraphViewController.

Parameters:
graph_view - the giny.view.GraphView object to test

stopListening

public void stopListening()
It temporarily removes this GraphViewController as a listener for all giny.model.GraphPerspective objects that it currently listens to

See Also:
resumeListening

stopListening

public void stopListening(GraphView graph_view)
It temporarily removes this GraphViewController listener from the giny.model.GraphPerspective object that the given giny.view.GraphView views.

See Also:
resumeListening(GraphView)

resumeListening

public void resumeListening()
It adds this GraphViewController as a listener for all giny.model.GraphPerspective that were temporarily "removed" by calling stopListening(), it updates the GraphViews of the GraphPerspectives so that they are synchronized to reflect changes that may have occured while not listening.

See Also:
stopListening

resumeListening

public void resumeListening(GraphView graph_view)
It adds this GraphViewController listener to the giny.model.GraphPerspective of the given giny.view.GraphView that was temporarily "removed" by a call to stopListening(GraphView), it updates graph_view so that it's synchronized to its GraphPerspective due to changes that may have occured while not listening.

See Also:
stopListening(GraphView)

graphPerspectiveChanged

public void graphPerspectiveChanged(GraphPerspectiveChangeEvent event)
Invoked when a graph change to any of the giny.model.GraphPerspective objects accessed through giny.view.GraphView.getGraphPerspective() of this object's graphViews is made.

Specified by:
graphPerspectiveChanged in interface GraphPerspectiveChangeListener
Parameters:
event - the event that was generated, contains the source giny.model.GraphPerspective

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.