Once you recognize a drag gesture, you can start an actual
drag. The drag source receives many of the same types of events as the
drop target. Like a drop target, a drag source has a native peer in the
form of a
receives events as the user drags his object over the source and finally
drops it on a drop target. As shown in Figure 24-5, the class diagram for
the Drag API is similar to that of the Drop API.
Figure 24-5. Class diagram of DnD’s drag side
the flip side of
provides support for creating draggable information. Recall from the
beginning of this chapter that unlike the
DropTarget class, a regular GUI component is
not used as a base. Rather, the base component for starting a drag is
encapsulated in the
DragGestureRecognizer. The recognizer can in
turn start a drag for the
DragSource class encompasses the context of
the drag and provides a focal point for maintaining the visual state
of the drag. For example, several predefined cursors that you can use
during the drag operation are built into this class.
DragSource class has
only three properties, two of which are static and apply to the
overall DnD system. These properties are shown in Table 24-14.
Table 24-14. DragSource properties