Determine nature of drag in createDragSourceFeedbackFigure [message #170712] |
Sun, 06 March 2005 19:16  |
Eclipse User |
|
|
|
I am overriding createDragSourceFeedbackFigure in my ResizableEditPolicy
so that I can add some features to the figure during drag. I don't want
those features during a resize operation. Is there a way to find out
what is causing the call?
As an aside, what causes the figure to change colour during the drag?
Anything I add to the feedback figure stays the same colour as I set it,
so if I use the same colours as the feedback figure they don't match.
Thanks,
Barry
|
|
|
|
|
Re: Determine nature of drag in createDragSourceFeedbackFigure [message #171082 is a reply to message #171028] |
Tue, 08 March 2005 22:43   |
Eclipse User |
|
|
|
All EditPolicies do is cater to requests. So, whenever something's
happening in an EditPolicy, there was some request that triggered it. In
your case, it's the resize or move request that is asking to show the
necessary feedback.
Select the method name, and hit Ctrl + Alt + H to bring up the call
hierarchy. You'll find showChangeBoundsFeedback() in
NonResizableEditPolicy.
The default feedback figures use XOR.
"Barry Lay" <blay@laysercomputing.com> wrote in message
news:d0l2k3$4nv$1@www.eclipse.org...
> Pratik Shah wrote:
> > You can query the ChangeBoundsRequest object to determine whether the
> > current operation is a move or resize. If the request has a resize
> > direction or size delta, then you know it's a resize request.
>
> How do I get the current Request? I don't have a reference to it (or
> much else) in the createDragSourceFeedbackFigure method.
>
> > I don't understand your second question.
>
> I tried to create my own sub-figures of the default from
> NonResizableEditPolicy with the same foreground and background colours
> as it has (white and black in the debugger). When I drag the figure the
> main rectangle is yellow but my figures remain white and black.
>
> Thanks,
> Barry
>
> > "Barry Lay" <blay@laysercomputing.com> wrote in message
> > news:d0g6hs$pr8$1@www.eclipse.org...
> >
> >>I am overriding createDragSourceFeedbackFigure in my ResizableEditPolicy
so
> >>that I can add some features to the figure during drag. I don't want
those
> >>features during a resize operation. Is there a way to find out what is
> >>causing the call?
> >>
> >>As an aside, what causes the figure to change colour during the drag?
> >>Anything I add to the feedback figure stays the same colour as I set it,
> >>so if I use the same colours as the feedback figure they don't match.
> >>
> >>Thanks,
> >>Barry
> >
> >
> >
|
|
|
Re: Determine nature of drag in createDragSourceFeedbackFigure [message #171117 is a reply to message #171082] |
Wed, 09 March 2005 01:52  |
Eclipse User |
|
|
|
Pratik Shah wrote:
> All EditPolicies do is cater to requests. So, whenever something's
> happening in an EditPolicy, there was some request that triggered it. In
> your case, it's the resize or move request that is asking to show the
> necessary feedback.
>
> Select the method name, and hit Ctrl + Alt + H to bring up the call
> hierarchy. You'll find showChangeBoundsFeedback() in
> NonResizableEditPolicy.
Yes, createDragSourceFeedbackFigure does get called the first time
showChangeBoundsFeedback is called and the latter method does have the
request as a parameter. I suppose that I can keep a local field around
so that I don't keep modifying the feedback figure every time the
feedback is updated for a drag (I am adding features to the original
figure that don't change once done). I have been wary of intercepting
the methods that are active during the drag operation for fear of
getting into timing problems.
Thanks again,
Barry
|
|
|
Powered by
FUDForum. Page generated in 0.04205 seconds