diva.graph.basic
Class BasicGraphModel

java.lang.Object
  extended by diva.graph.AbstractGraphModel
      extended by diva.graph.modular.ModularGraphModel
          extended by diva.graph.modular.MutableModularGraphModel
              extended by diva.graph.modular.BasicModularGraphModel
                  extended by diva.graph.basic.BasicGraphModel
All Implemented Interfaces:
GraphModel, MutableGraphModel

public class BasicGraphModel
extends BasicModularGraphModel

A basic implementation of a mutable graph model that stores its graph structure as a collection of nodes and edges (as opposed to an adjacency matrix). This class is a good reference class for how to use the diva.graph.modular classes and will suffice as a data structure for simple, throw-away applications (a heavy-weight application like a schematic editor will probably want to implement things differently.

Version:
$Id: BasicGraphModel.java 57040 2010-01-27 20:52:32Z cxh $
Author:
Michael Shilman
Accepted Rating:
Red

Nested Class Summary
private static class BasicGraphModel.BasicCompositeNode
          A simple composite node implementation.
private static class BasicGraphModel.BasicEdge
          A basic implementation of the Edge interface.
private static class BasicGraphModel.BasicNode
          A simple node implementation.
private static class BasicGraphModel.Intermediate
          A class that represents an intermediary between a semantic object and a visual representation.
 
Nested classes/interfaces inherited from class diva.graph.modular.BasicModularGraphModel
BasicModularGraphModel.BasicEdgeModel, BasicModularGraphModel.BasicNodeModel
 
Field Summary
 
Fields inherited from class diva.graph.AbstractGraphModel
_graphListeners
 
Constructor Summary
BasicGraphModel()
          Construct an empty graph model.
 
Method Summary
 CompositeNode createComposite(java.lang.Object semanticObject)
          Make a new composite node object.
 Edge createEdge(java.lang.Object semanticObject)
          Make a new edge object.
 Node createNode(java.lang.Object semanticObject)
          Make a new node object.
 
Methods inherited from class diva.graph.modular.BasicModularGraphModel
getCompositeModel, getEdgeModel, getNodeModel, getProperty, getSemanticObject, setProperty, setSemanticObject
 
Methods inherited from class diva.graph.modular.MutableModularGraphModel
acceptHead, acceptTail, addNode, connectEdge, disconnectEdge, getMutableEdgeModel, getMutableNodeModel, removeNode, setEdgeHead, setEdgeTail
 
Methods inherited from class diva.graph.modular.ModularGraphModel
containsNode, getHead, getNodeCount, getParent, getRoot, getTail, inEdges, isComposite, isDirected, isEdge, isNode, nodes, nodesAfterEdges, nodesBeforeEdges, outEdges
 
Methods inherited from class diva.graph.AbstractGraphModel
addGraphListener, dispatchGraphEvent, removeGraphListener, setDispatchEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface diva.graph.GraphModel
addGraphListener, containsNode, dispatchGraphEvent, getHead, getNodeCount, getParent, getRoot, getTail, inEdges, isComposite, isDirected, isEdge, isNode, nodes, nodesAfterEdges, nodesBeforeEdges, outEdges, removeGraphListener, setDispatchEnabled
 

Constructor Detail

BasicGraphModel

public BasicGraphModel()
Construct an empty graph model.

Method Detail

createComposite

public CompositeNode createComposite(java.lang.Object semanticObject)
Make a new composite node object.


createEdge

public Edge createEdge(java.lang.Object semanticObject)
Make a new edge object.


createNode

public Node createNode(java.lang.Object semanticObject)
Make a new node object.