Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Disabled cursor appearing on drag
Disabled cursor appearing on drag [message #181134] Thu, 12 May 2005 20:43 Go to next message
Eclipse UserFriend
Originally posted by: ndrew.thoughtworks.com

Hi - I'm trying to work out the best way of allowing small moves of a child
edit part with the mouse.

When I drag an edit part, and the mouse is still within the bounds of the
editpart figure, the DragEditPartsTracker is providing a disabled cursor. I
think this is due to the editpart figure being part of the exclusion list
for the trackers.

What's the best way of allowing the move?

Cheers
Re: Disabled cursor appearing on drag [message #181169 is a reply to message #181134] Fri, 13 May 2005 02:29 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
That's the drag threshold. To prevent mistaken dragging from affecting
anything, drag is only enabled once it goes past a certain threshold (five
pixels, I think). Look at AbstractTool#movedPastThreshold(). You can
override that method to change the threshold or ignore it completely.

"Nick Drew" <ndrew@thoughtworks.com> wrote in message
news:d60fmo$793$1@news.eclipse.org...
> Hi - I'm trying to work out the best way of allowing small moves of a
child
> edit part with the mouse.
>
> When I drag an edit part, and the mouse is still within the bounds of the
> editpart figure, the DragEditPartsTracker is providing a disabled cursor.
I
> think this is due to the editpart figure being part of the exclusion list
> for the trackers.
>
> What's the best way of allowing the move?
>
> Cheers
>
>
Re: Disabled cursor appearing on drag [message #181251 is a reply to message #181169] Fri, 13 May 2005 09:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ndrew.thoughtworks.com

Thanks Pratik

I don't think thats what is causing it, however.

I should have explained what I mean by small move...

If I click and drag, as soon as the cursor leaves the bounds of the original
edit part, the cursor changes from disabled (SharedCursors.NO) to a normal
drag move cursor. Upon moving the cursor back into the original editpart,
it switches back to the SharedCursors.NO.

So I can move my edit part a small way if I click, say, near the left
border of the part and drag left, but that isn't very intuitive.

I've understood only little bits of the big picture. As it turns out I've
just got it work by creating a subclass of DragEditPartsTracker for my child
editpart. This overrides the isMove operation. By default
DragEditPartsTracker.isMove() doesn't include the sourceEditPart as a move
target (it starts at the sourceEditPart's parent). In my impl it does
include the sourceedit part.

As I said, this gets the move to work, but it seems a little clunky.


"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d613v9$qbo$1@news.eclipse.org...
> That's the drag threshold. To prevent mistaken dragging from affecting
> anything, drag is only enabled once it goes past a certain threshold (five
> pixels, I think). Look at AbstractTool#movedPastThreshold(). You can
> override that method to change the threshold or ignore it completely.
>
> "Nick Drew" <ndrew@thoughtworks.com> wrote in message
> news:d60fmo$793$1@news.eclipse.org...
>> Hi - I'm trying to work out the best way of allowing small moves of a
> child
>> edit part with the mouse.
>>
>> When I drag an edit part, and the mouse is still within the bounds of the
>> editpart figure, the DragEditPartsTracker is providing a disabled cursor.
> I
>> think this is due to the editpart figure being part of the exclusion list
>> for the trackers.
>>
>> What's the best way of allowing the move?
>>
>> Cheers
>>
>>
>
>
Re: Disabled cursor appearing on drag [message #181607 is a reply to message #181251] Wed, 18 May 2005 02:34 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
That's weird. You shouldn't have to do that. In fact, doing what you
describe could cause the exact problem that you're trying to fix. That's
why it's surprising that it fixes that case for you. When dragging a part,
the source editpart cannot be the target because it doesn't contain itself
and can't be added to itself. As a result, the tool would then target any
other part that also contains that location (namely the source editpart's
parent part). Look at the Shapes example to see how this works.

"Nick Drew" <ndrew@thoughtworks.com> wrote in message
news:d61sa8$hc3$1@news.eclipse.org...
> Thanks Pratik
>
> I don't think thats what is causing it, however.
>
> I should have explained what I mean by small move...
>
> If I click and drag, as soon as the cursor leaves the bounds of the
> original edit part, the cursor changes from disabled (SharedCursors.NO) to
> a normal drag move cursor. Upon moving the cursor back into the original
> editpart, it switches back to the SharedCursors.NO.
>
> So I can move my edit part a small way if I click, say, near the left
> border of the part and drag left, but that isn't very intuitive.
>
> I've understood only little bits of the big picture. As it turns out I've
> just got it work by creating a subclass of DragEditPartsTracker for my
> child editpart. This overrides the isMove operation. By default
> DragEditPartsTracker.isMove() doesn't include the sourceEditPart as a move
> target (it starts at the sourceEditPart's parent). In my impl it does
> include the sourceedit part.
>
> As I said, this gets the move to work, but it seems a little clunky.
>
>
> "Pratik Shah" <ppshah@us.ibm.com> wrote in message
> news:d613v9$qbo$1@news.eclipse.org...
>> That's the drag threshold. To prevent mistaken dragging from affecting
>> anything, drag is only enabled once it goes past a certain threshold
>> (five
>> pixels, I think). Look at AbstractTool#movedPastThreshold(). You can
>> override that method to change the threshold or ignore it completely.
>>
>> "Nick Drew" <ndrew@thoughtworks.com> wrote in message
>> news:d60fmo$793$1@news.eclipse.org...
>>> Hi - I'm trying to work out the best way of allowing small moves of a
>> child
>>> edit part with the mouse.
>>>
>>> When I drag an edit part, and the mouse is still within the bounds of
>>> the
>>> editpart figure, the DragEditPartsTracker is providing a disabled
>>> cursor.
>> I
>>> think this is due to the editpart figure being part of the exclusion
>>> list
>>> for the trackers.
>>>
>>> What's the best way of allowing the move?
>>>
>>> Cheers
>>>
>>>
>>
>>
>
>
Previous Topic:Mixed model types in GEF
Next Topic:Property View and PropertyDescriptors
Goto Forum:
  


Current Time: Thu Sep 19 07:34:02 GMT 2024

Powered by FUDForum. Page generated in 0.04308 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top