Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Moving figures requires two steps??
Moving figures requires two steps?? [message #164144] Mon, 17 January 2005 12:30 Go to next message
Sean Neeley is currently offline Sean Neeley
Messages: 22
Registered: July 2009
Junior Member
In my GEF application, to move an IFigure, a user must first click on
the figure to select it, release the mouse, then click a second time to
drag. I experimented with the Logic example, and moving a figure can be
accomplished in one step, click and drag all at once. How do I make my
application work like the Logic example? I cannot figure out what I
have done differently. Does it have anything to do with the
DragTracker? In my implementation of AbstractGraphicalEditPart, I am
returning a DragEditPartsTracker in the getDragTracker(request) method.
Does anyone know where I should look?

Thanks,
- Sean
Re: Moving figures requires two steps?? [message #164384 is a reply to message #164144] Tue, 18 January 2005 13:43 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik Shah
Messages: 1077
Registered: July 2009
Senior Member
You shouldn't have to do anything for this to work (AbstractEditPart already
returns a DragEditPartsTracker in its getDragTracker() method).

My first guess is that you don't have a proper tool activated at that time.
Is the PanningSelectionTool your default tool? What should be happening is
that the event dispatcher should be forwarding the mouse down to the
SelectionTool (#mouseDown()), which in turn should be forwarding it to the
DragEditPartsTracker (#mousedown()) which selects the editpart you clicked
on in its handleButtonDown() method.

What happens when you just click on a previously unselected editpart and
start dragging? The part doesn't get selected?

"Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
news:csgsql$l9i$1@www.eclipse.org...
> In my GEF application, to move an IFigure, a user must first click on
> the figure to select it, release the mouse, then click a second time to
> drag. I experimented with the Logic example, and moving a figure can be
> accomplished in one step, click and drag all at once. How do I make my
> application work like the Logic example? I cannot figure out what I
> have done differently. Does it have anything to do with the
> DragTracker? In my implementation of AbstractGraphicalEditPart, I am
> returning a DragEditPartsTracker in the getDragTracker(request) method.
> Does anyone know where I should look?
>
> Thanks,
> - Sean
Re: Moving figures requires two steps?? [message #167621 is a reply to message #164384] Wed, 09 February 2005 16:49 Go to previous message
Sean Neeley is currently offline Sean Neeley
Messages: 22
Registered: July 2009
Junior Member
I am using SelectionTool, not PanningSelectionTool. I revisited this
today and figured out the problem. I have a SWT control outside of GEF
which always has focus. If it loses focus, it steals it back. Anyway,
handleFocusLost() in SelectionTool was getting called during the
selection+drag process, which set the drag tracker to null... so by the
time mouseDrag was called in SelectionTool, I no longer had a valid drag
tracker. I fixed the problem by overriding handleFocusLost() to do nothing.

- Sean

Pratik Shah wrote:
> You shouldn't have to do anything for this to work (AbstractEditPart already
> returns a DragEditPartsTracker in its getDragTracker() method).
>
> My first guess is that you don't have a proper tool activated at that time.
> Is the PanningSelectionTool your default tool? What should be happening is
> that the event dispatcher should be forwarding the mouse down to the
> SelectionTool (#mouseDown()), which in turn should be forwarding it to the
> DragEditPartsTracker (#mousedown()) which selects the editpart you clicked
> on in its handleButtonDown() method.
>
> What happens when you just click on a previously unselected editpart and
> start dragging? The part doesn't get selected?
>
> "Sean Neeley" <sean.neeley@dbcsoftware.com> wrote in message
> news:csgsql$l9i$1@www.eclipse.org...
>
>>In my GEF application, to move an IFigure, a user must first click on
>>the figure to select it, release the mouse, then click a second time to
>>drag. I experimented with the Logic example, and moving a figure can be
>>accomplished in one step, click and drag all at once. How do I make my
>>application work like the Logic example? I cannot figure out what I
>>have done differently. Does it have anything to do with the
>>DragTracker? In my implementation of AbstractGraphicalEditPart, I am
>>returning a DragEditPartsTracker in the getDragTracker(request) method.
>> Does anyone know where I should look?
>>
>>Thanks,
>>- Sean
>
>
>
Previous Topic:Create a special figure
Next Topic:ConnectionRouter
Goto Forum:
  


Current Time: Thu Aug 28 03:21:55 EDT 2014

Powered by FUDForum. Page generated in 0.01914 seconds