svn commit: r19043 - trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2011-02-20 06:46:50-0800
New Revision: 19043

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java

Log:
Issue 6183: Allow a CommentEdge to be added to a class diagram

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java?view=diff&pathrev=19043&r1=19042&r2=19043
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/UMLClassDiagram.java	2011-02-20 06:46:50-0800
@@ -638,7 +638,9 @@
     
     @Override
     public boolean doesAccept(Object objectToAccept) {
-        if (Model.getFacade().isAClass(objectToAccept)) {
+        if (objectToAccept instanceof CommentEdge) {
+            return true;
+        } else if (Model.getFacade().isAClass(objectToAccept)) {
             return true;
         } else if (Model.getFacade().isAInterface(objectToAccept)) {
             return true;
@@ -815,7 +817,17 @@
             figEdge.setDestFigNode(supFN);
             figEdge.getFig().setLayer(getLayer());
         } else if (modelElement instanceof CommentEdge) {
+            CommentEdge ce = (CommentEdge) modelElement;
+            Object source = ce.getSource();
+            Object dest = ce.getDestination();
+            FigNode sourceFN = (FigNode) getLayer().presentationFor(source);
+            FigNode destFN = (FigNode) getLayer().presentationFor(dest);
             figEdge = new FigEdgeNote(modelElement, settings);
+            figEdge.setSourcePortFig(sourceFN);
+            figEdge.setSourceFigNode(sourceFN);
+            figEdge.setDestPortFig(destFN);
+            figEdge.setDestFigNode(destFN);
+            figEdge.getFig().setLayer(getLayer());
         }
         
         if (figEdge != null) {

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2705825

To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.