|
Re: Move connection label [message #201987 is a reply to message #201971] |
Sat, 05 November 2005 03:33 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Felix L J Mayer wrote:
> I am trying to move a Label that is the child of a connection, so a added a
> XYLayoutPolicy to my ConnectionEditPart. But when I try to move the Label,
> the DragEditPartsTracker always thinks that the DiagramEditPart is the
> target and creates an orphan request. And when it has a command for those,
> it changes the request to an add request and wants a command from the
> DiagramEditPart.
>
> What am I doing wrong? Is there a way to tell the DragEditPartsTracker that
> the target is actually the owning connection?
>
>
I been intending to do this for a while now.static labels is kinda weak.
Anyway, is your Label a figure or an editpart? If you want to drag it
around seperately from the connectioneditPart then it will need to be
inside its own editpart. That will be my strategy anyway.
CL
|
|
|
|
|
Re: Move connection label [message #202239 is a reply to message #202183] |
Mon, 07 November 2005 22:03 |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Ahh, so you have an editpart that contains your Label, and that
LabelEditPart is the child of the ConnectionEditPart which in turn is a
child of the DiagramEditPart.
Great, thats what I planned to do.
As to your direct situation. Is your DiagramEditPart your drawing so to
speak? and your ConnectionEditPart is ontop of that?
I'm surprised its not working. I Can only imagine your problem is that
your LabelEditPart is not returning a command for the move request. Set
a breakpoint in the LabelEditParts getCommand(Request) method and see
why its not returning an appropriate command. Im my experience, unless
you specifically do something to stop it, the childmost editpart gets
first shot at the command. As long as it is still returning true for
isSelectable() since move first requires selection.
Make sure your LAYOUT_ROLE edit policy is creating a command to move
this child too. I am speaking of the policy in the ConnectionEditPart
since its containing the Label.
CL
Felix L J Mayer wrote:
> Yes, of course I need EditParts for anything that can be touched.
>
> I got it to work by overriding
> ConstrainedLayoutEditPolicy.createAddCommand() in my DiagramEditPart's
> XYLayoutPolicy and returning an empty command.
>
> But this looks a little like a hack to me, I am wondering if there is a
> better way to it.
>
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
> news:dkh95d$jdv$1@news.eclipse.org...
>
>>Felix L J Mayer wrote:
>>
>>>I am trying to move a Label that is the child of a connection, so a added
>>>a XYLayoutPolicy to my ConnectionEditPart. But when I try to move the
>>>Label, the DragEditPartsTracker always thinks that the DiagramEditPart is
>>>the target and creates an orphan request. And when it has a command for
>>>those, it changes the request to an add request and wants a command from
>>>the DiagramEditPart.
>>>
>>>What am I doing wrong? Is there a way to tell the DragEditPartsTracker
>>>that the target is actually the owning connection?
>>
>>I been intending to do this for a while now.static labels is kinda weak.
>>Anyway, is your Label a figure or an editpart? If you want to drag it
>>around seperately from the connectioneditPart then it will need to be
>>inside its own editpart. That will be my strategy anyway.
>>
>>
>>CL
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.04616 seconds