com.doffman.dragarea
Class DragEvent

java.lang.Object
  extended by com.doffman.dragarea.DragEvent

public class DragEvent
extends java.lang.Object

Encapsulates all information regarding a Drag and Drop operation. The getAction method returns the type of drag event. Drag events are sent to all listeners when a drag event is started or ended. Otherwise events are only sent to relevant listeners. Events are sent selectively when: A drag operation moves inside a view. A drag operation leaves the bounds of a view. A drop operaton occurs inside the bounds of a view. Movement occurs inside the bounds of a view.


Field Summary
static int ACTION_DRAG_ENDED
          The drag operation has ended and not been dropped on the associated view
static int ACTION_DRAG_ENTERED
          The the Drag operation has entered the bounds of the associated view
static int ACTION_DRAG_EXITED
          The the Drag operation has exited the bounds of the associated view
static int ACTION_DRAG_LOCATION
          Drag location has moved
static int ACTION_DRAG_STARTED
          Drag operation has started
static int ACTION_DROP
          The object has been dropped on this listener
 
Constructor Summary
DragEvent(Bundle data, int action, int x, int y)
          Create a DragEvent.
 
Method Summary
 int getAction()
          Get the type of drag event.
 Bundle getBundle()
          Get the information associated with this drag and drop operation.
 int getX()
          Get the horizontal location of the current touch point (Relative to associated view).
 int getY()
          Get the vertical location of the current touch point (Relative to associated view).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTION_DRAG_STARTED

public static final int ACTION_DRAG_STARTED
Drag operation has started

See Also:
Constant Field Values

ACTION_DRAG_LOCATION

public static final int ACTION_DRAG_LOCATION
Drag location has moved

See Also:
Constant Field Values

ACTION_DROP

public static final int ACTION_DROP
The object has been dropped on this listener

See Also:
Constant Field Values

ACTION_DRAG_ENDED

public static final int ACTION_DRAG_ENDED
The drag operation has ended and not been dropped on the associated view

See Also:
Constant Field Values

ACTION_DRAG_ENTERED

public static final int ACTION_DRAG_ENTERED
The the Drag operation has entered the bounds of the associated view

See Also:
Constant Field Values

ACTION_DRAG_EXITED

public static final int ACTION_DRAG_EXITED
The the Drag operation has exited the bounds of the associated view

See Also:
Constant Field Values
Constructor Detail

DragEvent

public DragEvent(Bundle data,
                 int action,
                 int x,
                 int y)
Create a DragEvent.

Parameters:
data - The information to pass in the drag event.
action - The type of drag event.
x - The horizontal location of the current touch point. (Relative to associated view)
y - The vertical location of the current touch point. (Relative to associated view)
Method Detail

getBundle

public Bundle getBundle()
Get the information associated with this drag and drop operation.


getAction

public int getAction()
Get the type of drag event. One of: ACTION_DRAG_STARTED ACTION_DRAG_LOCATION ACTION_DROP ACTION_DRAG_ENDED ACTION_DRAG_ENTERED ACTION_DRAG_EXITED


getX

public int getX()
Get the horizontal location of the current touch point (Relative to associated view).


getY

public int getY()
Get the vertical location of the current touch point (Relative to associated view).