com.samskivert.swing.dnd
Interface DragSource


public interface DragSource

A drag source is associated with a component and represents a valid place to start a drag and drop operation.


Method Summary
 boolean checkDrop(DropTarget target)
          Is the drop target an acceptable one?
 void dragCompleted(DropTarget target)
          A callback to let the source know that the drop completed successfully.
 boolean startDrag(Cursor[] cursors, Object[] data)
          Called by the DnDManager to verify that a drag may begin at this source.
 

Method Detail

startDrag

boolean startDrag(Cursor[] cursors,
                  Object[] data)
Called by the DnDManager to verify that a drag may begin at this source.

Parameters:
cursors - a two-element array- the first element should contain the cursor to use for valid drops, the second for invalid drops. Either or both may be left blank to use the default DnD cursors.
data - a single-element array that should be filled in with the data that will be sent to a DropTarget if there is a successful drop.
Returns:
true if the drag may begin.

checkDrop

boolean checkDrop(DropTarget target)
Is the drop target an acceptable one? Called prior to calling the DropTarget's checkDrop.

Parameters:
target - a potential DropTarget.

dragCompleted

void dragCompleted(DropTarget target)
A callback to let the source know that the drop completed successfully.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.