|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.tigris.gef.graph.MutableGraphSupport
org.argouml.uml.diagram.UMLMutableGraphSupport
org.argouml.uml.diagram.use_case.UseCaseDiagramGraphModel
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 Diagrams.
Field Summary | |
protected java.lang.Object |
_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 static org.apache.log4j.Logger |
cat
Deprecated. by Linus Tolke as of 0.15.4. Use your own logger in your class. This will be removed. |
(package private) static long |
serialVersionUID
|
Fields inherited from class org.argouml.uml.diagram.UMLMutableGraphSupport |
_edges, _nodes |
Fields inherited from class org.tigris.gef.graph.MutableGraphSupport |
_graphListeners |
Constructor Summary | |
UseCaseDiagramGraphModel()
|
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)
Add the various types of edge that may be connected with the given node. |
boolean |
canAddEdge(java.lang.Object edge)
Determine if the given edge can validly be placed on this graph. |
boolean |
canAddNode(java.lang.Object node)
Determine if the given node can validly be placed on this graph. |
boolean |
canConnect(java.lang.Object fromP,
java.lang.Object toP)
Determine if the two given ports can be connected by a kind of edge to be determined by the ports. |
java.lang.Object |
getDestPort(java.lang.Object edge)
Return the destination end of an edge. |
java.util.Vector |
getInEdges(java.lang.Object port)
Return all edges going to given port. |
java.lang.Object |
getNamespace()
Accessor to get the namespace. |
java.util.Vector |
getOutEdges(java.lang.Object port)
Return all edges going from the given port. |
java.lang.Object |
getOwner(java.lang.Object port)
|
java.util.Vector |
getPorts(java.lang.Object nodeOrEdge)
Return all ports on a node or edge supplied as argument. |
java.lang.Object |
getSourcePort(java.lang.Object edge)
Return the source end of an edge. |
void |
setNamespace(java.lang.Object namespace)
Accessor to set the namespace. |
void |
vetoableChange(java.beans.PropertyChangeEvent pce)
Called when a property of interest has been changed - in this case the owned elements of the model. |
Methods inherited from class org.argouml.uml.diagram.UMLMutableGraphSupport |
connect, connect, constainsEdge, containsNode, getEdges, getNodes, removeEdge, removeNode |
Methods inherited from class org.tigris.gef.graph.MutableGraphSupport |
addGraphEventListener, canChangeConnectedNode, canConnect, canDragNode, changeConnectedNode, containsEdge, containsEdgePort, containsNodePort, containsPort, createNode, 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 |
protected static org.apache.log4j.Logger cat
protected java.lang.Object _model
static final long serialVersionUID
Constructor Detail |
public UseCaseDiagramGraphModel()
Method Detail |
public java.lang.Object getNamespace()
public void setNamespace(java.lang.Object namespace)
Clears the current listener if we have a namespace at present. Sets a new listener if we set a new namespace (i.e. m is non-null).
namespace
- The namespace to use for this graph modelpublic java.util.Vector getPorts(java.lang.Object nodeOrEdge)
The only objects on our diagram that have any ports are use cases and actors, and they each have one - themself.
getPorts
in interface org.tigris.gef.graph.GraphModel
nodeOrEdge
- A model element, for whom the list of ports is
wanted.
public java.lang.Object getOwner(java.lang.Object port)
getOwner
in interface org.tigris.gef.graph.BaseGraphModel
public java.util.Vector getInEdges(java.lang.Object port)
The only objects with ports on the use case diagram are actors and use cases. In each case we find the attached association ends, and build a list of them as the incoming ports.
getInEdges
in interface org.tigris.gef.graph.GraphModel
port
- The port for which we want to know the incoming edges.
public java.util.Vector getOutEdges(java.lang.Object port)
Needs more work. This would seem superficially to be
identical to getInEdges(java.lang.Object)
, but in our implementation we
return an empty vector.
getOutEdges
in interface org.tigris.gef.graph.GraphModel
port
- The port for which we want to know the outgoing edges.
public java.lang.Object getSourcePort(java.lang.Object edge)
Needs more work. In the current implementation we only know how to handle associations, returning the first of its connections—which, if set, will be a use case or an actor.
getSourcePort
in interface org.tigris.gef.graph.BaseGraphModel
edge
- The edge for which we want the source port.
null
if the
edge given is not an association or has no source defined.public java.lang.Object getDestPort(java.lang.Object edge)
Needs more work. In the current implementation we only know how to handle associations, returning the second of its connections—which, if set, will be a use case or an actor.
getDestPort
in interface org.tigris.gef.graph.BaseGraphModel
edge
- The edge for which we want the destination port.
null
if
the edge given is not an association or has no destination
defined.public boolean canAddNode(java.lang.Object node)
This is simply a matter of determining if the node is an actor or use case.
Note. This is inconsistent with addNode(java.lang.Object)
,
which will not allow a node to be added to the graph if it is
already there.
canAddNode
in interface org.tigris.gef.graph.MutableGraphModel
node
- The node to be considered
true
if the given object is a valid node in
this graph, false
otherwise.public boolean canAddEdge(java.lang.Object edge)
We cannot do so if the edge is already on the graph (unlike nodes they may not appear more than once).
Otherwise, for all valid types of edge (binary association, generalization, extend, include, dependency) we get the two ends. If they are both nodes already on the graph we are OK, otherwise we cannot place the edge on the graph.
canAddEdge
in interface org.tigris.gef.graph.MutableGraphModel
edge
- The edge to be considered
true
if the given object is a valid edge in
this graph, false
otherwise.public void addNode(java.lang.Object node)
We add the node if it is not already on the graph, and (assuming it to be an actor or use case) add it to the owned elements for the model.
Needs more work. In adding the node to the owned elements of the model namespace, we are implicitly making it public visibility (it could be private to this namespace).
Note. This method is inconsistent with
canAddNode(java.lang.Object)
, which will allow a node to be added to the
graph if it is already there.
addNode
in interface org.tigris.gef.graph.MutableGraphModel
node
- The node to be added to the graph.public void addEdge(java.lang.Object edge)
We add the edge if it is not already on the graph, and (assuming it to be an association, generalization, extend, include or dependency) add it to the owned elements for the model.
Needs more work. In adding the edge to the owned elements of the model namespace, we are implicitly making it public visibility (it could be private to this namespace).
addEdge
in interface org.tigris.gef.graph.MutableGraphModel
edge
- The edge to be added to the graph.public void addNodeRelatedEdges(java.lang.Object node)
For use cases we may find extend and include relationships. For classifiers (effectively actors and use cases) we may find associations. For generalizable elements (effectively actors and use cases again) we may find generalizations and specializations. For ModelElements (effectively actors and use cases again) we may find dependencies.
addNodeRelatedEdges
in interface org.tigris.gef.graph.MutableGraphModel
node
- The node whose edges are to be added.public boolean canConnect(java.lang.Object fromP, java.lang.Object toP)
Note. There appears to be a problem with the implementation, since it suggests actors cannot connect. In fact generalization is permitted, and this works, suggesting this method is not actually invoked in the current implementation of ArgoUML.
canConnect
in interface org.tigris.gef.graph.MutableGraphModel
canConnect
in class UMLMutableGraphSupport
fromP
- The source port of the connectiontoP
- The destination port of the connection.
true
if the two given ports can be connected
by a kind of edge to be determined by the
ports. false
otherwise.public void vetoableChange(java.beans.PropertyChangeEvent pce)
VetoableChangeListener
interface.We could throw a PropertyVetoException if we wished to allow the change to be rolled back, but we don't.
vetoableChange
in interface java.beans.VetoableChangeListener
pce
- The event that triggered us, and from which we can extract
the name of the property that triggered us.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20040316) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |