Skip to main content



      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] Mon, 22 February 2016 23:58 Go to next message
Eclipse UserFriend
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] Tue, 23 February 2016 21:32 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body

[Updated on: Tue, 23 February 2016 21:33] by Moderator

Re: Layout nodes in container in tree programmatically [message #1724447 is a reply to message #1724446] Tue, 23 February 2016 22:00 Go to previous messageGo to next message
Eclipse UserFriend
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 04:08 Go to previous messageGo to next message
Eclipse UserFriend
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 05:09 Go to previous message
Eclipse UserFriend
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: Sun Jul 27 19:54:24 EDT 2025

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

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

Back to the top