Draw location for new nodes [message #1711172] |
Tue, 13 October 2015 17:38 |
Bailey Trenton 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 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Draw location for new nodes [message #1711791 is a reply to message #1711770] |
Mon, 19 October 2015 17:03 |
|
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 Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
Powered by
FUDForum. Page generated in 0.02526 seconds