svn commit: r17160 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionRerouteEdge.java

Bob Tarling <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2009-06-28 08:15:48-0700
New Revision: 17160

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

Log:
Issue 5818. Only call reattach code of the vertex being dragged is the first or last in an edge

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionRerouteEdge.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionRerouteEdge.java?view=diff&pathrev=17160&r1=17159&r2=17160
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionRerouteEdge.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionRerouteEdge.java	2009-06-28 08:15:48-0700
@@ -112,19 +112,18 @@
         destFig = 
             (FigNodeModelElement) ((FigEdge) getContent()).getDestFigNode();
 
-        Rectangle mousePosition =
+        final Rectangle mousePosition =
 	    new Rectangle(me.getX() - 5, me.getY() - 5, 10, 10);
         //reset the pointIndex
         pointIndex = -1;
-        int npoints = getContent().getNumPoints();
-        int[] xs = getContent().getXs();
-        int[] ys = getContent().getYs();
-        for (int i = 0; i < npoints; ++i) {
-            if (mousePosition.contains(xs[i], ys[i])) {
-                pointIndex = i;
-                super.mousePressed(me);
-                return;
-            }
+        final int npoints = getContent().getNumPoints();
+        final int[] xs = getContent().getXs();
+        final int[] ys = getContent().getYs();
+        if (mousePosition.contains(xs[0], ys[0])) {
+            pointIndex = 0;
+        } else if (mousePosition.contains(
+                xs[npoints - 1], ys[npoints - 1])) {
+            pointIndex = npoints - 1;
         }
 
         super.mousePressed(me);

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

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.