Bug 72615 - aggregation/composition & inheritance hierachy sometimes reverses
Summary: aggregation/composition & inheritance hierachy sometimes reverses
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: VHI normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
: 73139 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-01-14 11:38 UTC by Sean Clarke
Modified: 2004-02-28 16:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Large umbrello project (40.64 KB, application/octet-stream)
2004-02-18 09:36 UTC, Sean Clarke
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Clarke 2004-01-14 11:38:42 UTC
Version:            (using KDE KDE 3.1.94)
Installed from:    SuSE RPMs
OS:          Linux

Hi,
    Sometimes the aggregation/composition and inheritance gets reversed. This can happen when cut and pasting classes, but also just in normal operation.

In normal operation you select one of the joins (eg aggregation) then select class A, then class B and the aggregation is the wrong way around. If you delete the aggregation and perform the task again it may work correctly.

When cut and pasting classes and hierachy from one diagram to another, if things get reversed you can delete the superclass and the drag it back on the canvas and it is displayed correctly.

I am using Umbrello compiled from source (kdesdk-040113 ie 13/01/2004).
Comment 1 Jonathan Riddell 2004-01-19 16:56:02 UTC
I can't recreate this with inheritance but it does seem to happen with aggregation and composition.  

Add two classes to a diagram.
Add a composition, diamond is correctly at the first class selected.
Add a second composition, diamond is at wrong end.

I wonder if this is due to the code which swapped round the diagram on old diagrams (they used to be wrongly ended).
Comment 2 Jonathan Riddell 2004-01-21 16:04:36 UTC
This does happen with implements as well, you just have to delete the first implements before adding a second one which will be the wrong way around.

Unidirectional associations are vulnerable too.
Comment 3 Brian Thomas 2004-02-17 19:38:19 UTC
I believe this bug entered when Oliver changed the direction of the 
association symbols. Currently, if assoc->findAssociation sees that 
an association of the type you want to add already exists, it will 
reverse the direction of the association, whether you want it to or
not (this is done within associationwidget constuctor). 

I dont understand why this is here in the first place (perhaps compliance
with older XMI files?.. if so, then the swap should occur ONLY when 
loading an older XMI file).

I can remove this 'functionality', but await further explaination of the
use of this before proceeding.
Comment 4 Brian Thomas 2004-02-17 23:33:26 UTC
*** Bug 73139 has been marked as a duplicate of this bug. ***
Comment 5 Oliver Kellogg 2004-02-18 08:45:38 UTC
I cannot reproduce the problem.
Here's what I tried:

- Go into a class diagram
- Create a new_class_1 and a new_class_2
- Create an aggregation originating at new_class_1
  and targeting new_class_2 (diamond is at new_class_1)
- Do all the following while holding down the Shift key (for
  multiple selection):
  Left mouseclick on the aggreation, then left mouseclick
  on new_class_1, then left mouseclick on new_class_2
  (I also tried varying the order of left clicked objects)

With these steps, the aggregation diamond does NOT
change position.

Please supply a precise step-by-step recipe for
reproducing the problem.
Comment 6 Sean Clarke 2004-02-18 09:30:36 UTC
I'll upload my Umbrello diagram - it's large and displays the problems easier.

Create a new class in project and see if that has an effect - I can reproduce it everytime.
Comment 7 Sean Clarke 2004-02-18 09:36:24 UTC
Created attachment 4759 [details]
Large umbrello project
Comment 8 Oliver Kellogg 2004-02-19 15:34:08 UTC
From Sean Clarke 2004-02-18 09:30 :
> [...]
>
> Create a new class in project and see if that has an effect -

I assume you mean creating a class and then creating associations
from existing classes to the new class, or vice versa.
I tried all this but still see no problem, and I repeat my request
for a recipe so we have a chance of reproducing it.
Comment 9 Jonathan Riddell 2004-02-20 14:16:00 UTC
The problem as I see it can be caused thus:

-new file, new class diagram
-add two classes
-Choose unidirectional association tool (or any other directional association)
-add association from first class to second class
-add another association from first class to second class
-the two associations point in opposite directions, they shouldn't
Comment 10 Jonathan Riddell 2004-02-26 00:16:10 UTC
Brian is right that the swap wrongly happens in the associationwidget constuctor due to assoc->findAssociation() but removing that piece of code causes UMLView::addAssociation() to fail which causes the diagram to crash when it is closed.
Comment 11 Jonathan Riddell 2004-02-28 16:12:08 UTC
Fixed by Brian.