|
|||||||||||
| 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 DiDiagram |
diDiagram
|
private Vector |
edges
Constains all the edges in the graphmodel/diagram. |
private Object |
homeModel
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". |
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 in the ArgoUML implmentation. |
Object |
connect(Object fromPort,
Object toPort,
Class edgeClass)
The connect method specifying a connection type by class is unavailable in the ArgoUML implementation. |
Object |
connect(Object fromPort,
Object toPort,
Object edgeType)
Construct and add a new edge of the given kind and connect the given ports. |
Object |
connect(Object fromPort,
Object toPort,
Object edgeType,
Map styleAttributes)
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. |
DiDiagram |
getDiDiagram()
Get the object that represents this diagram in the DiagramInterchangeModel. |
List |
getEdges()
Get all the edges from the graphmodel/diagram. |
Object |
getHomeModel()
Get the homemodel. |
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. |
boolean |
isRemoveFromDiagramAllowed(Collection figs)
Return true if the current targets may be removed from the diagram. |
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. |
(package private) void |
setDiDiagram(DiDiagram dd)
Package scope. |
void |
setHomeModel(Object ns)
Set the homemodel. |
| 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 DiDiagram diDiagram
private Vector nodes
private Vector edges
private Object homeModel
| 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 remove
public 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 Object getHomeModel()
public void setHomeModel(Object ns)
ns - the namespace
public Object connect(Object fromPort,
Object toPort,
Class edgeClass)
MutableGraphModel.connect(java.lang.Object,
java.lang.Object, java.lang.Class)
public Object connect(Object fromPort,
Object toPort,
Object edgeType)
fromPort - The originating port to connecttoPort - The destination port to connectedgeType - The type of edge to create. This is one of the types
returned by the methods of
org.argouml.model.MetaTypes
edgeClass if we succeeded,
null otherwise)
public Object connect(Object fromPort,
Object toPort,
Object edgeType,
Map styleAttributes)
fromPort - The originating port to connecttoPort - The destination port to connectedgeType - An indicator of the edge type to create.styleAttributes - key/value pairs from which to style the edge.
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"
void setDiDiagram(DiDiagram dd)
dd - public DiDiagram getDiDiagram()
public boolean isRemoveFromDiagramAllowed(Collection figs)
figs - a collection with the selected figs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
| ArgoUML © 1996-2005 | ArgoUML Homepage | ArgoUML Developers' page | ArgoUML Cookbook |