org.tigris.gef.graph
Interface GraphModel

All Superinterfaces:
BaseGraphModel, java.io.Serializable
All Known Subinterfaces:
MutableGraphModel
All Known Implementing Classes:
AdjacencyListGraphModel, DefaultGraphModel, MutableGraphSupport

public interface GraphModel
extends BaseGraphModel

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.


Method Summary
 java.util.List getEdges()
          Return all nodes in the graph
 java.util.List getInEdges(java.lang.Object port)
          Return all edges going to given port
 java.util.List getNodes()
          Return all nodes in the graph
 java.util.List getOutEdges(java.lang.Object port)
          Return all edges going from given port
 java.util.List getPorts(java.lang.Object nodeOrEdge)
          Return all ports on node or edge
 void setConnectionConstrainer(ConnectionConstrainer cc)
          Set the rules dictating which ports are connectable by which edge
 
Methods inherited from interface org.tigris.gef.graph.BaseGraphModel
addGraphEventListener, getDestPort, getOwner, getSourcePort, removeGraphEventListener
 

Method Detail

getNodes

java.util.List getNodes()
Return all nodes in the graph


getEdges

java.util.List getEdges()
Return all nodes in the graph


getPorts

java.util.List getPorts(java.lang.Object nodeOrEdge)
Return all ports on node or edge


getInEdges

java.util.List getInEdges(java.lang.Object port)
Return all edges going to given port


getOutEdges

java.util.List getOutEdges(java.lang.Object port)
Return all edges going from given port


setConnectionConstrainer

void setConnectionConstrainer(ConnectionConstrainer cc)
Set the rules dictating which ports are connectable by which edge

Parameters:
cc - A connection constrainer