Package com.ms.object.dragdrop
 In this topic

*Methods

*Fields

 

Packages
  PreviousThis Package
Package com.ms.object.dragdrop   Previous This
Package

 


Interface DragSource

public interface DragSource
{
  // Fields
  public static final int CANCEL;
  public static final int CONTINUE;
  public static final int DEFAULT_ACTION;
  public static final int DROP;

  // Methods
  public Object queryDragCursor(int effect);
  public int queryDragStatus(int modifiers);
}

This interface defines constants and methods that can be used by the source object of a dragdrop data transfer session. This interface allows a source object to customize the behavior of a drag operation as it progresses.

The queryDragStatus method can be used to query the current drag status of a dragged object. Drag status depends on whether the source object is able to transfer data from its current location to the current location of the mouse.

The queryDragCursor method retrieves an appropriate cursor for the drag operation, depending on the drag status. The cursor for a drag operation that can transfer the object to the current location is different from a cursor that cannot transfer the object.

Methods

queryDragCursor

public Object queryDragCursor(int effect);

Retrieves the current effect image used by the cursor as it drags an object across windows and icons.

Return Value:

Returns a cursor object that reflects the specified effect.

ParameterDescription
effect The effect that the cursor provides an image for. This value can be one of the following drag effects:
CONTINUE, CANCEL, DROP, or DEFAULT_ACTION.

queryDragStatus

public int queryDragStatus(int modifiers);

Determines the current status of the drag operation.

Return Value:

Returns a drag status flag depending on the current status of the drag session. This value can be one or more of the following drag effects:
CONTINUE, CANCEL, DROP, or DEFAULT_ACTION.

ParameterDescription
modifiers A flag that indicates the drag modifier for the drag operation. It can be any one of the following drag modifiers:
LBUTTON, MBUTTON, RBUTTON,
CONTROL, SHIFT, or ALT.

Fields

CANCEL
A drag-effect flag that indicates the drag operation has been cancelled.
CONTINUE
A drag-effect flag that indicates the dragged object cannot be dropped, but can continue.
DEFAULT_ACTION
A drag-effect flag that indicates that the system will determine what to do.
DROP
A drag-effect flag that indicates the dragged object can be dropped at the current location.

upnrm.gif