Package docking.dnd
Class DragSrcAdapter
java.lang.Object
docking.dnd.DragSrcAdapter
- All Implemented Interfaces:
DragSourceListener
,EventListener
Adapter class that receives notifications in order to
provide drag over effects.
When the operation ends, this class receives a
dragDropEnd
message, and is responsible for
checking the success of the operation. If the operation was
successful, and if it was a Move, then
this class will remove the source data.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when the drag-drop operation completes.void
Called as the hotspot enters a platform dependent drop site.void
Called as the hotspot exits a platform dependent drop site.void
Called as the hotspot moves over a platform dependent drop site.void
Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.protected Cursor
getDropOkCursor
(int action) Get the cursor for an "OK" drop.protected void
Sets the cursor according to the actions that are legal.
-
Field Details
-
dragComponent
-
-
Constructor Details
-
DragSrcAdapter
Constructor- Parameters:
dragComponent
- component that can be dragged.
-
-
Method Details
-
dragDropEnd
Called when the drag-drop operation completes. Calls the drag component's move() method if the action is a move operation.- Specified by:
dragDropEnd
in interfaceDragSourceListener
-
dragEnter
Called as the hotspot enters a platform dependent drop site.- Specified by:
dragEnter
in interfaceDragSourceListener
-
dragOver
Called as the hotspot moves over a platform dependent drop site.- Specified by:
dragOver
in interfaceDragSourceListener
-
dragExit
Called as the hotspot exits a platform dependent drop site.- Specified by:
dragExit
in interfaceDragSourceListener
-
dropActionChanged
Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.- Specified by:
dropActionChanged
in interfaceDragSourceListener
-
setDragOverFeedback
Sets the cursor according to the actions that are legal. -
getDropOkCursor
Get the cursor for an "OK" drop.- Parameters:
action
- action for the drag operation (copy, move, link)- Returns:
- cursor that is appropriate for the give action
-