Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Moving a block container and its children NOT WORKING
Moving a block container and its children NOT WORKING [message #225620] Wed, 01 November 2006 01:05 Go to next message
Eclipse UserFriend
Originally posted by: vinhtran2004-eclipsezone.yahoo.com

Hi,
I have an GEF editor that draws a block container which has children in the box (boxes). I move the block container around and see the block container children move with it, but when I select a child box in block container, the selected and the other children are back to the original location. I believe the children locations don't update and I check it. My questions are:

How to get the x and y position when the parent box move?
Do I have to make the children x and y position relative to parent box?
Any suggestion? Thanks.

Vinh
Re: Moving a block container and its children NOT WORKING [message #225630 is a reply to message #225620] Wed, 01 November 2006 05:50 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
VINH TRAN 写道:
> Hi,
> I have an GEF editor that draws a block container which has children in the box (boxes). I move the block container around and see the block container children move with it, but when I select a child box in block container, the selected and the other children are back to the original location. I believe the children locations don't update and I check it. My questions are:
>
> How to get the x and y position when the parent box move?
> Do I have to make the children x and y position relative to parent box?
> Any suggestion? Thanks.
>
> Vinh
Hi,

Maybe there not a layout in block container box, if so, set it with a
layout manager.
If have layoutEditPolicy in editPart, can do
createChangeConstraintCommand in LayoutEditPolicy subclass, for example,
XYLayoutEditPolicy.
@Override
protected Command createChangeConstraintCommand(EditPart child,
Object constraint) {
Rectangle bounds = null;
if (constraint instanceof Rectangle) {
bounds = (Rectangle) constraint;
} else if (constraint instanceof Point) {
bounds = new Rectangle();
bounds.setLocation((Point) constraint);
}

....
}
this code answer question 1, if x, y location referred to child in the
question, if referred to parent self, so the code is in parent of parent
editpolicy.

when use layout, x, y of child are default ralative to parent figure.


Qinxian
Re: Moving a block container and its children NOT WORKING [message #225693 is a reply to message #225630] Wed, 01 November 2006 17:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vinhtran2004-eclipsezone.yahoo.com

Hi,

Do you know any source that I can read to know more about layout and GEF stuffs. I got the Red book but it help just a little. Thanks.

Vinh
Re: Moving a block container and its children NOT WORKING [message #225701 is a reply to message #225693] Wed, 01 November 2006 17:36 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: vinhtran2004-eclipsezone.yahoo.com

Hi Quinxian,

Thank for the help. I will check it.

Do you know any source that I can read to know more about layout and GEF stuffs. I got the Red book but it help just a little. Thanks.

Vinh
Re: Moving a block container and its children NOT WORKING [message #225757 is a reply to message #225701] Wed, 01 November 2006 23:17 Go to previous message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
VINH TRAN 写道:
> Hi Quinxian,
>
> Thank for the help. I will check it.
>
> Do you know any source that I can read to know more about layout and GEF stuffs. I got the Red book but it help just a little. Thanks.
>
> Vinh
Hi,
DMI.
Try to find in eclipsewiki.
http://wiki.eclipse.org/index.php/Graphical_Editing_Framewor k

Seem that there is little of stuffs.

Regards,

Qinxian
Previous Topic:Wavy line under Label
Next Topic:selecting multiple editParts in editor
Goto Forum:
  


Current Time: Mon Oct 25 17:04:52 GMT 2021

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

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

Back to the top