| Problem with Affixed Parent Side [message #236159] |
Wed, 15 July 2009 04:34  |
Eclipse User |
|
|
|
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 #237047 is a reply to message #236488] |
Tue, 21 July 2009 05:23  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05923 seconds