Bug 57672 - Activity diagram fork/join lines--can't change length
Summary: Activity diagram fork/join lines--can't change length
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: 1.1.1
Platform: Mandrake RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-04-25 04:19 UTC by Stevan White
Modified: 2005-09-10 15:06 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stevan White 2003-04-25 04:19:31 UTC
Version:           1.1.1 (using KDE KDE 3.1)
Installed from:    Mandrake RPMs
OS:          Linux

I have been unable to change the length of fork/join lines in activity diagrams.  I can't do it by dragging the end points; putting multiple flows between fork/join lines doesn't change their length automatically.  I can just lay one fork/join line next to the other, but this seems really clumsy.
Comment 1 Oliver Kellogg 2005-09-10 15:06:17 UTC
SVN commit 459238 by okellogg:

BUG:57672 - Inheriting from BoxWidget gives us resizability.


 M  +3 -3      ChangeLog  
 M  +21 -6     umbrello/forkjoinwidget.cpp  
 M  +10 -3     umbrello/forkjoinwidget.h  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #459237:459238
@@ -9,9 +9,9 @@
 * Automatic Diagram Layout (67059, not yet closed)
 
 * Bugs fixed / wishes implemented (see http://bugs.kde.org)
- 57588  58809  66461  67719  72016  79433  87252  88117  97162 105564
-108223 109591 109636 110216 110231 110379 111088 111470 111502 111759
-111768 112017 112293
+ 57588  57672  58809  66461  67719  72016  79433  87252  88117  97162
+105564 108223 109591 109636 110216 110231 110379 111088 111470 111502
+111759 111768 112017 112293
 
 Version 1.4.2 (maintenance release)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/forkjoinwidget.cpp #459237:459238
@@ -24,7 +24,7 @@
 #include "listpopupmenu.h"
 
 ForkJoinWidget::ForkJoinWidget(UMLView * view, bool drawVertical, Uml::IDType id)
-  : UMLWidget(view, id), m_drawVertical(drawVertical) {
+  : BoxWidget(view, id), m_drawVertical(drawVertical) {
     init();
 }
 
@@ -38,10 +38,9 @@
 }
 
 void ForkJoinWidget::calculateSize() {
-    if (m_drawVertical)
-        setSize(4, 40);
-    else
-        setSize(40, 4);
+    int w = width(), h = height();
+    constrain(w, h);
+    setSize(w, h);
 }
 
 void ForkJoinWidget::draw(QPainter& p, int offsetX, int offsetY) {
@@ -52,9 +51,25 @@
     }
 }
 
-void ForkJoinWidget::drawSelected(QPainter *, int, int, bool) {
+void ForkJoinWidget::drawSelected(QPainter * p, int offsetX, int offsetY, bool resizeable) {
+    if (! resizeable) {
+        UMLWidget::drawSelected(p, offsetX, offsetY, resizeable);
+        return;
+    }
 }
 
+void ForkJoinWidget::constrain(int& width, int& height) {
+    if (m_drawVertical) {
+        width = 4;
+        if (height < 40)
+            height = 40;
+    } else {
+        height = 4;
+        if (width < 40)
+            width = 40;
+    }
+}
+
 void ForkJoinWidget::slotMenuSelection(int sel) {
     switch (sel) {
     case ListPopupMenu::mt_Flip:
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/forkjoinwidget.h #459237:459238
@@ -14,7 +14,7 @@
 //qt includes
 #include <qpainter.h>
 //app includes
-#include "umlwidget.h"
+#include "boxwidget.h"
 
 // fwd decl.
 class UMLView;
@@ -25,7 +25,7 @@
  * @see UMLWidget
  * Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
  */
-class ForkJoinWidget : public UMLWidget {
+class ForkJoinWidget : public BoxWidget {
 public:
 
     /**
@@ -64,6 +64,11 @@
     void slotMenuSelection(int sel);
 
     /**
+     * Reimplement method from BoxWidget.
+     */
+    void constrain(int& width, int& height);
+
+    /**
      * Draws a slim solid black rectangle.
      */
     void draw(QPainter & p, int offsetX, int offsetY);
@@ -80,7 +85,9 @@
 
 protected:
     /**
-     * Reimplements method from UMLWidget. Disables selection adornments and resize.
+     * Reimplement method from UMLWidget to suppress the resize corner.
+     * Although the ForkJoinWidget supports resizing, we suppress the
+     * resize corner because it is too large for this very slim widget.
      */
     void drawSelected(QPainter * p, int offsetX, int offsetY, bool resizeable = false);