|
|
Re: How to move a figure [message #8139 is a reply to message #8109] |
Thu, 06 June 2002 14:40 |
Eclipse User |
|
|
|
Originally posted by: none.ibm.com
"Eric Bordeau" <ebordeau@us.ibm.com> wrote in message
news:adnq2q$apu$1@rogue.oti.com...
> You need to install a LayoutEditPolicy as the LAYOUT_ROLE on your
container
> EditPart. In the Logic example, the LogicContainerEditPart installs a
> LogicXYLayoutEditPolicy as the LAYOUT_ROLE. That EditPolicy implements
> createChildEditPolicy(EditPart), which returns the EditPolicy that will be
> installed on the children as the PRIMARY_DRAG_ROLE.
(Just adding some more info)
The container's layout determines how the children are dragged.
Specifically, XYLayout allows the children to be resized, whereas other
layouts don't allow this. You can ignore the details when trying to get
MOVE to work. REQ_MOVE_CHILDREN will get sent to your XYLayoutEditPolicy
subclass. You will need to implement the abstract methods in that
editpolicy to return the Commands necessary to move your model.
> > Hi
> > I'm creating an editpart that may contain other edit parts. i have a
> > canvas for the parent and i want ot allow the user to drag figures
within
> > the canvas to different locations. I can't figure out from the
> > documentation what kind of role and editpolicy are taking part in this
> > action. It looks like that the reqeust is REQ_MOVE_CHILDREN, but i'm not
> > sure.
> > thanks
> > yoav
|
|
|
Re: How to move a figure [message #8170 is a reply to message #8139] |
Thu, 06 June 2002 14:46 |
Eclipse User |
|
|
|
Originally posted by: none.ibm.com
> > You need to install a LayoutEditPolicy as the LAYOUT_ROLE on your
> container
> > EditPart. In the Logic example, the LogicContainerEditPart installs a
> > LogicXYLayoutEditPolicy as the LAYOUT_ROLE. That EditPolicy implements
> > createChildEditPolicy(EditPart), which returns the EditPolicy that will
be
> > installed on the children as the PRIMARY_DRAG_ROLE.
Oops. Eric is right, you need to return a new ResizableEditPolicy in
MyXYLayout#createChildEditPolicy(EditPart).
I just opened http://bugs.eclipse.org/bugs/show_bug.cgi?id=19492 because we
should be assuming that with XY layout you want to use a resizable policy,
which you could still override if you want.
|
|
|
Powered by
FUDForum. Page generated in 0.04117 seconds