Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Eclipse Layout Kernel » ELK and Sirius "Arrange All"?(Arrange All seems to run after my layout)
ELK and Sirius "Arrange All"? [message #1794426] Thu, 30 August 2018 13:26 Go to next message
Luca Cristoforetti is currently offline Luca CristoforettiFriend
Messages: 12
Registered: April 2018
Junior Member
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 #1795082 is a reply to message #1794426] Fri, 14 September 2018 07:57 Go to previous messageGo to next message
Miro Spönemann is currently offline Miro SpönemannFriend
Messages: 78
Registered: March 2015
Location: Kiel, Germany
Member

The Sirius developers have recently implemented a special integration of ELK for Sirius diagrams. With that one, you can configure layout options such as top-down direction directly in your .odsign file, if I understood correctly. I would definitely go that way instead of trying to create your own workarounds.
Re: ELK and Sirius "Arrange All"? [message #1795084 is a reply to message #1795082] Fri, 14 September 2018 08:08 Go to previous message
Luca Cristoforetti is currently offline Luca CristoforettiFriend
Messages: 12
Registered: April 2018
Junior Member
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
Previous Topic:Getting started (GEF + ELK)
Next Topic:'UnsupportedConfigurationException' after closing alg.layered.
Goto Forum:
  


Current Time: Fri Apr 26 06:49:43 GMT 2024

Powered by FUDForum. Page generated in 0.03612 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top