Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » ELK nodes
ELK nodes [message #1807047] Tue, 21 May 2019 17:39 Go to next message
Bruno Oliveira is currently offline Bruno OliveiraFriend
Messages: 2
Registered: February 2019
Junior Member
Hi
Its possible I know DNode with ElkNode and what is the first function when open/load diagram representation?

thank you.
Re: ELK nodes [message #1807073 is a reply to message #1807047] Wed, 22 May 2019 08:24 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

I can't seem to understand the context of your question.
Can you be more specific? How are you using ELK with Sirius?

Regards,





Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: ELK nodes [message #1807104 is a reply to message #1807073] Wed, 22 May 2019 15:59 Go to previous messageGo to next message
Pedro Carvalho is currently offline Pedro CarvalhoFriend
Messages: 3
Registered: May 2019
Junior Member
Hello,

Im working with Bruno
So, we are using Obeo with Sirius and we want trying to reorganize the runtime diagram using ELK. We already created the ELK algorithm and its all working well. But in order to know what node we are selecting from the main layoutGraph we need to know if its possible to do something like "if(nodeX is instance of SomeDomainModel)".
Is that possible?
Re: ELK nodes [message #1807128 is a reply to message #1807104] Thu, 23 May 2019 09:05 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi Pedro,

If I understand well you should have a LayoutMapping as entry point of your custom layouting.

In this element you can access the graph map by using mapping.getGraphMap()
that will be of real type BiMap<ElkGraphElement, IGraphicalEditPart>.

So for each ELK element you have its associated edit part. You will have to cast it because the map is of type BiMap<ElkGraphElement, Object> when you have it.

First use the mapping to retrieve the edit part.

Then from graphical edit part you have to do the following to retrieve the semantic element behind: ((DDiagramElement)((View)editPart.getModel()).getElement()).getTarget()

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius

[Updated on: Thu, 23 May 2019 09:06]

Report message to a moderator

Re: ELK nodes [message #1807286 is a reply to message #1807128] Mon, 27 May 2019 13:43 Go to previous messageGo to next message
Pedro Carvalho is currently offline Pedro CarvalhoFriend
Messages: 3
Registered: May 2019
Junior Member
Hello,

I'm trying your solution but keep not working for me.
Thats the declaration of my algorithm class :
public void layout(ElkNode layoutGraph, IElkProgressMonitor progressMonitor) {

The layoutGraph element is ELKNode type, so i'm not able to get getModel()).getElement()).getTarget() methods.
I can access children's of ELKNode too, that's ok, but i'm not able to know if one specific node (children of layoutGraph) is type of PersonDomainModel or type of BallDomainModel. Thats my big problem.

Regards,
Re: ELK nodes [message #1807395 is a reply to message #1807286] Wed, 29 May 2019 08:14 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,

Your are not were I thought you were. Indeed at this point you don't have neccessary information to know the semantic element.

Currently the elk node is using the name of the sirius diagram element as id. It should be the UID.
But even with the UID that identifies the diagram element that could allow you to retrieve the semantic element it would not be easy or really proper to know the information.
When your layout is called, you would have to retrieve the current diagram editor to find all mappings to look at the sirius diagram element behind to know the semantic element from it.

The solution would be to modify ELK interface IGraphLayoutEngine to have a method were you have the LayoutMapping or the graph map containing part associated to elk node to retrieve semantic element.

Can you create a Sirius ticket of your problem? https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Sirius


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: ELK nodes [message #1807654 is a reply to message #1807395] Wed, 05 June 2019 16:52 Go to previous messageGo to next message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=547869

Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: ELK nodes [message #1808113 is a reply to message #1807654] Mon, 17 June 2019 14:53 Go to previous messageGo to next message
Pedro Carvalho is currently offline Pedro CarvalhoFriend
Messages: 3
Registered: May 2019
Junior Member
Hello again,

after a lot of research, im still not getting the answer to my problem.
I've got sirius diagram all configured, and I want to get one way to automatically organize my nodes. In attach number 1 is what i'm getting by "arrange all" function, with 1 elk layout algorithm, and i want to get my diagram like the attach 2.
how can i get that solution?
1:
index.php/fa/35767/0/
(https://drive.google.com/open?id=1vyRZtNqs7X4OGRJQdmaF91_BMw4MYHlN)


2:
index.php/fa/35768/0/
(https://drive.google.com/open?id=1ScI1glRgOKGd4Atz-CcYPDx7og7gkcmY)

[Updated on: Mon, 17 June 2019 14:55]

Report message to a moderator

Re: ELK nodes [message #1808306 is a reply to message #1808113] Fri, 21 June 2019 09:35 Go to previous message
Pierre Guilet is currently offline Pierre GuiletFriend
Messages: 250
Registered: June 2017
Senior Member
Hi,
I am a little bit confused with what you want.
Layouting is a very complex matter.
You have two solutions:

- Either you use current algorithms available in Sirius and play with available options in odesign by following the documentation to get the optimum result you can have. But its unlikely you will have the perfect result you want.
However there is currently a bug and algorithm options are only applied on top node so their effects are very limited. The bug will be fixed in next version: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547306#

- Or you provide you own layout algorithm to ELK and use it in Sirius odesign. That what I thought you were doing but you currently cannot access semantic element. So you are stuck for now.

Regards,


Pierre Guilet - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Template models or patterns
Next Topic:Drag and Drop.
Goto Forum:
  


Current Time: Fri Apr 19 15:48:20 GMT 2024

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

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

Back to the top