uci.graph
Interface GraphModel

All Known Subinterfaces:
MutableGraphModel

public abstract interface GraphModel
extends Serializable

This interface provides a facade to a net-level representation. Similiar in concept to the Swing class TreeModel.

The idea is not to have a widget (like JGraph) storing all the information that it should display, and the programmer having to keep the widget's data in synch with the application's data. Instead, the programmer defines a Model class that gives the widget access to the application data. That way there is only one copy of the data and nothing can get out of synch. If you don't have your own application data objects, there is a Default implementation of the Model that will store it for you.

Instead of asking application programmers to subclass their data objects from some predefined base class (like NetNode), this interface allows the use of any application object as a node, port, or edge. This makes it much easier to add a visualization to an existing application.

See Also:
DefaultGraphModel, AdjacencyMatrixGraphModel, uci.graph.demo.WordTransforms

Field Summary
static long serialVersionUID
           
 
Fields inherited from class java.io.Serializable
serialVersionUID
 
Method Summary
 void addGraphEventListener(GraphListener listener)
           
 Object getDestPort(Object edge)
          Return the other end of an edge
 Vector getEdges()
          Return all nodes in the graph
 Vector getInEdges(Object port)
          Return all edges going to given port
 Vector getNodes()
          Return all nodes in the graph
 Vector getOutEdges(Object port)
          Return all edges going from given port
 Object getOwner(Object port)
          Return the node or edge that owns the given port
 Vector getPorts(Object nodeOrEdge)
          Return all ports on node or edge
 Object getSourcePort(Object edge)
          Return one end of an edge
 void removeGraphEventListener(GraphListener listener)
           
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Method Detail

getNodes

public Vector getNodes()
Return all nodes in the graph

getEdges

public Vector getEdges()
Return all nodes in the graph

getPorts

public Vector getPorts(Object nodeOrEdge)
Return all ports on node or edge

getOwner

public Object getOwner(Object port)
Return the node or edge that owns the given port

getInEdges

public Vector getInEdges(Object port)
Return all edges going to given port

getOutEdges

public Vector getOutEdges(Object port)
Return all edges going from given port

getSourcePort

public Object getSourcePort(Object edge)
Return one end of an edge

getDestPort

public Object getDestPort(Object edge)
Return the other end of an edge

addGraphEventListener

public void addGraphEventListener(GraphListener listener)

removeGraphEventListener

public void removeGraphEventListener(GraphListener listener)