dsto.dfc.swing.dnd
Interface DragComponent

All Known Subinterfaces:
DragDropComponent
All Known Implementing Classes:
DfcTable, DfcTree, EditListView, LogMessageTable, MapTableView, StyleSheetTableView

public interface DragComponent

Defines a component that supports drag actions. Classes implementing this interface must also extend java.awt.Component. Classes that implement this interface may then use an instance of DragSourceAdapter to manage drag events via method calls to this interface.

Version:
$Revision$

Method Summary
 void endDrag(DragSourceDropEvent e, boolean moveData)
           
 int getSupportedDragActions()
          Return a mask of possible drag actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE.
 boolean isDragOK(DragGestureEvent e)
          Return true if starting a drag in the given context is possible.
 Transferable startDrag(DragGestureEvent e)
          Start a drag operation.
 

Method Detail

getSupportedDragActions

int getSupportedDragActions()
Return a mask of possible drag actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. Note that the component may veto any particular drag attempt from isDragOK(java.awt.dnd.DragGestureEvent).


isDragOK

boolean isDragOK(DragGestureEvent e)
Return true if starting a drag in the given context is possible.

Parameters:
e - The drag context.

startDrag

Transferable startDrag(DragGestureEvent e)
Start a drag operation.

Parameters:
e - The gesture that started the drag.
Returns:
The transferable data, or null if no data available.

endDrag

void endDrag(DragSourceDropEvent e,
             boolean moveData)


Copyright © 2008 Commonwealth of Australia