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

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

Inherits java::awt::dnd::DragSourceListener, java::awt::dnd::DragSourceMotionListener, and java::awt::dnd::DragGestureListener.

List of all members.

Detailed Description

Provides simplified drag handling for a component. Usage:

 int actions = DnDConstants.MOVE_OR_COPY;
 Component component = ...;
 DragHandler handler = new DragHandler(component, actions);
NOTE: Fundamentally, the active action is determined by the drop handler in DropTargetDragEvent#acceptDrag, but often client code simply relies on DropTargetDragEvent#getDropAction.

Definition at line 98 of file DragHandler.java.

Public Member Functions

void dragDropEnd (DragSourceDropEvent e)
void dragEnter (DragSourceDragEvent e)
void dragExit (DragSourceEvent e)
void dragGestureRecognized (DragGestureEvent e)
void dragMouseMoved (DragSourceDragEvent e)
void dragOver (DragSourceDragEvent e)
void dropActionChanged (DragSourceDragEvent e)

Static Public Member Functions

static Transferable getTransferable (DropTargetEvent e)

Static Public Attributes

static final float DEFAULT_GHOST_ALPHA = 0.5f
static final Dimension MAX_GHOST_SIZE = new Dimension(250, 250)
static final int UNKNOWN_MODIFIERS = -1
static final Transferable UNKNOWN_TRANSFERABLE = null

Protected Member Functions

int adjustDropAction (DragSourceEvent ev)
boolean canDrag (DragGestureEvent e)
Image createDragImage (GraphicsConfiguration gc, Icon icon)
 DragHandler (Component dragSource, int actions)
void dragStarted (DragGestureEvent e)
int getAcceptableDropAction (int targetActions)
Cursor getCursorForAction (int actualAction)
Icon getDragIcon (DragGestureEvent e, Point srcOffset)
int getDropAction (DragSourceEvent ev)
abstract Transferable getTransferable (DragGestureEvent e)
Icon scaleDragIcon (Icon icon, Point imageOffset)
void setModifiers (int mods)
void updateCursor (DragSourceEvent ev)

Static Protected Attributes

static final int COPY = DnDConstants.ACTION_COPY
static final int LINK = DnDConstants.ACTION_LINK
static final int MOVE = DnDConstants.ACTION_MOVE
static final int NONE = DnDConstants.ACTION_NONE

Static Package Functions

static String actionString (int action)
static int getModifiers ()

Static Package Attributes

static final int COPY_MASK
static final int KEY_MASK
static final int LINK_MASK
static final int MOVE_MASK = InputEvent.SHIFT_DOWN_MASK
static final boolean OSX

Private Member Functions

void describe (String type, DragSourceEvent e)
void disableSwingDragSupport (Component comp)
Point getImageLocation (Point where)
int reduce (int actions)

Private Attributes

Component dragSource
boolean fixCursor = true
GhostedDragImage ghost
float ghostAlpha = DEFAULT_GHOST_ALPHA
Point imageOffset
String lastAction
Dimension maxGhostSize = MAX_GHOST_SIZE
boolean moved
int supportedActions

Static Private Attributes

static int modifiers = UNKNOWN_MODIFIERS
static Transferable transferable = UNKNOWN_TRANSFERABLE

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

Generated by  Doxygen 1.6.0   Back to index