Cytoscape 2.6.2 (c) 2006,2007 ISB, MSKCC, UCSD

cytoscape.view
Class BasicGraphViewHandler

java.lang.Object
  extended by cytoscape.view.BasicGraphViewHandler
All Implemented Interfaces:
GraphViewHandler

public class BasicGraphViewHandler
extends Object
implements GraphViewHandler

A basic GraphViewHandler that simply reflects GraphPerspective changes on a given GraphView


Constructor Summary
BasicGraphViewHandler()
          Constructor
 
Method Summary
 void handleGraphPerspectiveEvent(GraphPerspectiveChangeEvent event, GraphView graph_view)
          Handles the event as desired by updating the given giny.view.GraphView.
static void positionToBarycenter(NodeView node_view)
          If the node that node_view represents is a meta-node, then it positions it at the barycenter of its viewable children nodes.
static Edge[] removeGraphViewEdges(GraphView graph_view, Edge[] edges)
          It removes the views of the edges in the array from the given giny.view.GraphView object.
static int[] removeGraphViewEdges(GraphView graph_view, int[] edge_indices)
          It removes the views of the edges in the array from the given giny.view.GraphView object.
static int[] removeGraphViewNodes(GraphView graph_view, int[] node_indices)
          It removes the views of the nodes with the given indices that are contained in the given giny.view.GraphView object, it also removes the connected edges to these nodes (an edge without a connecting node makes no mathematical sense).
static Node[] removeGraphViewNodes(GraphView graph_view, Node[] nodes)
          It removes the nodes in the array from the given giny.view.GraphView object, it also removes the connected edges to these nodes (an edge without a connecting node makes no mathematical sense).
static Edge[] restoreGraphViewEdges(GraphView graph_view, Edge[] edges)
          It restores the views of the edges in the array in the given giny.view.GraphView object
static int[] restoreGraphViewEdges(GraphView graph_view, int[] edge_indices)
          It restores the views of the edges with the given indices in the given giny.view.GraphView object
static int[] restoreGraphViewNodes(GraphView graph_view, int[] node_indices, boolean restore_connected_edges)
          It restores the views of the nodes with the given indices in the given giny.view.GraphView object
static Node[] restoreGraphViewNodes(GraphView graph_view, Node[] nodes, boolean restore_connected_edges)
          It restores the views of the nodes in the array in the given giny.view.GraphView object
static Edge[] selectGraphViewEdges(GraphView graph_view, Edge[] edges)
          It selects the edges in the array in the given giny.view.GraphView object.
static Node[] selectGraphViewNodes(GraphView graph_view, Node[] nodes)
          It selects the nodes in the array in the given giny.view.GraphView object.
static Edge[] unselectGraphViewEdges(GraphView graph_view, Edge[] edges)
          It unselects the edges in the array in the given giny.view.GraphView object
static Node[] unselectGraphViewNodes(GraphView graph_view, Node[] nodes)
          It unselects the nodes in the array in the given giny.view.GraphView object
 void updateGraphView(GraphView graph_view)
          Updates the given graph_view to contain node and edge visual representations of only nodes and edges that are in its GraphPerspective
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGraphViewHandler

public BasicGraphViewHandler()
Constructor

Method Detail

handleGraphPerspectiveEvent

public void handleGraphPerspectiveEvent(GraphPerspectiveChangeEvent event,
                                        GraphView graph_view)
Handles the event as desired by updating the given giny.view.GraphView.

Specified by:
handleGraphPerspectiveEvent in interface GraphViewHandler
Parameters:
event - the event to handle
graph_view - the giny.view.GraphView that views the giny.model.GraphPerspective that generated the event and that should be updated as necessary

removeGraphViewEdges

public static Edge[] removeGraphViewEdges(GraphView graph_view,
                                          Edge[] edges)
It removes the views of the edges in the array from the given giny.view.GraphView object.

Parameters:
graph_view - the giny.view.GraphView object from which edges will be removed
edges - the edges whose views will be removed
Returns:
an array of edges that were removed

removeGraphViewEdges

public static int[] removeGraphViewEdges(GraphView graph_view,
                                         int[] edge_indices)
It removes the views of the edges in the array from the given giny.view.GraphView object.

Parameters:
graph_view - the giny.view.GraphView object from which edges will be removed
edge_indices - the indices of the edges that will be removed
Returns:
an array of edge indices that were removed

restoreGraphViewEdges

public static Edge[] restoreGraphViewEdges(GraphView graph_view,
                                           Edge[] edges)
It restores the views of the edges in the array in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which edges will be restored
edges - the edges that will be restored
Returns:
an array of edges that were restored

restoreGraphViewEdges

public static int[] restoreGraphViewEdges(GraphView graph_view,
                                          int[] edge_indices)
It restores the views of the edges with the given indices in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which edges' views will be restored
edge_indices - the indices of the edges that will be restored
Returns:
an array of indices of edges that were restored

selectGraphViewEdges

public static Edge[] selectGraphViewEdges(GraphView graph_view,
                                          Edge[] edges)
It selects the edges in the array in the given giny.view.GraphView object.

Parameters:
graph_view - the giny.view.GraphView object in which edges will be selected
edges - the edges in graph_view that will be selected
Returns:
the edges that were selected

unselectGraphViewEdges

public static Edge[] unselectGraphViewEdges(GraphView graph_view,
                                            Edge[] edges)
It unselects the edges in the array in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which edges will be unselected
edges - the edges that will be unselected in graph_view
Returns:
an array of edges that were unselected

removeGraphViewNodes

public static Node[] removeGraphViewNodes(GraphView graph_view,
                                          Node[] nodes)
It removes the nodes in the array from the given giny.view.GraphView object, it also removes the connected edges to these nodes (an edge without a connecting node makes no mathematical sense).

Parameters:
graph_view - the giny.view.GraphView object from which nodes will be removed
nodes - the nodes whose views will be removed from graph_view
Returns:
an array of nodes that were removed

removeGraphViewNodes

public static int[] removeGraphViewNodes(GraphView graph_view,
                                         int[] node_indices)
It removes the views of the nodes with the given indices that are contained in the given giny.view.GraphView object, it also removes the connected edges to these nodes (an edge without a connecting node makes no mathematical sense).

Parameters:
graph_view - the giny.view.GraphView object from which nodes will be removed
node_indices - the indices of the nodes that will be removed
Returns:
an array of indices of nodes that were removed

restoreGraphViewNodes

public static Node[] restoreGraphViewNodes(GraphView graph_view,
                                           Node[] nodes,
                                           boolean restore_connected_edges)
It restores the views of the nodes in the array in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which nodes will be restored
nodes - the nodes whose views will be restored in graph_view
restore_connected_edges - whether or not the connected edges to the restored nodes should also be restored or not (for now this argument is ignored)
Returns:
an array of nodes that were restored

restoreGraphViewNodes

public static int[] restoreGraphViewNodes(GraphView graph_view,
                                          int[] node_indices,
                                          boolean restore_connected_edges)
It restores the views of the nodes with the given indices in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which node views will be restored
node_indices - the indices of the nodes whose views will be restored
restore_connected_edges - whether or not the connected edges to the restored nodes should also be restored or not (for now this argument is ignored)
Returns:
an array of indices of the nodes whose views were restored

selectGraphViewNodes

public static Node[] selectGraphViewNodes(GraphView graph_view,
                                          Node[] nodes)
It selects the nodes in the array in the given giny.view.GraphView object.

Parameters:
graph_view - the giny.view.GraphView object in which nodes will be selected
nodes - the nodes in graph_view that will be selected
Returns:
the nodes that were selected

unselectGraphViewNodes

public static Node[] unselectGraphViewNodes(GraphView graph_view,
                                            Node[] nodes)
It unselects the nodes in the array in the given giny.view.GraphView object

Parameters:
graph_view - the giny.view.GraphView object in which nodes will be unselected
nodes - the nodes that will be unselected in graph_view
Returns:
an array of nodes that were unselected

positionToBarycenter

public static void positionToBarycenter(NodeView node_view)
If the node that node_view represents is a meta-node, then it positions it at the barycenter of its viewable children nodes.

Parameters:
node_view - the giny.view.NodeView that will be positioned to the barycenter of its children

updateGraphView

public void updateGraphView(GraphView graph_view)
Updates the given graph_view to contain node and edge visual representations of only nodes and edges that are in its GraphPerspective

Specified by:
updateGraphView in interface GraphViewHandler
Parameters:
graph_view - the giny.view.GraphView that views the should be updated as necessary
See Also:
GraphViewController.resumeListening(), GraphViewController.resumeListening(GraphView)

www.cytoscape.org