Bug 547994 - [ELK] Ability to choose algorithm for each container type
Summary: [ELK] Ability to choose algorithm for each container type
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Diagram (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 10
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2019-06-06 07:38 EDT by Enrico Vincenzi CLA
Modified: 2019-10-31 05:07 EDT (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 Enrico Vincenzi CLA 2019-06-06 07:38:50 EDT
Currently it is possible to add a single ELK algorithm just for the top node in a Diagram. 
It would be great if it were possible to select a different algorithm for each type of container designed in the *.odesign file an not just one for the top.
Thanks
Comment 1 Laurent Redor CLA 2019-10-31 05:06:16 EDT
Currently, even with future Sirius versions 6.1.4 [1] or 6.3.0 [2], it is not possible to do that.
Nevertheless, it is possible to use the experimental extension point org.eclipse.sirius.diagram.elk.layout.extension. By implementing the method org.eclipse.sirius.diagram.elk.IELKLayoutExtension.beforeELKLayout(LayoutMapping), you should be able to add specific ELK algorithm for each node.
You have then to use the ELK model
> ElkNode elkNode = layoutMapping.getLayoutGraph();
> elkNode.getChildren()...
> elkNode.setProperty(org.eclipse.elk.core.options.CoreOptions.ALGORITHM, org.eclipse.elk.alg.mrtree.options.MrTreeOptions.ALGORITHM_ID);

It will be more difficult than simply add a new algorithm under a mapping. But this improvement is not planned in future releases.

[1] http://download.eclipse.org/sirius/updates/stable/6.1.4-S20190910-141057/
[2] http://download.eclipse.org/sirius/updates/milestones/6.3.0rc1