diva.graphx.tutorial
Class SimpleGraphController

java.lang.Object
  extended by diva.graphx.GraphController
      extended by diva.graphx.tutorial.SimpleGraphController

public class SimpleGraphController
extends GraphController

A concrete subclass of GraphController that we use in the tutorial examples. This subclasses uses BasicEdgeAdapter and BasicNodeAdapter. It also sets up some default interaction on the pane which works for creating nodes and edges between them.

Version:
$Revision: 1.4 $
Author:
Michael Shilman (michaels@eecs.berkeley.edu), John Reekie (johnr@eecs.berkeley.edu)

Nested Class Summary
protected  class SimpleGraphController.NodeCreator
          An inner class that places a node at the clicked-on point on the screen, if control-clicked with mouse button 1.
 
Constructor Summary
SimpleGraphController(GraphicsPane pane, GraphModel model)
          Create a new controller with default node and edge controllers.
 
Method Summary
 EdgeController getEdgeController(Object edge)
          Return the edge controller.
 NodeController getNodeController(Object node)
          Return the node controller.
protected  void initializeInteraction()
          Initialize interaction on the graph pane.
 
Methods inherited from class diva.graphx.GraphController
addEdge, addEdge, addGraphViewListener, addNode, addNode, dispatch, getGraphicsPane, getGraphModel, getSelectionModel, removeEdge, removeGraphViewListener, removeNode, render, rerender, rerenderSubGraph, setGraphicsPane, setGraphModel, setHead, setSelectionModel, setTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleGraphController

public SimpleGraphController(GraphicsPane pane,
                             GraphModel model)
Create a new controller with default node and edge controllers.

Method Detail

getEdgeController

public EdgeController getEdgeController(Object edge)
Return the edge controller.

Specified by:
getEdgeController in class GraphController

getNodeController

public NodeController getNodeController(Object node)
Return the node controller.

Specified by:
getNodeController in class GraphController

initializeInteraction

protected void initializeInteraction()
Initialize interaction on the graph pane. In this controller, we set up interaction for the usual dragging and selection. Also, control-click in the pane creates a new node, and control-click on a node creates and starts dragging a new edge.

Specified by:
initializeInteraction in class GraphController


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.