Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » how to resize a container programatically based on the count of border nodes on the container
how to resize a container programatically based on the count of border nodes on the container [message #1796307] Wed, 10 October 2018 07:19 Go to next message
Sharmila D is currently offline Sharmila DFriend
Messages: 81
Registered: June 2018
Member
Hii

Please help me to solve this problem
Iam having container with border node.if I create so many border nodes on the container the nodes are overlapping. Based on the count of border nodes the container needs to be resized .How to do that programatically.
Re: how to resize a container programatically based on the count of border nodes on the container [message #1796312 is a reply to message #1796307] Wed, 10 October 2018 10:00 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Sharmila,

Does the arrange-all or the auto-size actions (or buttons in the tabbar) manually improve the situation ?
Do you want to do this automatically ? or manually ?

This will change the way you contribute your mecanism : a precommit listener or a ModelChangeTrigger or a menu/action.

Then you will have to look for the DNodeContainer matching your mapping and their GMF nodes to update their location constraints (Size/Bound : width and height). You might have to update the main node but also the compartment child.
You also might have to update the layout constraint of the border nodes : look in the children of the DNodeContainer.getOwnedBorderedNodes() for DNode matching your mapping(s), then retrieve the corresponding GMF Node and update their layoutConstraint (Location/Bounds: x, y). Note that you might also look for the BorderItemLocator and update it.

Regards


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: how to resize a container programatically based on the count of border nodes on the container [message #1796313 is a reply to message #1796307] Wed, 10 October 2018 10:01 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Sharmila,

Does the arrange-all or the auto-size actions (or buttons in the tabbar) manually improve the situation ?
Do you want to do this automatically ? or manually ?

This will change the way you contribute your mecanism : a precommit listener or a ModelChangeTrigger or a menu/action.

Then you will have to look for the DNodeContainer matching your mapping and their GMF nodes to update their location constraints (Size/Bound : width and height). You might have to update the main node but also the compartment child.
You also might have to update the layout constraint of the border nodes : look in the children of the DNodeContainer.getOwnedBorderedNodes() for DNode matching your mapping(s), then retrieve the corresponding GMF Node and update their layoutConstraint (Location/Bounds: x, y). Note that you might also look for the BorderItemLocator and update it.

Regards


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:changes to the metamodel
Next Topic:Question about Operation Action / Menu order
Goto Forum:
  


Current Time: Tue Jan 26 13:28:11 GMT 2021

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

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

Back to the top