Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Problem with Affixed Parent Side
Problem with Affixed Parent Side [message #236159] Wed, 15 July 2009 08:34 Go to next message
Daniel is currently offline DanielFriend
Messages: 19
Registered: July 2009
Junior Member
Hello,

I'm developing an application, and the operator will have to create an
object A (a rectangle) and automatically two child objects B and C will be
created (two ellipse).

For that I use Feature Seq Initializer which works as expected.

The problem is that, how can I get the child object B at the north of the
object A and the child object B at the South of the object A.

I've tried the property Affixed Parent Side with almost all the
possibilities (NORTH, SOUTH, etc...) and it still put the object at the
West and South.

How can I get that?
And moreover, is it possible to fix the positions, I mean, I don't want
the operator to be able to move object B and C.

Thanks
Re: Problem with Affixed Parent Side [message #236488 is a reply to message #236159] Mon, 20 July 2009 12:06 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Daniel,

> How can I get that?
Looks like you have to modify ViewCreation logic to create appropriate views
for child elements with appropriate positions. See CreationEditPolicy.getCreateCommand().

> And moreover, is it possible to fix the positions, I mean, I don't
> want
> the operator to be able to move object B and C.
You have to remove (or not install) EditPolicy.PRIMARY_DRAG_ROLE EditPolicy
for such a children. Usually this EditPolicy will be installed by parent
EditPart's EditPolicy.LAYOUT_ROLE EditPolicy (see createChildEditPolicy()
method).

-----------------
Alex Shatalin
Re: Problem with Affixed Parent Side [message #237047 is a reply to message #236488] Tue, 21 July 2009 09:23 Go to previous message
Daniel is currently offline DanielFriend
Messages: 19
Registered: July 2009
Junior Member
Thanks for helping

Sorry but I really don't find how to.

>> How can I get that?
> Looks like you have to modify ViewCreation logic to create appropriate views
> for child elements with appropriate positions. See
CreationEditPolicy.getCreateCommand().


Moreover the children are created automatically, and when I create them
manually, they don't go to the same side.



Another method to prevent operator from moving object is to override the
method "getDragTracker" in the EditPart of the children


@Override
public DragTracker getDragTracker(Request request) {
return getParent().getDragTracker(request);
}

this method will drag the Parent in place of the children

I hope it helps anybody

>> And moreover, is it possible to fix the positions, I mean, I don't
>> want
>> the operator to be able to move object B and C.
> You have to remove (or not install) EditPolicy.PRIMARY_DRAG_ROLE EditPolicy
> for such a children. Usually this EditPolicy will be installed by parent
> EditPart's EditPolicy.LAYOUT_ROLE EditPolicy (see createChildEditPolicy()
> method).

> -----------------
> Alex Shatalin


Daniel
Previous Topic:Accessing the GenModel nsUri
Next Topic:Auto Arranging
Goto Forum:
  


Current Time: Wed Apr 01 02:50:56 GMT 2020

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

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

Back to the top