| Bug 106356: Line Vertex hidden in class diagrams | (normal) |
| Opened: | 2005-05-27 01:16 |
| Product: | umbrello |
| Component: | general |
| Version: | unspecified |
| Status: | RESOLVED |
| Platform: | Compiled Sources |
| Resolution: | FIXED |
| Reporter: | Tony Parent |
| Assigned to: | Oliver Kellogg |
Version: kdesdk-050504 (using KDE KDE 3.4.0)
Installed from: Compiled From Sources
Compiler: gcc
OS: Linux
- Create a new class
- Draw a aggragation line that loops back on the same class
(This happens when you have a "singleton" or other type
of class that contains a pointer to itself.)
- Select one of the vertexes of the line and move it
down under the class.
- You can no longer move that vertex out from under
the class.
I only say to do the above in order to illistrate a problem that I have run into several times on class diagrams. Sometimes when I do a cut/paste from one class diagram to another, the singletons lines get moved around. Most of the time it is just messed up a little. Other times the lines end up under the class box, and there is no way to get ahold of the vertexes to move them out from under the box.
------- Additional Comment #1 From Oliver Kellogg 2005-05-27 08:53 -------
In Umbrello svn head, I can't move the self association at all -
it is always placed at the top edge of the class.
------- Additional Comment #2 From Tony Parent 2005-05-27 16:26 -------
Created an attachment (id=11223)
class before
------- Additional Comment #3 From Tony Parent 2005-05-27 16:29 -------
Created an attachment (id=11224)
class after moving vertex
The attached file shows what happens when you grab one of the vertexes and move
it below the class. Selecting the association line shows the vertexes that are
still above the class but not the one under the class.
The previous attachment shows the before picture. (Sorry, I didn't put a
comment on that attachment.)
------- Additional Comment #4 From Oliver Kellogg 2005-05-27 19:50 -------
Ah, okay. I had been trying to move the assoc by dragging a
_line_segment_ not a _vertex_.
As for your problem: How about just preventing the dragged vertex
from going underneath any (own class or other) object box.
I think that's how I'll fix this problem if I don't hear back.
------- Additional Comment #5 From Oliver Kellogg 2005-05-27 20:52 -------
SVN commit 418815 by okellogg:
mouseMoveEvent(): Prevent the moving vertex from disappearing underneath a
widget, else there's no way to get it back.
The current behavior is somewhat jerky - improvements are very welcome :)
BUG:106356
M +26 -0 associationwidget.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #418814:418815
at at -2411,6 +2411,32 at at
p.setY(newY);
}
+ // Prevent the moving vertex from disappearing underneath a widget
+ // (else there's no way to get it back.)
+ UMLWidget *onW = m_pView->testOnWidget(p);
+ if (onW) {
+ const int pX = p.x();
+ const int pY = p.y();
+ const int wX = onW->getX();
+ const int wY = onW->getY();
+ const int wWidth = onW->getWidth();
+ const int wHeight = onW->getHeight();
+ if (pX > wX && pX < wX + wWidth) {
+ const int midX = wX + wWidth / 2;
+ if (pX <= midX)
+ p.setX(wX);
+ else
+ p.setX(wX + wWidth);
+ }
+ if (pY > wY && pY < wY + wHeight) {
+ const int midY = wY + wHeight / 2;
+ if (pY <= midY)
+ p.setY(wY);
+ else
+ p.setY(wY + wHeight);
+ }
+ }
+
//move event called now
QMoveEvent m(p, oldp);
moveEvent(&m);
------- Additional Comment #6 From Tony Parent 2005-05-27 21:03 -------
You are too fast for me!
I would make sure that the vertex will never get under the class at all. My moving the vertex under the class was only a means of illistrating a point. I originally came up with the problem when I did a copy/paste from one class diagram to another. The associations get moved around, and some vertecies end up under classes. Most of the time it's not an issue as you can move the class out of the way to get to the vertex. The problem is when the vertex is part of an association attached to the class you need to move. Then the vertex moves with the class and you can never get to it. So if the above fix prohibits the copy/paste from doing the wrong thing, then closing is OK.
Or do I need to open a bug report against the paste operation?
Keep up the good work.
| Attachment | Type | Modified | Status | Actions |
|---|---|---|---|---|
| class before | image/gif | 2005-05-27 16:26:53 | none | Edit |
| class after moving vertex | image/gif | 2005-05-27 16:29:51 | none | Edit |
| Create a New Attachment (proposed patch, testcase, etc.) | View All | |||
Bugs.KDE.Org Actions
