Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to stop child movement on parent Editpart Resize(WEST, NORTH)?
How to stop child movement on parent Editpart Resize(WEST, NORTH)? [message #214056] Mon, 22 December 2008 10:27 Go to next message
Nagesh is currently offline NageshFriend
Messages: 55
Registered: July 2009
Member
Hello,

I have a parent editpart 'A' and inside it A's compartment and inside this
compartment I have a child editpart 'B'. When I resize the 'A' editpart on
NORTH or WEST direction, the child 'B' also moving along with the
direction of resize. For opposite directions SOUTH or EAST, child 'B' is
not moving. How can I stop moving this child 'B' on parent resize?. Is
this because of compartment problem?. Is there any policies available?.

Thanks In Advance,
Nagesh Y.J.
Re: How to stop child movement on parent Editpart Resize(WEST, NORTH)? [message #214080 is a reply to message #214056] Mon, 22 December 2008 11:56 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Nagesh,

I think child elements are positioned inside a compartment in a relative
coordinates.
So, to solve this problem you have to use absolute coordinates (modify generated
code manually). BTW, are you using list compartment or non-list one?

-----------------
Alex Shatalin
Re: How to stop child movement on parent Editpart Resize(WEST, NORTH)? [message #214109 is a reply to message #214080] Tue, 23 December 2008 09:17 Go to previous messageGo to next message
Nagesh is currently offline NageshFriend
Messages: 55
Registered: July 2009
Member
Hello Alex,

We are using non-list one. Please provide me information of where to
change the relative to absolute coordinates?.

Thanks In Advance,
-Nagesh

Alex Shatalin wrote:

> Hello Nagesh,

> I think child elements are positioned inside a compartment in a relative
> coordinates.
> So, to solve this problem you have to use absolute coordinates (modify
generated
> code manually). BTW, are you using list compartment or non-list one?

> -----------------
> Alex Shatalin
Re: How to stop child movement on parent Editpart Resize(WEST, NORTH)? [message #214117 is a reply to message #214109] Tue, 23 December 2008 11:41 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Nagesh,

> We are using non-list one. Please provide me information of where to
> change the relative to absolute coordinates?.
You have to:
1. Modify LayoutEditpolicy (XYLayoutEditPolicy) created inside createlayoutEditPolicy()
method of the EditPart representing parent node to use absolute coordinates
in SetBoundsCommand.
2. Modify refreshBounds() method of the EditPart representing parent node
to properly set layout constraints for the child node.

It can happen that instead of parent node EditPart you have to modify compartment
EditPart on both steps - I'm not sure about that since i did not try this
very steps by myself.

-----------------
Alex Shatalin
Previous Topic:multiple diagrams and a shared model
Next Topic:how to avoid dragging out from compartment
Goto Forum:
  


Current Time: Fri Sep 20 06:16:13 GMT 2024

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

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

Back to the top