Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Layout nodes in container in tree programmatically(Layout nodes in container in tree programmatically)
Layout nodes in container in tree programmatically [message #1724316] Tue, 23 February 2016 04:58 Go to next message
Nguyen Xuan Nhan is currently offline Nguyen Xuan NhanFriend
Messages: 11
Registered: February 2016
Junior Member
Hi all,
+ I'm new in Sirius. I want to arrange elements in diagram in tree layout, programmatically.
In my sample project, I have some nodes. Connection between nodes from bordered node to other border node. Please, see the figure 1 index.php/fa/25072/0/.
When User click sample button e.g arrange button, nodes will be arranged in tree layout as figure 2 index.php/fa/25073/0/.

+ I've tried some methods but I still stuck to resolve my problem
Method 1:
Using Ordered Tree Layout by Sirius, add Ordered Tree Layout to VSM file.
In my understand, these nodes in diagram cannot be layout in tree layout because of connection between nodes is from bordered node to bordered node. Ordered Tree Layout algorithm find children to layout based on edge connection between nodes.
Other disadvantage, I want to arrange nodes, programmatically, this method may not suitable.
link: https://github.com/mbats/sirius-blog/blob/master/tree-layout/blog/Tree_Layout.textile

Method 2:
Using extension layout provider. Based on tutorial from below link, by using GridLayoutProvider, all nodes are arranged in 1 column only. At least, I want to arrange nodes in multiple rows and columns
link: https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom-arrange-all.html

+ As my understand, to make new algorithm to arrange nodes is very difficult task. Do you have any suggestion to resolve my problem?
Thank you very much
Re: Layout nodes in container in tree programmatically [message #1724446 is a reply to message #1724316] Wed, 24 February 2016 02:32 Go to previous messageGo to next message
Nguyen Xuan Nhan is currently offline Nguyen Xuan NhanFriend
Messages: 11
Registered: February 2016
Junior Member
No Message Body

[Updated on: Wed, 24 February 2016 02:33]

Report message to a moderator

Re: Layout nodes in container in tree programmatically [message #1724447 is a reply to message #1724446] Wed, 24 February 2016 03:00 Go to previous messageGo to next message
Tuan Hoang Anh is currently offline Tuan Hoang AnhFriend
Messages: 42
Registered: May 2015
Member
Figure 1:
https://farm2.staticflickr.com/1514/25107499842_03e1134baf_z.jpg
Figure 2:
https://farm2.staticflickr.com/1441/24930153630_20c7e541ac_z.jpg
Re: Layout nodes in container in tree programmatically [message #1724498 is a reply to message #1724316] Wed, 24 February 2016 09:08 Go to previous messageGo to next message
Florian Barbin is currently offline Florian BarbinFriend
Messages: 253
Registered: August 2010
Senior Member
Hi,

Sirius provides basic layout algorithms but for more specific needs you
need to provide your own algorithm or delegate the layout to a
third-party algorithm tool.
You can take a look on
https://projects.eclipse.org/projects/modeling.elk. I don't know in
detail this project but I think it could help you: "The Eclipse Layout
Kernel (ELK) provides such layout algorithms, as well as an
infrastructure to connect them to diagram editors."

Regards,

--
Florian - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Layout nodes in container in tree programmatically [message #1724518 is a reply to message #1724498] Wed, 24 February 2016 10:09 Go to previous message
Nguyen Xuan Nhan is currently offline Nguyen Xuan NhanFriend
Messages: 11
Registered: February 2016
Junior Member
Hi Florian,

Thank you for your quick reply.
Firstly, I cannot access your link for ELK project.
As recommendation from some expert member, making own layout algorithm is very difficult task. So I wonder about this approach.
If there is no other approachs then I will try to make own algorithm. Thank you for your advice.

Best regards,
Nhan
Previous Topic:Problems with self referencing objects
Next Topic:Registering New Diagram Extensions
Goto Forum:
  


Current Time: Thu Jan 21 16:48:05 GMT 2021

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

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

Back to the top