| Bug 67223: Fixed connection points for associations on widgets | (wishlist) |
| Opened: | 2003-11-04 20:11 |
| Product: | umbrello |
| Component: | general |
| Version: | 1.1.1 |
| Status: | RESOLVED |
| Platform: | Unlisted Binaries |
| Resolution: | FIXED |
| Reporter: | Eugine V. Kosenko |
| Assigned to: | Umbrello Development Group |
Version: 1.1.1 (using KDE KDE 3.1.2)
Installed from: Unspecified Linux
OS: Linux
Now umbrello uses an intelligent behavior of associations during a rearrangement of widgets. However, this behavior may be sometimes strange, annoyed or even ugly. For example, let I try to compact diagram and make associations as short as possible. However, when an association becomes too short, the tool may unexpectedy rearrange its connection point, for example, reconnect from a bottom point of decision square (on activity diagrams) to a side point.
I think, may not be any more annoyment than a system, which makes decisions behind my back. IMHO, there is much more useful to make a set of connection points on a widgets, where I can connect an association. In more difficult way, there may be a mechanism of the definition of connection points, as, for example, this made in Visio. It is also possible to keep the intelligent behavior, when the user obviously starts the drag of an association from the middle of a widget instead of a selected connection point. This behavior is also well implemented in Visio.
------- Additional Comment #1 From Jonathan Riddell 2003-11-04 20:20 -------
***
------- Additional Comment #2 From Sebastian Stein 2003-12-02 10:09 -------
I think this really is a wish and not just a bug.
------- Additional Comment #3 From Oliver Kellogg 2003-12-26 19:58 -------
I confirm. In particular, when the lines of a self association
were manually rearranged (for example, moved to the left or right
or bottom side to avoid a clash with a generalization arrow) and
then one of the role labels is moved, the lines jerk around to
unpredictable positions.
------- Additional Comment #4 From Oliver Kellogg 2004-07-02 18:36 -------
***
------- Additional Comment #5 From Mathieu Jobin 2004-08-27 22:42 -------
I was about to submit a new wish report but....
I suggest making connection point, just like in kivio, so arrow match with correct connection point, and they can manually be changed.
instead of this buggy auto thing.
------- Additional Comment #6 From Jonathan Riddell 2004-08-28 21:49 -------
Fixed assocaition points are a bad idea because you will run out of association points. Having an algorithm that will use horizontal or vertical lines in all cases makes more sense.
------- Additional Comment #7 From Mathieu Jobin 2004-08-29 01:15 -------
maybe you right, the algo makes more sense, but you won't run out of association points, since you can have multiple association on a single point.
just like in kivio
------- Additional Comment #8 From Brad Markel 2005-04-24 17:32 -------
Perhaps include the ability to drag the connection points around the entity, at least in the class diagram. The two "control boxes" at the end of the associations suggest that this can be done already, which is confusing.
------- Additional Comment #9 From ahiroito at yahoo.com 2005-10-21 18:01 -------
my vote is for the algo too. it could have multiple association on a single point, but that looks horrendous (one of the things i dislike about visio and kivio are the fixed connection points). and we shall not be wasting time rearranging connection points.
------- Additional Comment #10 From Oliver Kellogg 2006-02-24 08:24 -------
SVN commit 513000 by okellogg:
http://www.geeksoc.org/~jr/umbrello/uml-devel/att-9250/straightlines.tar.bz2
applied from http://www.geeksoc.org/~jr/umbrello/uml-devel/9248.html
Many thanks to Marius Helf <marius.helf_at_gmx.de> for this feature.
BUG:67223
M +1 -0 ChangeLog
M +1 -0 THANKS
M +58 -11 umbrello/associationwidget.cpp
--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #512999:513000
at at -5,6 +5,7 at at
* fixed problem with font size computation/word wrap in note widgets
http://sourceforge.net/mailarchive/forum.php?thread_id=9558795&forum_id=472
* Bugs/wishes from http://bugs.kde.org:
+* Fixed connection points for associations on widgets (67223)
* Import Rose model files (81364)
* Documentation for association roles not saved (105661)
* Default data types not added for old Java generator (115991)
--- branches/KDE/3.5/kdesdk/umbrello/THANKS #512999:513000
at at -32,6 +32,7 at at
Gregorio Guidi <g.guidi at sns.it>
Esben Mose Hansen <esben at despammed.com>
Olaf Hartig <OleBowle at gmx.de>
+Marius Helf <marius.helf at gmx.de>
Michel Hermier <michel.hermier at wanadoo.fr>
Paul Hensgen <phensgen at bigpond.net.au>
David Hugh-Jones <hughjonesd at yahoo.co.uk>
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/associationwidget.cpp #512999:513000
at at -2204,6 +2204,20 at at
setSelected( false );
return;
}
+
+ // Check whether a point was moved and whether the moved point is
+ // located on the straight line between its neighbours.
+ // if yes, remove it
+ /// at todo: check for non-horizontal / -vertical lines
+ if (m_nMovingPoint > 0 && m_nMovingPoint < m_LinePath.count() - 1)
+ {
+ QPoint m = m_LinePath.getPoint(m_nMovingPoint);
+ QPoint b = m_LinePath.getPoint(m_nMovingPoint - 1);
+ QPoint a = m_LinePath.getPoint(m_nMovingPoint + 1);
+ if ( (b.x() == m.x() && a.x() == m.x()) ||
+ (b.y() == m.y() && a.y() == m.y()) )
+ m_LinePath.removePoint(m_nMovingPoint, m, POINT_DELTA);
+ }
m_nMovingPoint = -1;
const QPoint p = me->pos();
if (me->button() == Qt::LeftButton) {
at at -2502,11 +2516,24 at at
}
void AssociationWidget::mouseMoveEvent(QMouseEvent* me) {
- //make sure we have a moving point
- //I don't think there is another reason for being here
- if( m_nMovingPoint == -1 || me->state() != Qt::LeftButton) {
+ if( me->state() != Qt::LeftButton) {
return;
}
+
+ // if we have no moving point,create one
+ if (m_nMovingPoint == -1)
+ {
+ //create moving point near the mouse on the line
+ int i = m_LinePath.onLinePath(me->pos());
+
+ if (i > -1)
+ {
+ m_LinePath.insertPoint( i + 1, me->pos() );
+ m_nMovingPoint = i + 1;
+ } else
+ return;
+ }
+
setSelected();
//new position for point
QPoint p = me->pos();
at at -2845,6 +2872,7 at at
void AssociationWidget::updateRegionLineCount(int index, int totalCount,
AssociationWidget::Region region,
Role_Type role) {
+ /// at todo remove parameter totalCount (no longer needed)
if( region == Error )
return;
// If the association is to self and the line ends are on the same region then
at at -2900,16 +2928,35 at at
robj.m_OldCorner.setY(y);
int ww = pWidget->getWidth();
int wh = pWidget->getHeight();
- int ch = wh * index / totalCount;
- int cw = ww * index / totalCount;
+// int ch = wh * index / totalCount;
+// int cw = ww * index / totalCount;
+ uint nind = role == A ? 1: m_LinePath.count() - 2;
+ QPoint neighbour = m_LinePath.getPoint(nind);
+ int ch = 0;
+ int cw = 0;
+ if (neighbour.x() < x)
+ cw = 0;
+ else if (neighbour.x() > x + ww)
+ cw = 0 + ww;
+ else
+ cw = neighbour.x() - x;
+
+ if (neighbour.y() < y)
+ ch = 0;
+ else if (neighbour.y() > y + wh)
+ ch = 0 + wh;
+ else
+ ch = neighbour.y() - y;
+
int snapX = m_pView->snappedX(x + cw);
int snapY = m_pView->snappedY(y + ch);
- QPoint pt;
+ QPoint pt(snapX, snapY);
- switch(region) {
- case West:
- pt.setX(x);
+/* switch(region) {
+ default:
+// case West:
+ pt.setX(snapX);
pt.setY(snapY);
break;
case North:
at at -2928,9 +2975,9 at at
pt.setX(x + ww / 2);
pt.setY(y + wh / 2);
break;
- default:
+// default:
break;
- }
+ }*/
if (role == A)
m_LinePath.setPoint( 0, pt );
else {
------- Additional Comment #11 From Oliver Kellogg 2006-03-22 07:37 -------
***
------- Additional Comment #12 From Oliver Kellogg 2006-03-26 22:04 -------
SVN commit 522834 by okellogg:
Make the new angular-line drawing feature switchable in the Umbrello
general settings. (Switched off by default for backward compatibility.)
CCBUG:67223
M +51 -46 associationwidget.cpp
M +7 -5 dialogs/settingsdlg.cpp
M +3 -5 dialogs/settingsdlg.h
M +1 -0 optionstate.h
M +4 -5 uml.cpp
| Attachment | Type | Modified | Status | Actions |
|---|---|---|---|---|
| Create a New Attachment (proposed patch, testcase, etc.) | View All | |||
Bugs.KDE.Org Actions
