Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 520632

Summary: Snap to grid constraint is not taken into account during creation of multiple border nodes.
Product: [Modeling] Sirius Reporter: Jessy Mallet <jessy.mallet>
Component: DiagramAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, julien.dupont, laurent.redor
Version: 5.0.0Keywords: triaged
Target Milestone: 5.1.0   
Hardware: PC   
OS: All   
See Also: https://git.eclipse.org/r/102984
https://git.eclipse.org/r/103649
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6576c03bceb2fc723b55bf5b694f1f5fc71d9d9c
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=089ecb94010986c6cdd7a5d86c90a558693ed000
https://git.eclipse.org/r/104626
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=f7289093aeb0823dca566b174ab6753d90246474
https://git.eclipse.org/r/104630
https://git.eclipse.org/r/104635
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=41968cea31afb15f04a891d28e4c50a68481abd6
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=ed2ea73448b7063225e100400d422a58349ecf70
https://git.eclipse.org/r/104892
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=8756c943f0a17d6e1cef939cf2f8ac1676b779fb
https://git.eclipse.org/r/105539
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=d5ed8025112b9090d44d74010ed0bfc56c60868a
Whiteboard:
Attachments:
Description Flags
Test case to use.
none
ScreenShot of multiple border node creation behaviour
none
Properties of the grid
none
Additional Use Case with tools creating multiple Containers and border nodes none

Description Jessy Mallet CLA 2017-08-07 11:25:15 EDT
Created attachment 269716 [details]
Test case to use.

On diagram with "Snap to grid" activated, when user wants to create several border nodes from a tool of the palette, the first one is snapped to the grid and the others are shift and not aligned on the grid in spite of grid spacing is sufficient.

All created border node should take into account "Snap to grid" constraints.


Step to reproduce :
* import in your workspace the modeling project MultipleBorderNodeCreation.zip,
* open representation "new packageDiag",
* make sure that "Snap to Grid" box is marked in properties view of diagram (tab Rulers&Grid) 
* clic on "createClass" tool from the palette and create a class on P3 package
* create an other class at the same localisation than before
* both border Node appears on P3 package but last one is not snap on grid, just shift from the first one -> KO
  It should be align on the grid.
Comment 1 Jessy Mallet CLA 2017-08-07 11:25:44 EDT
Created attachment 269717 [details]
ScreenShot of multiple border node creation behaviour
Comment 2 Jessy Mallet CLA 2017-08-08 04:07:10 EDT
Created attachment 269729 [details]
Properties of the grid
Comment 3 Florian Barbin CLA 2017-08-09 03:40:36 EDT
Issue accepted and marked as triaged.
Comment 4 Eclipse Genie CLA 2017-08-11 12:04:51 EDT
New Gerrit change created: https://git.eclipse.org/r/102984
Comment 5 Eclipse Genie CLA 2017-08-24 12:10:32 EDT
New Gerrit change created: https://git.eclipse.org/r/103649
Comment 6 Florian Barbin CLA 2017-08-29 05:43:42 EDT
Created attachment 270007 [details]
Additional Use Case with tools creating multiple Containers and border nodes

With the second use case,
* Make sure the snap to grid is activated
* Open the representation
* Apply the package creation tool
* 3 packages are created, they are all visible and snapped on the grid.
* Apply the eClass creation tool on one of the packages
* 3 Border nodes are created, all snapped on the grid
Comment 7 Laurent Redor CLA 2017-09-01 08:53:10 EDT
The above scenario is not covered by an automatic test. It must be added before closing the issue as resolved.
Comment 10 Eclipse Genie CLA 2017-09-07 03:31:39 EDT
New Gerrit change created: https://git.eclipse.org/r/104626
Comment 12 Eclipse Genie CLA 2017-09-07 05:31:34 EDT
New Gerrit change created: https://git.eclipse.org/r/104630
Comment 13 Eclipse Genie CLA 2017-09-07 05:58:41 EDT
New Gerrit change created: https://git.eclipse.org/r/104635
Comment 16 Eclipse Genie CLA 2017-09-11 11:11:38 EDT
New Gerrit change created: https://git.eclipse.org/r/104892
Comment 18 Eclipse Genie CLA 2017-09-21 04:25:35 EDT
New Gerrit change created: https://git.eclipse.org/r/105539
Comment 19 Florian Barbin CLA 2017-09-21 09:28:41 EDT
Reopened.

Steps to reproduce:

Import the attachment 270007 [details]
Duplicate the project.
Open the two representations (the one from the original project and the one from the copy)
Set two different grid spacing for those diagrams (with the snap activated for both).
Apply the create package tool on each one of the two editors.
The grid parameter is not considered for one of the editor. KO
Indeed, the Diagram XMIID is used for retrieving the diagram parameters. As they have the same xmiid, the parameters of one diagram is applied for both.
Comment 21 Jessy Mallet CLA 2017-09-25 05:48:07 EDT
Validated on Sirius Stable 5.1.0.201709221508
Comment 22 Pierre-Charles David CLA 2017-11-08 03:36:52 EST
Available in Sirius 5.1.0, see https://wiki.eclipse.org/Sirius/5.1.0.