Bug 569254

Summary: [ELK] Avoid overlap during arrange at opening
Product: [Modeling] Sirius Reporter: Laurent Redor <laurent.redor>
Component: DiagramAssignee: Project Inbox <sirius.diagram-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: pierre-charles.david
Version: unspecifiedKeywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=569253
Whiteboard:

Description Laurent Redor CLA 2020-11-27 11:25:44 EST
Currently, in Sirius 6.4.0, the arrange at opening ignores other elements. It is expected to have possible overlap with other existing nodes.
We could imagine to do the current layout and then to add a shifting "after" the bounding box of existing brothers. This shifting could be done to the right or to the bottom, or even to the left or the top. These 2 last options seems less natural. Maybe the "direction" of the shifting should be configurable.

Steps to reproduce:
* Create a modeling project with data from "gitSiriusRepo\org.eclipse.sirius\plugins\org.eclipse.sirius.tests.junit\data\unit\layout\withELK"
* Open the diagram "diagramWithContainer" of "packageForArrangeSelectionTest"
* Launch an arrange all
* Save
* Close the diagram
* Replace the My.ecore file with the file contained in "gitSiriusRepo\org.eclipse.sirius\plugins\org.eclipse.sirius.tests.junit\data\unit\layout\withELK\replace"
* Open the diagram "diagramWithContainer"
* Expected: No overlap between new elements and existing ones: KO
    * New classes "Class1_3", "Class1_4" and "Class1_5" should be added "after" the bounding box of "Class1_1" and "Class1_2". The package "p1" should be resize accordingly.
    * New class "Class2_2_3" should be added "after" the bounding box of "Class2_2_1" and "Class2_2_2". The package "p2_2" should be resize accordingly.
    * New classes "Class3_5" and "Class3_6" should be added "after" the bounding box of "Class3_1" to "Class3_4". The package "p3" should be resize accordingly.
	* Overlap between existing elements themselves is expected. They are not "new" so they are not supposed to be moved during an arrange at opening. This is the case for:
	    * package "p1" and package "p2"
	    * package "p2_2" and class "Class2_1"
	    * package "p3" and package "p4"