There exist two
Facets, shown in Figure 4.6, which support Drag and Drop
(DND). They simplify the work of developers by
shielding them from the complexities of the standard Java
DND code (
java.awt.dnd) while
still allowing them to expose DND functionality to
UI elements that are
DND-capable.
The
DnDTargetContainer
Facet provides the
behavior implemented when an object is displayed in some sort of
iconic form, and something is dropped onto it. While custom views may
provide more sophisticated DNDbehavior, simple
actions, like dropping a document onto a printer icon (to print it),
can be handled by this
Facet.
The DataTransfer
Facet of an object
provides a way for an object to publish the
Types into which it can
convert itself. This functionality is used in two main cases: (a) by
the DND subsystem, when the object is the source of
a drag operation; and (b) by "clipboard" operations like "cut", "copy"
and "paste".