org.argouml.uml.diagram
Class UMLMutableGraphSupport

java.lang.Object
  extended byorg.tigris.gef.graph.MutableGraphSupport
      extended byorg.argouml.uml.diagram.UMLMutableGraphSupport
All Implemented Interfaces:
org.tigris.gef.graph.GraphModel, org.tigris.gef.graph.MutableGraphModel, java.io.Serializable
Direct Known Subclasses:
ClassDiagramGraphModel, CollabDiagramGraphModel, DeploymentDiagramGraphModel, SequenceDiagramGraphModel, StateDiagramGraphModel, UseCaseDiagramGraphModel

public abstract class UMLMutableGraphSupport
extends org.tigris.gef.graph.MutableGraphSupport

UMLMutableGraphSupport is a helper class which extends MutableGraphSupport to provide additional helper and common methods for UML Diagrams.

See Also:
Serialized Form

Field Summary
protected  java.util.Vector _edges
          constains all the edges in the graphmodel/diagram.
protected  java.util.Vector _nodes
          contains all the nodes in the graphmodel/diagram.
protected static org.apache.log4j.Category cat
           
 
Fields inherited from class org.tigris.gef.graph.MutableGraphSupport
_graphListeners
 
Constructor Summary
UMLMutableGraphSupport()
          constructor.
 
Method Summary
 boolean canConnect(java.lang.Object fromP, java.lang.Object toP)
          Assume that anything can be connected to anything unless overridden in a subclass.
 java.lang.Object connect(java.lang.Object fromPort, java.lang.Object toPort)
          The connect method without specifying a connection type is unavailable by default
 java.lang.Object connect(java.lang.Object fromPort, java.lang.Object toPort, java.lang.Class edgeClass)
          Contruct and add a new edge of the given kind and connect the given ports.
 boolean constainsEdge(java.lang.Object edge)
           
 boolean containsNode(java.lang.Object node)
           
 java.util.Vector getEdges()
          get all the edges from the graphmodel/diagram
 java.util.Vector getNodes()
          get all the nodes from the graphmodel/diagram
 void removeEdge(java.lang.Object edge)
          remove an edge from the graphmodel and notify GEF
 void removeNode(java.lang.Object node)
          remove a node from the diagram and notify GEF
 
Methods inherited from class org.tigris.gef.graph.MutableGraphSupport
addGraphEventListener, canChangeConnectedNode, canConnect, canDragNode, changeConnectedNode, containsEdge, containsEdgePort, containsNodePort, containsPort, dragNode, fireEdgeAdded, fireEdgeRemoved, fireGraphChanged, fireNodeAdded, fireNodeRemoved, getGraphListeners, removeGraphEventListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.tigris.gef.graph.MutableGraphModel
addEdge, addNode, addNodeRelatedEdges, canAddEdge, canAddNode
 
Methods inherited from interface org.tigris.gef.graph.GraphModel
getDestPort, getInEdges, getOutEdges, getOwner, getPorts, getSourcePort
 

Field Detail

cat

protected static org.apache.log4j.Category cat

_nodes

protected java.util.Vector _nodes
contains all the nodes in the graphmodel/diagram.


_edges

protected java.util.Vector _edges
constains all the edges in the graphmodel/diagram.

Constructor Detail

UMLMutableGraphSupport

public UMLMutableGraphSupport()
constructor.

See Also:
MutableGraphSupport
Method Detail

getNodes

public java.util.Vector getNodes()
get all the nodes from the graphmodel/diagram

Returns:
Vector of nodes in the graphmodel/diagram
See Also:
GraphModel.getNodes()

getEdges

public java.util.Vector getEdges()
get all the edges from the graphmodel/diagram

Returns:
Vector of edges in the graphmodel/diagram

containsNode

public boolean containsNode(java.lang.Object node)

constainsEdge

public boolean constainsEdge(java.lang.Object edge)

removeNode

public void removeNode(java.lang.Object node)
remove a node from the diagram and notify GEF

Parameters:
node - node to remove

removeEdge

public void removeEdge(java.lang.Object edge)
remove an edge from the graphmodel and notify GEF

Parameters:
edge - edge to remove

canConnect

public boolean canConnect(java.lang.Object fromP,
                          java.lang.Object toP)
Assume that anything can be connected to anything unless overridden in a subclass.


connect

public java.lang.Object connect(java.lang.Object fromPort,
                                java.lang.Object toPort)
The connect method without specifying a connection type is unavailable by default


connect

public java.lang.Object connect(java.lang.Object fromPort,
                                java.lang.Object toPort,
                                java.lang.Class edgeClass)
Contruct and add a new edge of the given kind and connect the given ports.

Parameters:
fromPort - The originating port to connect
toPort - The destination port to connect
edgeClass - The NSUML type of edge to create.
Returns:
The type of edge created (the same as edgeClass if we succeeded, null otherwise)


ArgoUML © 1996-2003 (20040125)ArgoUML Project HomeArgoUML Cookbook