org.argouml.uml.diagram
Class UMLMutableGraphSupport

java.lang.Object
  |
  +--MutableGraphSupport
        |
        +--org.argouml.uml.diagram.UMLMutableGraphSupport
Direct Known Subclasses:
ClassDiagramGraphModel, CollabDiagramGraphModel, DeploymentDiagramGraphModel, SequenceDiagramGraphModel, StateDiagramGraphModel, UseCaseDiagramGraphModel

public abstract class UMLMutableGraphSupport
extends 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 Logger cat
           
 
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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static Logger 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:
org.tigris.gef.graph.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:
org.tigris.gef.graph.MutableGraphSupport#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-2004 (20040306)ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook