svn commit: r17336 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-09-21 10:08:28-0700
New Revision: 17336

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

Log:
Make sure drawing an association-end edge snaps to nodes border

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java?view=diff&pathrev=17336&r1=17335&r2=17336
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/ModeCreateAssociationEnd.java	2009-09-21 10:08:28-0700
@@ -104,7 +104,7 @@
             graphModel.addEdge(associationEnd);
             
             setNewEdge(associationEnd);
-
+            
             // Calling connect() will add the edge to the GraphModel and
             // any LayerPersectives on that GraphModel will get a
             // edgeAdded event and will add an appropriate FigEdge
@@ -121,6 +121,9 @@
                 fe.setSourceFigNode(sourceFigNode);
                 fe.setDestPortFig(destFigNode);
                 fe.setDestFigNode(destFigNode);
+                
+                fe.computeRoute();
+
                 return fe;
             } else {
                 return null;
@@ -236,4 +239,14 @@
         return figNode;
     }
     
+    /*
+     * If we're drawing to an edge then only allow if the start is a comment
+     * @see org.argouml.uml.diagram.ui.ModeCreateGraphEdge#isConnectionValid(org.tigris.gef.presentation.Fig, org.tigris.gef.presentation.Fig)
+     */
+    @Override
+    protected final boolean isConnectionValid(Fig source, Fig dest) {
+        return super.isConnectionValid(source, dest);
+    }
+    
+    
 } /* end class ModeCreateAssociation */

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

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.