Community
Participate
Working Groups
Created attachment 262317 [details] CompartmentsLayoutProblem.zip There is a compartment layout problem when addition of semantic elements involved a refresh of a diagram. Steps to reproduce: * Import the project CompartimentsLayoutProblem from attached archive file * Open the diagram "HStackDiag" * Open the file My.ecore with the "Sample Ecore Model Editor" * Copy the package "P1" in package "root" and rename it to "P2" * Save the ecore file * The diagram "HStackDiag" is refreshed: ** The new package P2 is created: OK ** The existing package P1 is auto-sized: KO. There is also a bug in the size of the container "P1" or its region "Left_class1" (the bug 495046 corresponds to this other problem). If you do the same with the diagram "HStackDiagPinned" there is no problem. The difference between the 2 diagrams is that the package P1 is pinned in "HStackDiagPinned".
I must click on refresh toolbar icon to refresh the diagram representation.
Created attachment 262389 [details] setBoundsStacksForClassicalContainer.txt This file is the first of a serie of fourth to facilitate the analysis of the difference between a classical container and a regions container: * setBoundsStacksForClassicalContainer.txt: Stacks corresponding to creation or execution of a SetBoundsCommand for a classical container * setBoundsStacksForClassicalContainer-abstract.txt: Abstract of the above file * setBoundsStacksForRegionsContainer.txt: Stacks corresponding to creation or execution of a SetBoundsCommand for a regions container * setBoundsStacksForRegionsContainer-abstract.txt: Abstract of the above file
Created attachment 262390 [details] setBoundsStacksForClassicalContainer-abstract.txt
Created attachment 262391 [details] setBoundsStacksForRegionsContainer.txt
Created attachment 262392 [details] setBoundsStacksForRegionsContainer-abstract.txt
Created attachment 262394 [details] setBoundsStacksForClassicalContainer-abstract.txt
Created attachment 262395 [details] setBoundsStacksForRegionsContainer-abstract.txt
By comparing the two abstract files, we can see that: * The auto size is not handled by the same way (it is probably expected). * The request REQ_MOVE is not send to NodeList C1 for ArrangeAllWithAutoSize.createSubCommands as the condition in line 308 returns false. This is caused by the margin that is set to 0 for Region in DiagramLayoutCustomization.getNodePadding(GraphicalEditPart). This seems also OK. * The CommandWrapper returned by the PinnedElementsLayoutProvider is unexecutable for NodeList C1 (and so for all commands). So for the case of regions container, the pinned elements (or those to be considered as such, like C1 and P1) are not restored with their initial location and size. I think this point is the cause of the problem.
Indeed, the problem is arround the PinnedElementsLayoutProvider and the MOVE request ignored by RegionResizableEditPolicy. The MOVE request is ignored by the RegionResizableEditPolicy as it is forbidden to move a region. But this is a specific case of MOVE request. The goal of this request is to reset bounds (location AND size) of the edit part after the arrange selection of new elements (an arrange all is launched and then there is a "revert" of the not concerned edit part). The solution is to authorized the MOVE request for Region only in some circumstances (reset from PinnedElementsLayoutProvider for example).
New Gerrit change created: https://git.eclipse.org/r/75147
New Gerrit change created: https://git.eclipse.org/r/75146
New Gerrit change created: https://git.eclipse.org/r/75276
Gerrit change https://git.eclipse.org/r/75147 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=0e6c68281db6a9c0e2495acdc669aea0d306f846
Gerrit change https://git.eclipse.org/r/75146 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4c22f9b8234cafc16a93dea18dfe491194571342
Gerrit change https://git.eclipse.org/r/75276 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=974473d9916f48b95252193319c9e7302f0c8e3e
The previous commits reduce the number of call to RegionContainerUpdateLayoutOperation. But at least one is wrongly removed. Steps to reproduce: * Import the project CompartimentsLayoutProblem from attached archive file (CompartimentsLayoutProblem2.zip) * Open the diagram "VStackDiag" * Open the diagram "HStackDiag" * Delete "Left_class1" from "HStackDiag" * Set the focus on "VStackDiag": KO, the layout of the 2 remaining regions are not done. There is a blank space at the location of "Left_class1".
Created attachment 262496 [details] CompartmentsLayoutProblem2.zip
New Gerrit change created: https://git.eclipse.org/r/75413
The gerrit https://git.eclipse.org/r/#/c/75413/1 adds tests that reveal the problem.
New Gerrit change created: https://git.eclipse.org/r/75418
New Gerrit change created: https://git.eclipse.org/r/75476
Gerrit change https://git.eclipse.org/r/75476 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ec188e6debb715e47313ae5d045d4de1457b4a06
Gerrit change https://git.eclipse.org/r/75413 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=3f878ffc2cc51edc98e3192f1c4d677ccafdc19a
Gerrit change https://git.eclipse.org/r/75418 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=b943ce8c07aac76207f83438859d6d1314fcd310
The 3 last commits fix the regression of comment 16.
Available in Sirius 4.1.0, see https://wiki.eclipse.org/Sirius/4.1.0 for details.