Bug 57878

Summary: Association line nodes don't drag along with multiply-selected classes
Product: [Applications] umbrello Reporter: Stevan White <stevan_white>
Component: generalAssignee: Umbrello Development Group <umbrello-devel>
Status: RESOLVED FIXED    
Severity: normal CC: jr
Priority: LO    
Version: 1.1.1   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Stevan White 2003-04-30 09:10:48 UTC
Version:           1.1.1 (using KDE KDE 3.1.1)
OS:          Linux

Make 2 classes

Put an association between them

Add a node in the association line, bend the line.

Select the two classes.

Drag the classes.

The classes will move, the node will remain stationary.

If the classes on both ends of the association move, all the nodes in the line should move together.
Comment 1 Jonathan Riddell 2003-04-30 20:24:50 UTC
*** Bug 57475 has been marked as a duplicate of this bug. ***
Comment 2 Sebastian Stein 2003-10-04 23:09:03 UTC

*** This bug has been marked as a duplicate of 57884 ***
Comment 3 Sebastian Stein 2003-10-04 23:10:26 UTC
sorry, clicked the wrong button, so the bug is still valid 
Comment 4 Oliver Kellogg 2003-11-23 22:00:48 UTC
*** Bug has been marked as fixed ***.
Comment 5 YeHaa 2004-02-26 15:38:45 UTC
Why has this bug been marked as "fixed"? I'm just wondering, since I still see this behaviour in version 1.2 (KDE 3.2).
Comment 6 Jonathan Riddell 2004-03-12 10:18:28 UTC
It works for me.

Jan: if you could give a step by step list of how to recreate this problem that would be useful.
Comment 7 Stevan White 2004-06-13 13:30:54 UTC
I'll leave this.  I think the current behavior is correct (v. 1.2.1)

The issue was with the method of selection.

If the two classes and the nodes on their association lines are selected 
together by dragging a selection rectangle across all of them, then they 
move together.

If the two classes are selected by shift-clicking on the class icons,
then the node does not move along with the icons.
Comment 8 Nicolas Dumoulin 2006-11-28 11:52:43 UTC
Hi

I doesn't understand the solution. I can't achieve this.

I have umbrello 1.5.5 on kubuntu edgy.

I create a new class diagramm, I put two classes A and B, and then I put an association between them. If I add a node on the line of their association, and then select the two classes with the node by dragging a selection rectangle, I can only move the class but the node stay at the same place.

In fact, as I begin the move by dragging one of the two classes, the node and the selection are unselected.

What's wrong ?

It's a very annoying behavior :-(

Does anyone has the answer ?

Thanks

Nicolas Dumoulin
Comment 9 Oliver Kellogg 2006-12-04 21:03:31 UTC
> [...] This is a regression which was introduced in 1.5.4.

Oops, make that 1.5.3 (see http://bugs.kde.org/126391)
Comment 10 Oliver Kellogg 2006-12-04 21:45:14 UTC
SVN commit 610642 by okellogg:

mouseMoveEvent(): UMLWidget::adjustAssocs() does not take along association
 line breaks - let's rather use AssociationWidget::moveEntireAssoc() on the
 selected associations. This is a regression which was introduced in 1.5.4.
The behavior is still not perfect - the line break points change relative
 positions during movement. If anybody has a clue what's causing this,
 that would be great.
CCBUG:57878


 M  +12 -0     umlwidgetcontroller.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #610641:610642
@@ -93,6 +93,7 @@
         if (m_widget->m_bSelected && count > 1) {
             //Single selection is made in release event if the widget wasn't moved
             m_inMoveArea = true;
+            lastUpdate.start();
             return;
         }
 
@@ -165,7 +166,18 @@
         widget->getWidgetController()->moveWidgetBy(diffX, diffY);
 
         if (update) {
+            /* adjustAssocs() does not take along association line breaks:
             widget->adjustAssocs(widget->getX(), widget->getY());
+             ***** instead: */
+            // Move any selected associations.
+            AssociationWidgetList awl = m_widget->m_pView->getSelectedAssocs();
+            AssociationWidgetListIt assoc_it(awl);
+            AssociationWidget* assocwidget = NULL;
+            while ((assocwidget = assoc_it.current()) != NULL) {
+                    ++assoc_it;
+                    if (assocwidget->getSelected())
+                            assocwidget->moveEntireAssoc(diffX, diffY);
+            }
         }
     }
     m_widget->m_pView->resizeCanvasToItems();
Comment 11 Oliver Kellogg 2006-12-04 21:45:26 UTC
SVN commit 610642 by okellogg:

mouseMoveEvent(): UMLWidget::adjustAssocs() does not take along association
 line breaks - let's rather use AssociationWidget::moveEntireAssoc() on the
 selected associations. This is a regression which was introduced in 1.5.4.
The behavior is still not perfect - the line break points change relative
 positions during movement. If anybody has a clue what's causing this,
 that would be great.
CCBUG:57878


 M  +12 -0     umlwidgetcontroller.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #610641:610642
@@ -93,6 +93,7 @@
         if (m_widget->m_bSelected && count > 1) {
             //Single selection is made in release event if the widget wasn't moved
             m_inMoveArea = true;
+            lastUpdate.start();
             return;
         }
 
@@ -165,7 +166,18 @@
         widget->getWidgetController()->moveWidgetBy(diffX, diffY);
 
         if (update) {
+            /* adjustAssocs() does not take along association line breaks:
             widget->adjustAssocs(widget->getX(), widget->getY());
+             ***** instead: */
+            // Move any selected associations.
+            AssociationWidgetList awl = m_widget->m_pView->getSelectedAssocs();
+            AssociationWidgetListIt assoc_it(awl);
+            AssociationWidget* assocwidget = NULL;
+            while ((assocwidget = assoc_it.current()) != NULL) {
+                    ++assoc_it;
+                    if (assocwidget->getSelected())
+                            assocwidget->moveEntireAssoc(diffX, diffY);
+            }
         }
     }
     m_widget->m_pView->resizeCanvasToItems();
Comment 12 Oliver Kellogg 2006-12-19 06:39:37 UTC
SVN commit 614836 by okellogg:

mouseMoveEvent(): Fix placement of call to AssociationWidget::moveEntireAssoc().
CCBUG:57878


 M  +1 -0      ChangeLog  
 M  +9 -14     umbrello/umlwidgetcontroller.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #614835:614836
@@ -12,6 +12,7 @@
 * Optimized printer margins
   http://www.geeksoc.org/~jr/umbrello/uml-devel/9895.html
 * Bugs/wishes from http://bugs.kde.org:
+* Association line nodes don't drag along with multiply-selected classes (57878)
 * Umbrello saves too much copies at xmi (135606)
 * Artifacts of a component diagram are wrongly placed in Deployment View folder (137564)
 * Incorrect export to SQL (138139)
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #614835:614836
@@ -26,6 +26,7 @@
 #include "uml.h"
 #include "umldoc.h"
 #include "umlview.h"
+#include "umlobject.h"
 #include "listpopupmenu.h"
 #include "classifierwidget.h"
 #include "associationwidget.h"
@@ -162,24 +163,18 @@
 
     while ((widget = it.current()) != 0) {
         ++it;
-
         widget->getWidgetController()->moveWidgetBy(diffX, diffY);
+    }
 
-        if (update && m_widget->m_bStartMove) {
-            /* adjustAssocs() does not take along association line breaks:
-            widget->adjustAssocs(widget->getX(), widget->getY());
-             ***** instead: */
-            // Move any selected associations.
-            AssociationWidgetList awl = m_widget->m_pView->getSelectedAssocs();
-            AssociationWidgetListIt assoc_it(awl);
-            AssociationWidget* assocwidget = NULL;
-            while ((assocwidget = assoc_it.current()) != NULL) {
-                    ++assoc_it;
-                    if (assocwidget->getSelected())
-                            assocwidget->moveEntireAssoc(diffX, diffY);
-            }
+    // Move any selected associations.
+    AssociationWidgetList awl = m_widget->m_pView->getSelectedAssocs();
+    AssociationWidget *aw = NULL;
+    for (AssociationWidgetListIt ai(awl); (aw = ai.current()) != NULL; ++ai) {
+        if (aw->getSelected()) {
+            aw->moveEntireAssoc(diffX, diffY);
         }
     }
+
     m_widget->m_pView->resizeCanvasToItems();
     updateSelectionBounds(diffX, diffY);
 }
Comment 13 bcr 2007-02-01 19:18:55 UTC
I don't see how this is considered fixed as I just installed Umbrello from the latest 6.1 Edgy eft and the bug as described above is still there.
Comment 14 Oliver Kellogg 2007-02-02 19:02:25 UTC
> [...] the bug as described above is still there. 

Go to line 176 in
kdesdk-3.5.6/umbrello/umbrello/umlwidgetcontroller.cpp :

    for (AssociationWidgetListIt ai(awl); (aw = ai.current()) != NULL; ++ai) {
        if (aw->getSelected()) {
            aw->moveEntireAssoc(diffX, diffY);  // line 176
        }
    }

If the code does not look like that then you have the wrong umbrello version.
If the code does look like that then please reopen the bug and provide an
exact step-by-step instruction for recreating the problem.
Comment 15 Nicolas Dumoulin 2007-04-18 17:45:05 UTC
Hi there,

The bug seems to have disappeared :-)

I'm on Kubuntu feisty with umbrello 1.5.6 and the initial use case works ! The node moves with the classes.

Thanks (a lot) !