How to attach a moveble label to a connection [message #18132] |
Tue, 27 August 2002 11:28  |
Eclipse User |
|
|
|
Originally posted by: asmv.free.fr
Hi all,
I'm looking for a solution to attach a "Label" figure to a connection and
the user should enable to move the label where they want. Of course, the
connection stays the parent of label and the label coordination must be
relative to the connection. I succeeded to attach the label to connection.
But when I move the label, it changes its parent to root figure instead of
the connection or connection's child. In my case, the connection has a
child, which contains the label. It seems to me that GEF never take the
label container as a "graphical container" even following policies are
declared:
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, ...);
installEditPolicy(EditPolicy.CONTAINER_ROLE, ...);
installEditPolicy(EditPolicy.LAYOUT_ROLE, ...);
Do you have any ideas ? Do I reach the GEF limitation ?
Thanks
Julien
|
|
|
Re: How to attach a moveble label to a connection [message #20162 is a reply to message #18132] |
Mon, 23 September 2002 22:16  |
Eclipse User |
|
|
|
Originally posted by: hudsonr.us.eye-bee-em.com
It sounds like what you need is a DragTracker which doesn't allow a reparent
to occur.
What about overriding updateTargetUnderMouse() to just make sure the target
is always the label's parent (the connectionEditPart).
That way the tool will always be performing a move, and it will always talk
to the connection.
"Julien" <asmv@free.fr> wrote in message news:akg5qn$f06$1@rogue.oti.com...
> Hi all,
>
> I'm looking for a solution to attach a "Label" figure to a connection and
> the user should enable to move the label where they want. Of course, the
> connection stays the parent of label and the label coordination must be
> relative to the connection. I succeeded to attach the label to connection.
> But when I move the label, it changes its parent to root figure instead of
> the connection or connection's child. In my case, the connection has a
> child, which contains the label. It seems to me that GEF never take the
> label container as a "graphical container" even following policies are
> declared:
> installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, ...);
> installEditPolicy(EditPolicy.CONTAINER_ROLE, ...);
> installEditPolicy(EditPolicy.LAYOUT_ROLE, ...);
>
> Do you have any ideas ? Do I reach the GEF limitation ?
Never :-)
.....to the second question
>
> Thanks
> Julien
>
|
|
|
Powered by
FUDForum. Page generated in 0.27318 seconds