org.argouml.uml.diagram.collaboration
Class CollabDiagramGraphModel

java.lang.Object
  |
  +--org.tigris.gef.graph.MutableGraphSupport
        |
        +--org.argouml.uml.diagram.UMLMutableGraphSupport
              |
              +--org.argouml.uml.diagram.collaboration.CollabDiagramGraphModel
All Implemented Interfaces:
java.util.EventListener, org.tigris.gef.graph.GraphModel, org.tigris.gef.graph.MutableGraphModel, java.io.Serializable, java.beans.VetoableChangeListener

public class CollabDiagramGraphModel
extends UMLMutableGraphSupport
implements java.beans.VetoableChangeListener

This class defines a bridge between the UML meta-model representation of the design and the GraphModel interface used by GEF. This class handles only UML Use Case Digrams.

See Also:
Serialized Form

Field Summary
protected  ru.novosoft.uml.behavior.collaborations.MCollaboration _collab
          The collaboration / interaction we are diagramming
protected  ru.novosoft.uml.behavior.collaborations.MInteraction _interaction
           
protected static org.apache.log4j.Category cat
           
 
Fields inherited from class org.argouml.uml.diagram.UMLMutableGraphSupport
_edges, _nodes
 
Fields inherited from class org.tigris.gef.graph.MutableGraphSupport
_graphListeners
 
Constructor Summary
CollabDiagramGraphModel()
           
 
Method Summary
 void addEdge(java.lang.Object edge)
          Add the given edge to the graph, if valid.
 void addNode(java.lang.Object node)
          Add the given node to the graph, if valid.
 void addNodeRelatedEdges(java.lang.Object node)
           
 boolean canAddEdge(java.lang.Object edge)
          Return true if the given object is a valid edge in this graph
 boolean canAddNode(java.lang.Object node)
          Return true if the given object is a valid node in this graph
 boolean canConnect(java.lang.Object fromP, java.lang.Object toP)
          Return true if the two given ports can be connected by a kind of edge to be determined by the ports.
 java.lang.Object connect(java.lang.Object fromPort, java.lang.Object toPort)
          Contruct and add a new edge of a kind determined by the ports
 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
 java.lang.Object getDestPort(java.lang.Object edge)
          Return the other end of an edge
 java.util.Vector getInEdges(java.lang.Object port)
          Return all edges going to given port
 ru.novosoft.uml.foundation.core.MNamespace getNamespace()
           
 java.util.Vector getOutEdges(java.lang.Object port)
          Return all edges going from given port
 java.lang.Object getOwner(java.lang.Object port)
          Return the node or edge that owns the given port
 java.util.Vector getPorts(java.lang.Object nodeOrEdge)
          Return all ports on node or edge
 java.lang.Object getSourcePort(java.lang.Object edge)
          Return one end of an edge
 void setNamespace(ru.novosoft.uml.foundation.core.MNamespace m)
           
 void vetoableChange(java.beans.PropertyChangeEvent pce)
           
 
Methods inherited from class org.argouml.uml.diagram.UMLMutableGraphSupport
constainsEdge, containsNode, getEdges, getNodes, removeEdge, removeNode
 
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
 

Field Detail

cat

protected static org.apache.log4j.Category cat

_collab

protected ru.novosoft.uml.behavior.collaborations.MCollaboration _collab
The collaboration / interaction we are diagramming

_interaction

protected ru.novosoft.uml.behavior.collaborations.MInteraction _interaction
Constructor Detail

CollabDiagramGraphModel

public CollabDiagramGraphModel()
Method Detail

getNamespace

public ru.novosoft.uml.foundation.core.MNamespace getNamespace()

setNamespace

public void setNamespace(ru.novosoft.uml.foundation.core.MNamespace m)

getPorts

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

getOwner

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

getInEdges

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

getOutEdges

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

getSourcePort

public java.lang.Object getSourcePort(java.lang.Object edge)
Return one end of an edge

getDestPort

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

canAddNode

public boolean canAddNode(java.lang.Object node)
Return true if the given object is a valid node in this graph

canAddEdge

public boolean canAddEdge(java.lang.Object edge)
Return true if the given object is a valid edge in this graph

addNode

public void addNode(java.lang.Object node)
Add the given node to the graph, if valid.

addEdge

public void addEdge(java.lang.Object edge)
Add the given edge to the graph, if valid.

addNodeRelatedEdges

public void addNodeRelatedEdges(java.lang.Object node)

canConnect

public boolean canConnect(java.lang.Object fromP,
                          java.lang.Object toP)
Return true if the two given ports can be connected by a kind of edge to be determined by the ports.

connect

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

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
Overrides:
connect in class org.tigris.gef.graph.MutableGraphSupport

vetoableChange

public void vetoableChange(java.beans.PropertyChangeEvent pce)
Specified by:
vetoableChange in interface java.beans.VetoableChangeListener


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook