Drag/drop cursors

Werner Lehmann lehmann at media-interactive.de
Fri Apr 26 02:29:01 PDT 2013

Hi Pavel,

actually I would prefer the cursors to show automatically. According to 
the MouseEvent JavaDoc there are 3 different drag/drop modes:

1. Simple press drag and release.
2. Full press drag and release.
3. Platform-supported drag-and-drop.

I am using the 1st for node move/resize. Here I change the cursor to one 
of the *_SIZE cursors. Cursor mapping is incorrect on Mac but that is a 
known and Lombard-fixed bug - other than that it works fine.

To drag a node from a toolbar into a workspace I would go with the 2nd 
mode (startFullDrag in onDragDetected). This one does not change the 
cursor automatically, and this is what I am asking about.

The third mode does change the cursor but it seems a bit inappropriate 
for node drags within the same scene.

Maybe I am missing a step? The tutorial [1] is about platform drag/drop 
only... Also, a drag-image would be nice but that seems to exist for 
platfrom drag/drop only, in Lombard only (except for a workaound like 
[2] which also does not solve the cursor deny/copy/move/link problem).


[1] http://docs.oracle.com/javafx/2/drag_drop/jfxpub-drag_drop.htm

On 25.04.2013 17:36, Pavel Safrata wrote:
> Hi Werner,
> the cursors you mention should appear automatically during drag-and-drop
> operation. I think they should not be used manually elsewhere  because
> they are visually informing user about an ongoing drag-and-drop
> operation and using them at different times would be confusing. During a
> drag-and-drop operation the system is in a special mode with inner event
> loop, temporarily holding the dragged data, blocking many other
> features, and the well-known cursors make this clear to the user.
> If the cursors don't work for you during DnD, please file a bug. If you
> still think you need the cursors for your mouse events (which I tried to
> explain is a discouraged pattern), you can file feature request and see
> if it is approved (and even technically possible on all platforms).
> Thanks,
> Pavel
> On 25.4.2013 17:08, Werner Lehmann wrote:
>> Hi,
>> I am missing typical cursors during drag/drop, e.g. a deny, add, move,
>> link cursor. Apparently those are not supported in
>> javafx.scene.Cursor. How would this be solved in a
>> platform-independent way?
>> Best option currently seems to be: use the default cursor, and show
>> some tooltip/popup or unmanaged node below the cursor position to
>> indicate the drop effect to the user. Not really optimal...
>> I could also use my own drag cursors but they would not fit into all
>> sets of cursors on the supported platforms. If there was at least a
>> way to get an image of the default cursor - then it could be
>> "enhanced" with a small overlay. But that does not seem feasible either.
>> Werner

More information about the openjfx-dev mailing list