Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Node position and size based on semantic model
Node position and size based on semantic model [message #1720342] Sun, 17 January 2016 22:49 Go to next message
Stefano Cottafavi is currently offline Stefano CottafaviFriend
Messages: 57
Registered: July 2009
Member
Hello,
I have a model implemented using Xtext. I'm creating a diagram editor for such a model and I want to assign to the nodes the size and the location contained in my model (in a semantic element "Annotation").
I guess this has to be done via style customization but I'd like to have some input to point in the right direction.

Cheers,
Stefano
Re: Node position and size based on semantic model [message #1720411 is a reply to message #1720342] Mon, 18 January 2016 14:09 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hello,

You will need to implement your own layouting based on these stored
sizes and locations using this documentation
(https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom-arrange-all.html).
As the sizes and locations are stored, do you plan to update the model
when a user will move diagram elements or to forbid any graphical
modification using Sirius?

Regards,
Steve

Le 17/01/2016 23:49, Stefano Cottafavi a écrit :
> Hello,
> I have a model implemented using Xtext. I'm creating a diagram editor
> for such a model and I want to assign to the nodes the size and the
> location contained in my model (in a semantic element "Annotation").
> I guess this has to be done via style customization but I'd like to have
> some input to point in the right direction.
>
> Cheers,
> Stefano


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Node position and size based on semantic model [message #1720441 is a reply to message #1720411] Mon, 18 January 2016 16:16 Go to previous messageGo to next message
Stefano Cottafavi is currently offline Stefano CottafaviFriend
Messages: 57
Registered: July 2009
Member
Hi Steve,
thank you for the quick reply. Yes indeed I'd like to store the modification back in the model. I thought to go one step at a time Smile, but any advice is welcome.
I'll post updates about the arrange-all implementation..

Cheers,
Stef
Re: Node position and size based on semantic model [message #1720862 is a reply to message #1720441] Thu, 21 January 2016 14:03 Go to previous messageGo to next message
Stefano Cottafavi is currently offline Stefano CottafaviFriend
Messages: 57
Registered: July 2009
Member
Hi Steve,
I've implemented my layout provider in which I drill down into the annotations of my model to get the location of the diagram nodes and create the commands to move them.
I've two questions:
- how can I persist the the annotations back from the diagram to the model once a view has been moved manually by an user?
- I have graphical annotation for example for the grid size that I want to get from my model and assign it to the diagram.Can I do it from the same layout provider? on which diagram element these information have to be set?

thanks for your help.

cheers,
stef
Re: Node position and size based on semantic model [message #1721027 is a reply to message #1720862] Fri, 22 January 2016 16:53 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 572
Registered: May 2011
Senior Member
Hi Stefano,

I think that you should add a ModelChangeTrigger
(session.getEventBrocker().addLocalTrigger(new YourModelChangeTrigger))
with a NotificationFilter that is limited to diagram element coordinates
update. The modification itself should be on a GMF element "Location" or
"LayoutConstraint".
In your ModelChangeTrigger, you will be able to add the code that update
your annotations in the method localChangesAboutToCommit.

The information about the displaying the grid and its size is a GMF
information that should be stored in the preferences of the
workspace/project. I will look for it as soon as I can.

Regards,
Steve

Le 21/01/2016 15:03, Stefano Cottafavi a écrit :
> Hi Steve,
> I've implemented my layout provider in which I drill down into the
> annotations of my model to get the location of the diagram nodes and
> create the commands to move them.
> I've two questions:
> - how can I persist the the annotations back from the diagram to the
> model once a view has been moved manually by an user?
> - I have graphical annotation for example for the grid size that I want
> to get from my model and assign it to the diagram.Can I do it from the
> same layout provider? on which diagram element these information have to
> be set?
>
> thanks for your help.
>
> cheers,
> stef


--
Steve Monnier - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Node position and size based on semantic model [message #1729902 is a reply to message #1721027] Wed, 20 April 2016 07:55 Go to previous messageGo to next message
Martin Jedlicka is currently offline Martin JedlickaFriend
Messages: 122
Registered: January 2016
Senior Member
Hi Stefano,

I want to implement a custom layout provider that does exactly what you describe, but I do not know how.
Could you please help me advise how to implement a custom layout provider, where I set the location of the nodes?

Thank you so much.

Martin
Re: Node position and size based on semantic model [message #1730204 is a reply to message #1729902] Fri, 22 April 2016 10:09 Go to previous message
Rahul Bhogavkar is currently offline Rahul BhogavkarFriend
Messages: 13
Registered: April 2016
Junior Member
Hello Guys,
I'm also facing the same problem to set the location of the nodes can you paste the solution for the same.
Previous Topic:Bread Crumb For Diagram Editor
Next Topic:Adding Button on toolbar of diagram editor
Goto Forum:
  


Current Time: Fri Apr 26 00:17:48 GMT 2024

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

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

Back to the top