Bug 550374 - [ELK] Allow to made specific changes linked to semantic aspects before and after the layout
Summary: [ELK] Allow to made specific changes linked to semantic aspects before and af...
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: 6.1.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 6.3.0   Edit
Assignee: Laurent Redor CLA
QA Contact: Laurent Redor CLA
URL:
Whiteboard:
Keywords: triaged
Depends on: 547598
Blocks:
  Show dependency tree
 
Reported: 2019-08-23 05:34 EDT by Laurent Redor CLA
Modified: 2019-12-09 02:56 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Redor CLA 2019-08-23 05:34:44 EDT
+++ This bug was initially created as a clone of Bug #547598 +++

The ELK algorithm configuration maybe not enough to layout correctly some diagrams. Sometimes semantic aspects could be considered. For this, I think that it will be a good idea to allow specifier to made changes before the layout and before applying the changes.

Currently the code in org.eclipse.sirius.diagram.elk.ELKLayoutNodeProvider.layoutEditParts(List, IAdaptable) is 
  LayoutMapping layoutMapping = connector.buildLayoutGraph(diagramEditPart, selectedObjects);
  connector.layout(layoutMapping);
  connector.transferLayout(layoutMapping);
  return connector.getApplyCommand(layoutMapping);

Maybe we can add new methods in the connector. For example
  LayoutMapping layoutMapping = connector.buildLayoutGraph(diagramEditPart, selectedObjects);
  connector.preLayout(layoutMapping);
  connector.layout(layoutMapping);
  connector.preTransferLayout(layoutMapping);
  connector.transferLayout(layoutMapping);
  connector.postTransferLayout(layoutMapping);
  return connector.getApplyCommand(layoutMapping);

And these methods should call an extension point implemented by the specifier.
Comment 1 Eclipse Genie CLA 2019-08-23 05:44:03 EDT
New Gerrit change created: https://git.eclipse.org/r/148204
Comment 3 Laurent Redor CLA 2019-09-18 03:51:54 EDT
To validate, use the scenario of cloned bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547598#c8
Comment 4 Laurent Redor CLA 2019-10-03 05:25:11 EDT
Validated with steps to reproduce from https://bugs.eclipse.org/bugs/show_bug.cgi?id=547598#c8 (but with an additional step to disable the "snap to..." feature).
Validated on a ODCE 11.3.0 "it2".
Comment 5 Pierre-Charles David CLA 2019-12-09 02:56:07 EST
Available in Sirius 6.3.0, see https://wiki.eclipse.org/Sirius/6.3.0