CONTENTS | PREV | NEXT | Drag and Drop |
Drag and Drop is a direct manipulation gesture found in many Graphical User Interface systems that provides a mechanism to transfer information between entities associated with a presentation element in the GUI. Normally driven by the physical gesturing of a human user, Drag and Drop provides both a mechanism to enable feedback regarding the possible outcome of any subsequent data transfer to the user during navigation over the presentation elements in the GUI, and the facilities to provide for any subsequent data transfer.A typical Drag and Drop operation can be decomposed into the following states (not entirely sequentially):
- A DragSource comes into existence, associated with some presentation element (Component) in the GUI, and some potentially Transferable data.
- 1 or more DropTarget(s) come into/go out of existence, associated with presentation elements in the GUI (Components), potentially capable of consuming Transferable data.
- A human user gestures to initiate a Drag and Drop operation on a Component associated with a DragSource.
Note: Although the body of this document consistently refers to the stimulus for a drag and drop operation being a physical gesture by a human user this does not preclude a programmatically driven DnD operation given the appropriate implementation of a DragSource.
- The DragSource initiates the Drag and Drop operation on behalf of the user, perhaps animating the GUI Cursor and/or rendering an Image of the item(s) that are the subject of the operation.
- As the user gestures navigate over Components in the GUI associated with DropTarget(s), the DragSource receives notifications in order to provide "Drag Over" feedback effects, and the DropTarget(s) receive notifications in order to provide "Drag Under" feedback effects.
The gesture itself moves a logical cursor across the GUI hierarchy, intersecting the geometry of GUI Component(s), possibly resulting in the logical "Drag" cursor entering, crossing, and subsequently leaving Components associated DropTarget(s).The DragSource object manifests "Drag Over" feedback to the user, in the typical case by animating the GUI Cursor associated with the logical cursor.
DropTarget objects manifest "Drag Under" feedback to the user, in the typical case, by rendering animations into their associated GUI Component(s) under the GUI Cursor.
- The determination of the feedback effects, and the ultimate success or failure of the data transfer, should one occur, is parameterized as follows:
- By the transfer "operation": Copy, Move or Reference(link).
- By the intersection of the set of data types provided by the DragSource and the set of data types comprehensible by the DropTarget.
- When the user terminates the drag operation, normally resulting in a successful Drop, both the DragSource and DropTarget receive notifications that include, and result in the transfer of, the information associated with the DragSource via a Transferable object.
The remainder of this document details the proposed API changes to support this model.