|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The DropTargetListener
interface
is the callback interface used by the
DropTarget
class to provide
notification of DnD operations that involve
the subject DropTarget
. Methods of
this interface may be implemented to provide
"drag under" visual feedback to the user throughout
the Drag and Drop operation.
Method Summary | |
void |
dragEnter(DropTargetDragEvent dtde)
Called when a drag operation has encountered the DropTarget . |
void |
dragExit(DropTargetEvent dte)
The drag operation has departed the DropTarget without dropping. |
void |
dragOver(DropTargetDragEvent dtde)
Called when a drag operation is ongoing on the DropTarget . |
void |
drop(DropTargetDropEvent dtde)
The drag operation has terminated with a drop on this DropTarget . |
void |
dropActionChanged(DropTargetDragEvent dtde)
Called if the user has modified the current drop gesture. |
Method Detail |
public void dragEnter(DropTargetDragEvent dtde)
DropTarget
.
dtde
- the DropTargetDragEvent
public void dragOver(DropTargetDragEvent dtde)
DropTarget
.
dtde
- the DropTargetDragEvent
public void dropActionChanged(DropTargetDragEvent dtde)
dtde
- the DropTargetDragEvent
public void dragExit(DropTargetEvent dte)
DropTarget
without dropping.
dte
- the DropTargetEvent
public void drop(DropTargetDropEvent dtde)
DropTarget
.
This method is responsible for undertaking
the transfer of the data associated with the
gesture. The DropTargetDropEvent
provides a means to obtain a Transferable
object that represents the data object(s) to
be transfered.
From this method, the DropTargetListener
shall accept or reject the drop via the
acceptDrop(int dropAction) or rejectDrop() methods of the
DropTargetDropEvent
parameter.
Subsequent to acceptDrop(), but not before,
DropTargetDropEvent
's getTransferable()
method may be invoked, and data transfer may be
performed via the returned Transferable
's
getTransferData() method.
At the completion of a drop, an implementation
of this method is required to signal the success/failure
of the drop by passing an appropriate
boolean
to the DropTargetDropEvent
's
dropComplete(boolean success) method.
Note: The actual processing of the data transfer is not required to finish before this method returns. It may be deferred until later.
dtde
- the DropTargetDropEvent
|
JavaTM 2 Platform Standard Edition |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |