Community
Participate
Working Groups
Created attachment 276122 [details] The default diagram layout When a diagram is created with an ELK algorithm, the layout is automatically applied to first level diagram elements, but not to nodes contained in containers (screenshot init.png) The user has to click on the "Arrange All" button to apply the layout to sub-nodes (screenshot arrange-all.png)
Created attachment 276123 [details] The diagram after clicking on "arrange all"
Created attachment 276124 [details] The odesign and a sample model The domain model is here: http://eclipse.org/sirius/resources/mindstorms-tutorial/solution1.zip
The model project is missing to reproduce
There are several problems: * First of all, currently "stap to" features are not supported by ELK layouts. So you have to disable these preferences by default (Preferences/Sirius/Sirius Diagram/Rulers And Grid). * There is a bug concerning some specific kind of edit parts (AbstractDNodeContainerCompartmentEditPart and AbstractDNodeListCompartmentEditPart). For these edit parts, the method org.eclipse.sirius.diagram.ui.business.api.query.EditPartQuery.getDiagramDescription() returns null. And so the ELK Layout associated with the diagram description is not retrieved and a default layout is used.
New Gerrit change created: https://git.eclipse.org/r/151843
The above gerrit is a proposition of fix (maybe for Sirius 6.3.1). It is too late for Sirius 6.3.0.
Steps to validate: * Ensure that Graphviz is installed on your computer (if not install it through http://graphviz.org/download/) * Correctly configure Graphviz (preference "Eclipse Diagram Layout/Graphviz/Path to 'dot' executable". * Import meta-mode and modeler projects in your workspace (from mindstorms-mmAndModeler.zip) * Launch a runtime * Import sample project in your runtime (from mindstorms-sample.zip) * Open session from project fr.obeo.dsl.tuto.mindstorms.sample * Disable the "snap to" features in the preferences (Preferences/Sirius/Sirius Diagram/Rulers And Grid). They are currently not supported by ELK layouts. * Create a new "Choreography Diagram" under "Choreogrpay Main" * Expected: All nodes must be correctly layouted (as the existing diagram).
Created attachment 280481 [details] mindstorms-mmAndModeler.zip
Created attachment 280482 [details] mindstorms-sample.zip
New Gerrit change created: https://git.eclipse.org/r/152159
Created attachment 280618 [details] TestElkLayout.zip Steps to validate * Ensure that Graphviz is installed on your computer (if not, install it through http://graphviz.org/download/) * Correctly configure Graphviz (preference "Eclipse Diagram Layout/Graphviz/Path to 'dot' executable"). * Import project TestElkLayout (form TestElkLayout.zip) * Open session from project TestElkLayout * Disable the "snap to" features in the preferences (Preferences/Sirius/Sirius Diagram/Rulers And Grid). They are currently not supported by ELK layouts. * Create a new "SimpleDiagram" under the "root" package * Expected: All nodes must be correctly layouted: C1, C2, C3 and C4 on the same line and following each other (as the existing diagram "expectedDiagram"). It must not be as the diagram "diagramWithPb".
Currently, this issue is interrupted.
Created attachment 284523 [details] ELKLayoutProblems.zip Another steps to validate is: * Import project ELKLayoutProblems_A (from ELKLayoutProblems.zip) * On root package create a new ContainerNodeAndBorderNodeDiagram * Expected: The result is like in diagram "containerNodeAndBorderNodeDiagram" from "ELKLayoutProblems_resultA" * On root package create a new ContainerNodeAndBorderNodeDiagramWithELK * Expected: The result is like in diagram "containerNodeAndBorderNodeDiagramWithELK" from "ELKLayoutProblems_resultA" (before this issue, an arrange all was necessary to have the same result)
This gerrit https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/151843 (merged in branch 6.1.x through https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/152159) seems finally not necessary after works done for bug 568037 (concerning "arrange selection"). A small part of the original gerrit has been moved to https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/171014. The problem detected about the several "arranges" is no longer problematic. The behavior is now similar between ELK and classic layout.
When diagram contains edges between nodes of several hierarchy, the above gerrit finally seems necessary. Steps to validate: * Import ELKLayoutProblems_E (from ELKLayoutProblems.zip) * On root package create a new ContainerNodeAndBorderNodeDiagramWithELK * Expected: The result is like in diagram "Expected_ContainerNodeAndBorderNodeDiagramWithELK" (before this issue, an arrange all was necessary to have the same result).
Created attachment 284526 [details] ELKLayoutProblems.zip
There is another problem when the new diagram contains hidden elements (hidden labels of border nodes for exemple). In this case, a InitializeHiddenElementsCommand is executed during AbstractDDiagramEditPart activation (before the launchArrangeCommandOnOpening launched by the SiriusCanonicalLayoutHandler in DDiagramEditorImpl.initializeGraphicalViewer()). This execution triggers an arrange all but without considering the specific aspect of ELK. So we are agian in a case where several arrange are launched. We can ignore this operation Layout is not necessary in this case of operation because it will be done later by SiriusCanonicalLayoutHandler.launchArrangeCommandOnOpening. It allows to: * launch less arrange commands (perf) * avoid problem for ELK layout. Steps to validate: * Import ELKLayoutProblems_E (from ELKLayoutProblems.zip) * On root package create a new ContainerNodeAndBorderNodeDiagramWithELKWithHiddenLabel * Expected: The result is like in diagram "Expecetd_ContainerNodeAndBorderNodeDiagramWithELKWithHiddenLabel" (before this issue, an arrange all was necessary to have the same result).
Created attachment 284527 [details] ELKLayoutProblems.zip
New Gerrit change created: https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/171468
Gerrit change https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/171468 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=12b08c895daa0c535f48ebe907db0726f374ad27
Gerrit change https://git.eclipse.org/r/c/sirius/org.eclipse.sirius/+/151843 was merged to [master]. Commit: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=b8f96de50497f83458296f690fae2edf3c4afa11
There are several steps to validate: * comment 11 * comment 13 * comment 15 * comment 17
Available in Sirius 6.4.0, see https://download.eclipse.org/sirius/updates/releases/6.4.0/ for details.
Created attachment 285063 [details] bugzilla539778_arrangeContainer.png: The result in 6.4.0 (compared with before).