Top Description Methods
com.sun.javafx.tk

public Interface TKDropTargetListener

Known Direct Implementers
javafx.scene.Scene.DropTargetListener
Imports
javafx.scene.input.TransferMode

Listens for drop target events on a TKScene.
The implementation of this interface uses the event objects' pointer position to determine if any nodes in the scene graph are to be notified of drag gesture events.

Todo

extend this interface to include dropActionChanged() notification

Method Summary

Modifier and TypeMethod and Description
public TransferMode

Returns:

transfer mode chosen by potential target
dragEnter
(double x, double y, double screenX, double screenY, TransferMode transferMode, TKClipboard dragboard)

Called during a drag gesture, when the mouse pointer enters the operable part of the Scene.

public void
dragExit(double x, double y, double screenX, double screenY)

Called during a drag gesture, when the mouse pointer exits the operable part of the Scene.

public TransferMode

Returns:

transfer mode chosen by potential target
dragOver
(double x, double y, double screenX, double screenY, TransferMode transferMode)

Called during a drag gesture, while the mouse pointer is still over (is moving over) the operable part of the Sceme.

public TransferMode

Returns:

transfer mode chosen by target
drop
(double x, double y, double screenX, double screenY, TransferMode transferMode)

Called when the drag gesture is being terminated with a drop on the operable part Scene.

Method Detail

dragEnterback to summary
public TransferMode dragEnter(double x, double y, double screenX, double screenY, TransferMode transferMode, TKClipboard dragboard)

Called during a drag gesture, when the mouse pointer enters the operable part of the Scene.

Returns:TransferMode

transfer mode chosen by potential target

dragExitback to summary
public void dragExit(double x, double y, double screenX, double screenY)

Called during a drag gesture, when the mouse pointer exits the operable part of the Scene.

dragOverback to summary
public TransferMode dragOver(double x, double y, double screenX, double screenY, TransferMode transferMode)

Called during a drag gesture, while the mouse pointer is still over (is moving over) the operable part of the Sceme.

Returns:TransferMode

transfer mode chosen by potential target

dropback to summary
public TransferMode drop(double x, double y, double screenX, double screenY, TransferMode transferMode)

Called when the drag gesture is being terminated with a drop on the operable part Scene.
This method is responsible for undertaking the transfer of the data associated with the gesture. The dropTargetDropEvent provides a means to obtain an object that represents the data object(s) to be transfered.
From this method, the implemenation needs to allow {javafx.scene.transfer.DragEvent#accept()} or {javafx.scene.transfer.DragEvent#reject()} to be called from a drop target node in the scene graph.
Subsequent to {javafx.scene.transfer.DragEvent#accept()}, the target node should retrieve the drag gesture's data via the {javafx.scene.transfer.DragEvent#dragboard}
At the completion of a drop, the target node is required to call {javafx.scene.transfer.DragEvent#dropComplete(boolean))}.

Note

The data transfer should be completed before the call to {javafx.scene.transfer.DragEvent#dropComplete(boolean))}. After that, the transfer of data can only succeed if the data transfer is local (within the same VM hosting the running JavaFX code).

Returns:TransferMode

transfer mode chosen by target