Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Asynchronous layouting of zest graph
Asynchronous layouting of zest graph [message #1690099] Wed, 25 March 2015 09:14 Go to next message
Stephan Seifermann is currently offline Stephan SeifermannFriend
Messages: 19
Registered: March 2015
Junior Member
Hello,

I use the zest graph layouted with the SpringLayoutAlgorithm to create a nice graph. The graph contains a considerable amount of nodes and edges, so the layouting takes some time. Unfortunately, the SWT UI is not usable during the layouting of the graph since it is done in the UI thread.

I could not find a way to do this layouting asynchronously. The only indication for such a mechanism is the asynchronous flag in the applyLayout method of the algorithm. Unfortunately, it is hidden by the applyLayoutInternal method of the graph.

Is there any method to enable a non-blocking layouting of the graph?

Thanks in advance
Stephan
Re: Asynchronous layouting of zest graph [message #1690269 is a reply to message #1690099] Thu, 26 March 2015 09:18 Go to previous message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 230
Registered: March 2015
Senior Member
Hi Stephan,

unfortunately, the Zest 1.x layout model is combined with the visuals, therefore, changes made by a layout algorithm will directly affect the visuals. Laying out the nodes in the background will only be possible by subclassing and overriding the following (I am unsure if this is sufficient, though):

  • GraphNode#getLayoutEntity() has to return a LayoutEntity that is able to delay updating the visuals.
  • GraphConnection#getLayoutRelatioship() has to return a LayoutRelationship that is able to delay updating the visuals.
  • Graph#applyLayout() has to run the layout pass in the background and update all visuals afterwards.

For an alternative, you could take a look at GEF4 Zest [1] where layout model and visuals are separated. However, you would have to subclass/override LayoutContextBehavior#applyStaticLayout() there as well to run the layout pass in the background.

Best regards,
Matthias

[1] git.eclipse.org/c/gef/org.eclipse.gef4.git/tree/org.eclipse.gef4.zest.fx
Previous Topic:Inner and outer cicle, but not centered
Next Topic:GEF4 model part, how to draw a roundedrectangle with text
Goto Forum:
  


Current Time: Tue Mar 19 03:27:25 GMT 2024

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

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

Back to the top