uci.uml.visual
Class UseCaseDiagramGraphModel

java.lang.Object
  |
  +--uci.graph.MutableGraphSupport
        |
        +--uci.uml.visual.UseCaseDiagramGraphModel

public class UseCaseDiagramGraphModel
extends MutableGraphSupport
implements MutableGraphModel, 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  Vector _edges
           
protected  Namespace _model
          The "home" UML model of this diagram, not all ModelElements in this graph are in the home model, but if they are added and don't already have a model, they are placed in the "home model".
protected  Vector _nodes
           
 
Fields inherited from class uci.graph.MutableGraphSupport
_graphListeners
 
Constructor Summary
UseCaseDiagramGraphModel()
           
 
Method Summary
 void addEdge(Object edge)
          Add the given edge to the graph, if valid.
 void addNode(Object node)
          Add the given node to the graph, if valid.
 boolean canAddEdge(Object edge)
          Return true if the given object is a valid edge in this graph
 boolean canAddNode(Object node)
          Return true if the given object is a valid node in this graph
 boolean canConnect(Object fromP, Object toP)
          Return true if the two given ports can be connected by a kind of edge to be determined by the ports.
 Object connect(Object fromPort, Object toPort)
          Contruct and add a new edge of a kind determined by the ports
 Object connect(Object fromPort, Object toPort, Class edgeClass)
          Contruct and add a new edge of the given kind
 Object getDestPort(Object edge)
          Return the other end of an edge
 Vector getEdges()
          Return all nodes in the graph
 Vector getInEdges(Object port)
          Return all edges going to given port
 Namespace getNamespace()
           
 Vector getNodes()
          Return all nodes in the graph
 Vector getOutEdges(Object port)
          Return all edges going from given port
 Object getOwner(Object port)
          Return the node or edge that owns the given port
 Vector getPorts(Object nodeOrEdge)
          Return all ports on node or edge
 Object getSourcePort(Object edge)
          Return one end of an edge
 void removeEdge(Object edge)
          Remove the given edge from the graph.
 void removeNode(Object node)
          Remove the given node from the graph.
 void setNamespace(Namespace m)
           
 void vetoableChange(PropertyChangeEvent pce)
           
 
Methods inherited from class uci.graph.MutableGraphSupport
addGraphEventListener, canConnect, containsEdge, containsEdgePort, containsNode, containsNodePort, containsPort, 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

_nodes

protected Vector _nodes

_edges

protected Vector _edges

_model

protected Namespace _model
The "home" UML model of this diagram, not all ModelElements in this graph are in the home model, but if they are added and don't already have a model, they are placed in the "home model". Also, elements from other models will have their FigNodes add a line to say what their model is.
Constructor Detail

UseCaseDiagramGraphModel

public UseCaseDiagramGraphModel()
Method Detail

getNamespace

public Namespace getNamespace()

setNamespace

public void setNamespace(Namespace m)

getNodes

public Vector getNodes()
Return all nodes in the graph

getEdges

public Vector getEdges()
Return all nodes in the graph

getPorts

public Vector getPorts(Object nodeOrEdge)
Return all ports on node or edge

getOwner

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

getInEdges

public Vector getInEdges(Object port)
Return all edges going to given port

getOutEdges

public Vector getOutEdges(Object port)
Return all edges going from given port

getSourcePort

public Object getSourcePort(Object edge)
Return one end of an edge

getDestPort

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

canAddNode

public boolean canAddNode(Object node)
Return true if the given object is a valid node in this graph
Specified by:
canAddNode in interface MutableGraphModel

canAddEdge

public boolean canAddEdge(Object edge)
Return true if the given object is a valid edge in this graph
Specified by:
canAddEdge in interface MutableGraphModel

removeNode

public void removeNode(Object node)
Remove the given node from the graph.
Specified by:
removeNode in interface MutableGraphModel

addNode

public void addNode(Object node)
Add the given node to the graph, if valid.
Specified by:
addNode in interface MutableGraphModel

addEdge

public void addEdge(Object edge)
Add the given edge to the graph, if valid.
Specified by:
addEdge in interface MutableGraphModel

removeEdge

public void removeEdge(Object edge)
Remove the given edge from the graph.
Specified by:
removeEdge in interface MutableGraphModel

canConnect

public boolean canConnect(Object fromP,
                          Object toP)
Return true if the two given ports can be connected by a kind of edge to be determined by the ports.
Specified by:
canConnect in interface MutableGraphModel

connect

public Object connect(Object fromPort,
                      Object toPort)
Contruct and add a new edge of a kind determined by the ports
Specified by:
connect in interface MutableGraphModel

connect

public Object connect(Object fromPort,
                      Object toPort,
                      Class edgeClass)
Contruct and add a new edge of the given kind
Specified by:
connect in interface MutableGraphModel
Overrides:
connect in class MutableGraphSupport

vetoableChange

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