Logo Search packages:      
Sourcecode: libjna-java version File versions  Download package

com::sun::jna::examples::dnd::DropHandler Class Reference

Inherits java::awt::dnd::DropTargetListener.

List of all members.


Detailed Description

Provides simplified drop handling for a component. Usage:

 int actions = DnDConstants.MOVE_OR_COPY;
 Component component = ...;
 DropHandler handler = new DropHandler(component, actions);
 

The method getDropAction(DropTargetEvent) follows these steps to determine the appropriate action (if any).

Override drop(DropTargetDropEvent, int) to handle the drop. You should invoke DropTargetDropEvent#dropComplete as soon as the Transferable data is obtained, to avoid making the DnD operation look suspended.

See also:
DragHandler
Author:
twall

Definition at line 88 of file DropHandler.java.


Public Member Functions

void dragEnter (DropTargetDragEvent e)
void dragExit (DropTargetEvent e)
void dragOver (DropTargetDragEvent e)
void drop (DropTargetDropEvent e)
void dropActionChanged (DropTargetDragEvent e)
 DropHandler (final Component c, int acceptedActions, DataFlavor[] acceptedFlavors, DropTargetPainter painter)
 DropHandler (final Component c, int acceptedActions, DataFlavor[] acceptedFlavors)
 DropHandler (Component c, int acceptedActions)
boolean isActive ()
void setActive (boolean active)

Protected Member Functions

int acceptOrReject (DropTargetDragEvent e)
boolean canDrop (DropTargetEvent e, int action, Point location)
abstract void drop (DropTargetDropEvent e, int action) throws UnsupportedFlavorException, IOException
int getDropAction (DropTargetEvent e, int currentAction, int sourceActions, int acceptedActions)
int getDropAction (DropTargetEvent e)
int getDropActionsForFlavors (DataFlavor[] dataFlavors)
DropTarget getDropTarget ()
boolean isSupported (DataFlavor[] flavors)
boolean modifiersActive (int dropAction)
void paintDropTarget (DropTargetEvent e, int action, Point location)

Private Member Functions

void describe (String type, DropTargetEvent e)

Private Attributes

int acceptedActions
List acceptedFlavors
boolean active = true
DropTarget dropTarget
String lastAction
DropTargetPainter painter

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index