|ELK and Sirius "Arrange All"? [message #1794426]
||Thu, 30 August 2018 13:26
| Luca Cristoforetti
Registered: April 2018
before installing ELK, I had a Sirius diagram (a fault tree analysis result) that used to appear with a top-down layout. The direction is set in a .odesign file, Composite Layout - Direction.
After installing ELK (v0.4.1), my diagram appears with a left-right layout. Pressing the "Arrange All" button doesn't fix the issue. If I scramble the elements, the "Arrange All" will align them from left to right.
To solve the problem I created an extension point for ELK, implementing the ILayoutSetup and extending the GmfDiagramLayoutConnector (with priority 100). To fix the direction of my diagram, I used only:
So now, when I press the ELK layout button, the layout is properly fixed in a top-down order.
The problem is that I need to run the ELK after the programmatically creation of the diagrams, in order to display them with the correct layout. To do so, I call DiagramLayoutEngine.invokeLayout() just after the creation of the diagram.
What I get is the following:
- I see a bunch of elements not arranged;
- after a fraction of second, the ELK layout kicks in, arranging the elements as I want;
- after another second, something else changes my layout in the left-right manner.
If I check the Undo history, I see that there are two "Undo Automatic Layout" actions. Undoing the last one brings me to my correct layout. I tried to put a few seconds delay before calling the invokeLayout(), but the layout stays there only for a second and then becomes left to right.
Am I doing something wrong? Is this the correct way to arrange the layout? I did the same steps for some Papyrus diagrams and it works great there.
Powered by FUDForum
. Page generated in 0.01559 seconds