Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Draw location for new nodes
Draw location for new nodes [message #1711172] Tue, 13 October 2015 17:38 Go to next message
Bailey Trenton is currently offline Bailey TrentonFriend
Messages: 31
Registered: May 2015
Member
Hello,
I have a border node that when double-clicked creates a new node in the model and on the diagram. I would like that new node to be drawn right next to the doubled clicked border node but not attached to it. Currently it draws the new node in the upper left corner of the diagram.

Am I able to control where the new node gets drawn? If so, how would I go about doing that?

Thank you,
Bailey

[Updated on: Tue, 13 October 2015 17:39]

Report message to a moderator

Re: Draw location for new nodes [message #1711738 is a reply to message #1711172] Mon, 19 October 2015 13:21 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 505
Registered: May 2011
Senior Member
Hello,

After the new node creation, you should update its coordinates (using
the GMF node element) by updating its bounds (getLayoutConstraint() method).

Regards,
Steve

Le 13/10/2015 19:38, Bailey Trenton a écrit :
> Hello,
> I have a border node that when double-clicked creates a new node in
> the model. I would like that new node to be drawn right next to the
> doubled clicked border node but not attached to it. Currently it draws
> the new node in the upper left corner of the diagram.
> Am I able to control where the new node gets drawn? If so, how would I
> go about doing that?
>
> Thank you,
> Bailey


--
Steve Monnier - Obeo

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


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Draw location for new nodes [message #1711770 is a reply to message #1711738] Mon, 19 October 2015 14:41 Go to previous messageGo to next message
Bailey Trenton is currently offline Bailey TrentonFriend
Messages: 31
Registered: May 2015
Member
Hello Steve,
So there is no way to set the location before it is drawn on the Sirius Diagram? I can only move it after it is drawn?

Also where would I do the updating? Are there a node creation listener in Sirius?

Thanks,
Bailey
Re: Draw location for new nodes [message #1711791 is a reply to message #1711770] Mon, 19 October 2015 17:03 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 505
Registered: May 2011
Senior Member
Hello,

In fact when I was saying after the node creation, I was thinking into
the same tool/service that creates the node, not a different action. You
should give it a try, because I am not entirely sure that this is not
too soon for the Sirius refresh.

For the node creation listener, you can add a ModelChangeTrigger that
would react on node creation.

Another way, but a little bit overkill, would be to implement a specific
layout using this tutorial:
https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom-arrange-all.html

Regards,
Steve

Le 19/10/2015 16:41, Bailey Trenton a écrit :
> Hello Steve,
> So there is no way to set the location before it is drawn on the
> Sirius Diagram? I can only move it after it is drawn?
> Also where would I do the updating? Are there a node creation listener
> in Sirius?
>
> Thanks,
> Bailey


--
Steve Monnier - Obeo

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


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:How to change property of object with tool
Next Topic:Duplicate sublines in cross table
Goto Forum:
  


Current Time: Tue Jan 26 13:34:31 GMT 2021

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

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

Back to the top