IDragDropDriver Interface
- public interface IDragDropDriver
-
All Known Implementing Classes
-
DefaultDragDropDriver
public static interface | IDragDropDriver.IDragSourceInfo
This interface allows a drag source to return the set of information needed to start a drag operation |
public void |
-
dragComplete (Transferable t, boolean success, int action, Component c)
- Called on the source of a drag and drop when the drag operation is completed.
|
public void |
-
dragExit (Component c)
- Called on the drop target when a drag and drop operation is cancelled because the
cursor has left the component.
|
public int |
-
dragOver (IDragDropContext dc)
- Called during drag and drop to update the visual feedback for the drag operation
The transfer driver should use available information to determine whether a
drop is possible, and if so, what action it would be.
|
public boolean |
-
drop (IDragDropContext dc)
- Causes a transfer to the component of a Transferable.
|
public IDragDropDriver.IDragSourceInfo |
-
getDragInfo (Component c, Point pt)
- Creates a
Transferable to use as the source for
a drag and drop operation.
|
dragComplete(Transferable, boolean, int, Component) Method
public void dragComplete(Transferable
t,
boolean success,
int action,
Component
c)
Called on the source of a drag and drop when the drag operation is completed. This should
be used to handle any results based on the type of action, or cleanup any visual changes
due to the start of a drag and drop.
Parameters
-
t
- Transferable that was used in the transfer
-
success
- Boolean value indicating whether or not the drop completed successfully
-
action
- DnDConstants integer value indicating the type of action the drop represented
-
c
- Component that was the source of the drag and drop
dragExit(Component) Method
public void dragExit(Component
c)
Called on the drop target when a drag and drop operation is cancelled because the
cursor has left the component. This may be used to clean up any visual state created during
drag()
Parameters
-
c
- the component for which the drag is cancelled
dragOver(IDragDropContext) Method
public int dragOver(IDragDropContext
dc)
Called during drag and drop to update the visual feedback for the drag operation
The transfer driver should use available information to determine whether a
drop is possible, and if so, what action it would be.
Parameters
-
dc
- the drag context object to use in determining the action for a drop
Returns
- DnDConstants.ACTION_NONE if a drop cannot be done at the current location
otherwise, the action that will be performed given a drop at the current location
drop(IDragDropContext) Method
public boolean drop(IDragDropContext
dc)
Causes a transfer to the component of a Transferable.
Parameters
-
dc
- the drop context object to use in determining the information for the drop
Returns
- true if the transfer completes successfully, false otherwise
getDragInfo(Component, Point) Method
public IDragDropDriver.IDragSourceInfo
getDragInfo(Component
c,
Point
pt)
Creates a Transferable
to use as the source for
a drag and drop operation. Returns the representation of the data to
be transferred.
Parameters
-
c
- Component where the drag is starting
-
pt
- Point representing the start of the drag
Returns
- interface to a drag source information object or null if drag is not valid