|
|||||||||||
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
UMLMutableGraphSupport is a helper class which extends MutableGraphSupport to provide additional helper and common methods for UML Diagrams.
Field Summary | |
private Vector |
edges
Constains all the edges in the graphmodel/diagram. |
private static Logger |
LOG
Logger. |
private Vector |
nodes
Contains all the nodes in the graphmodel/diagram. |
Fields inherited from class org.tigris.gef.graph.MutableGraphSupport |
|
Constructor Summary | |
UMLMutableGraphSupport()
Constructor. |
Method Summary | |
void |
addNodeRelatedEdges(Object node)
|
CommentEdge |
buildCommentConnection(Object from,
Object to)
Builds the model behind a connection between a comment and the annotated modelelement. |
protected Object |
buildConnection(Object edgeType,
Object fromElement,
Object fromStyle,
Object toElement,
Object toStyle,
Object unidirectional,
Object namespace)
Create an edge of the given type and connect it to the given nodes. |
boolean |
canAddEdge(Object edge)
|
boolean |
canAddNode(Object node)
|
boolean |
canConnect(Object fromP,
Object toP)
Assume that anything can be connected to anything unless overridden in a subclass. |
Object |
connect(Object fromPort,
Object toPort)
The connect method without specifying a connection type is unavailable by default. |
Object |
connect(Object fromPort,
Object toPort,
Class edgeClass)
Construct and add a new edge of the given kind and connect the given ports. |
boolean |
constainsEdge(Object edge)
|
boolean |
containsNode(Object node)
|
Object |
getDestPort(Object edge)
Return the destination end of an edge. |
List |
getEdges()
Get all the edges from the graphmodel/diagram. |
abstract Object |
getNamespace()
|
List |
getNodes()
Get all the nodes from the graphmodel/diagram. |
Object |
getSourcePort(Object edge)
Return the source end of an edge. |
protected boolean |
isConnectionValid(Object edgeType,
Object fromElement,
Object toElement)
Checks if some type of edge is valid to connect two types of node. |
void |
removeEdge(Object edge)
Remove an edge from the graphmodel and notify GEF. |
void |
removeNode(Object node)
Remove a node from the diagram and notify GEF. |
Methods inherited from class org.tigris.gef.graph.MutableGraphSupport |
addEdge, addGraphEventListener, addNode, canChangeConnectedNode, canConnect, canDragNode, changeConnectedNode, containsEdge, containsEdgePort, containsNodePort, containsPort, createNode, dragNode, fireEdgeAdded, fireEdgeRemoved, fireGraphChanged, fireNodeAdded, fireNodeRemoved, getConnectionConstrainer, getGraphListeners, removeAll, removeAllEdges, removeAllNodes, removeFig, removeGraphEventListener, setConnectionConstrainer, setSaveAction |
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.GraphModel |
getInEdges, getOutEdges, getPorts |
Methods inherited from interface org.tigris.gef.graph.BaseGraphModel |
getOwner |
Field Detail |
private static final Logger LOG
private Vector nodes
private Vector edges
Constructor Detail |
public UMLMutableGraphSupport()
MutableGraphSupport
Method Detail |
public List getNodes()
GraphModel.getNodes()
public List getEdges()
public boolean containsNode(Object node)
MutableGraphModel.containsNode(java.lang.Object)
public boolean constainsEdge(Object edge)
edge
- the candidate edge
public void removeNode(Object node)
node
- node to removepublic void removeEdge(Object edge)
edge
- edge to removepublic boolean canConnect(Object fromP, Object toP)
MutableGraphModel.canConnect(
java.lang.Object, java.lang.Object)
public Object connect(Object fromPort, Object toPort)
MutableGraphModel.connect(
java.lang.Object, java.lang.Object)
public abstract Object getNamespace()
public Object connect(Object fromPort, Object toPort, Class edgeClass)
fromPort
- The originating port to connecttoPort
- The destination port to connectedgeClass
- The NSUML type of edge to create.
edgeClass
if we succeeded,
null
otherwise)public boolean canAddNode(Object node)
MutableGraphModel.canAddNode(java.lang.Object)
public Object getSourcePort(Object edge)
edge
- The edge for which we want the source port.
null
if the
edge given is of the wrong type or has no source defined.public Object getDestPort(Object edge)
edge
- The edge for which we want the destination port.
null
if
the edge given is otf the wrong type or has no destination
defined.public boolean canAddEdge(Object edge)
MutableGraphModel.canAddEdge(java.lang.Object)
public void addNodeRelatedEdges(Object node)
MutableGraphModel.addNodeRelatedEdges(java.lang.Object)
protected Object buildConnection(Object edgeType, Object fromElement, Object fromStyle, Object toElement, Object toStyle, Object unidirectional, Object namespace)
edgeType
- the UML object type of the connectionfromElement
- the UML object for the "from" elementfromStyle
- the aggregationkind for the connection
in case of an associationtoElement
- the UML object for the "to" elementtoStyle
- the aggregationkind for the connection
in case of an associationunidirectional
- for association and associationrolenamespace
- the namespace to use if it can't be determined
public CommentEdge buildCommentConnection(Object from, Object to)
from
- The comment or annotated element.to
- The comment or annotated element.
protected boolean isConnectionValid(Object edgeType, Object fromElement, Object toElement)
edgeType
- the UML object type of the connectionfromElement
- the UML object type of the "from"toElement
- the UML object type of the "to"
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ArgoUML © 1996-2004 (20050222) | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |