ELK and Sirius "Arrange All"? [message #1794426] |
Thu, 30 August 2018 09:26  |
Eclipse User |
|
|
|
Hi,
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:
myTopNode.setProperty(CoreOptions.DIRECTION, Direction.DOWN);
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.
Thanks
Luca
|
|
|
|
Re: ELK and Sirius "Arrange All"? [message #1795084 is a reply to message #1795082] |
Fri, 14 September 2018 04:08  |
Eclipse User |
|
|
|
Thanks Miro,
I read that ELK has been supported in the new version of Sirius. The problem is that I'm forced to use Eclipse Neon and the new Sirius is not compatible.
I solved the issue delaying the layout command with an asynchronous call. It is not optimal because you can clearly see the layout being adjusted a second after being displayed, but I can live with it.
Luca
|
|
|
Powered by
FUDForum. Page generated in 0.04404 seconds