Package docking.dnd
Class DragSrcAdapter
- java.lang.Object
-
- docking.dnd.DragSrcAdapter
-
- All Implemented Interfaces:
java.awt.dnd.DragSourceListener,java.util.EventListener
public class DragSrcAdapter extends java.lang.Object implements java.awt.dnd.DragSourceListenerAdapter 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
Fields Modifier and Type Field Description protected DraggabledragComponent
-
Constructor Summary
Constructors Constructor Description DragSrcAdapter(Draggable dragComponent)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddragDropEnd(java.awt.dnd.DragSourceDropEvent e)Called when the drag-drop operation completes.voiddragEnter(java.awt.dnd.DragSourceDragEvent e)Called as the hotspot enters a platform dependent drop site.voiddragExit(java.awt.dnd.DragSourceEvent e)Called as the hotspot exits a platform dependent drop site.voiddragOver(java.awt.dnd.DragSourceDragEvent e)Called as the hotspot moves over a platform dependent drop site.voiddropActionChanged(java.awt.dnd.DragSourceDragEvent e)Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.protected java.awt.CursorgetDropOkCursor(int action)Get the cursor for an "OK" drop.protected voidsetDragOverFeedback(java.awt.dnd.DragSourceDragEvent e)Sets the cursor according to the actions that are legal.
-
-
-
Field Detail
-
dragComponent
protected Draggable dragComponent
-
-
Constructor Detail
-
DragSrcAdapter
public DragSrcAdapter(Draggable dragComponent)
Constructor- Parameters:
dragComponent- component that can be dragged.
-
-
Method Detail
-
dragDropEnd
public void dragDropEnd(java.awt.dnd.DragSourceDropEvent e)
Called when the drag-drop operation completes. Calls the drag component's move() method if the action is a move operation.- Specified by:
dragDropEndin interfacejava.awt.dnd.DragSourceListener
-
dragEnter
public void dragEnter(java.awt.dnd.DragSourceDragEvent e)
Called as the hotspot enters a platform dependent drop site.- Specified by:
dragEnterin interfacejava.awt.dnd.DragSourceListener
-
dragOver
public void dragOver(java.awt.dnd.DragSourceDragEvent e)
Called as the hotspot moves over a platform dependent drop site.- Specified by:
dragOverin interfacejava.awt.dnd.DragSourceListener
-
dragExit
public void dragExit(java.awt.dnd.DragSourceEvent e)
Called as the hotspot exits a platform dependent drop site.- Specified by:
dragExitin interfacejava.awt.dnd.DragSourceListener
-
dropActionChanged
public void dropActionChanged(java.awt.dnd.DragSourceDragEvent e)
Drop action changed, i.e., ctrl key pressed during drag to change to a copy operation.- Specified by:
dropActionChangedin interfacejava.awt.dnd.DragSourceListener
-
setDragOverFeedback
protected void setDragOverFeedback(java.awt.dnd.DragSourceDragEvent e)
Sets the cursor according to the actions that are legal.
-
getDropOkCursor
protected java.awt.Cursor getDropOkCursor(int action)
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
-
-