接口 | 描述 |
---|---|
Autoscroll |
在DnD操作期间,用户可能希望将操作的主题放在用户当前不可见的可滚动GUI控件的区域上。
|
DragGestureListener |
用于接收拖动手势事件的侦听器界面。
|
DragSourceListener |
DragSourceListener 定义了用于跟踪用户手势状态的拖放操作的
DragSourceListener 的事件接口,并在拖放操作中向用户提供适当的“拖拽”反馈。
|
DragSourceMotionListener |
用于在拖动操作期间接收鼠标运动事件的侦听器界面。
|
DropTargetListener |
DropTargetListener 接口是
DropTarget 类使用的回调接口,用于提供涉及主题
DropTarget 的DnD操作的
DropTarget 。
|
类 | 描述 |
---|---|
DnDConstants |
此类包含表示由拖放操作执行的操作类型的常量值。
|
DragGestureEvent |
DragGestureEvent 被传递给
DragGestureListener 的dragGestureRecognized()方法,当特定的
DragGestureRecognizer 检测到正在跟踪的
Component 上发生平台依赖的拖动启动手势时。
|
DragGestureRecognizer |
DragGestureRecognizer 是一个用于指定与平台相关的监听器的抽象基类,可以与特定的Component相关
Component ,以便识别平台相关的拖动启动手势。
|
DragSource |
DragSource 是
DragSource 操作的实体,可用于多种情况:在该JVM的生命周期中每个JVM使用1个默认实例。
|
DragSourceAdapter |
用于接收拖动源事件的抽象适配器类。
|
DragSourceContext |
DragSourceContext 类负责管理拖放协议的发起方。
|
DragSourceDragEvent |
该
DragSourceDragEvent 从交付
DragSourceContextPeer ,通过
DragSourceContext ,到
DragSourceListener 与注册
DragSourceContext 和与其相关
DragSource 。
|
DragSourceDropEvent |
所述
DragSourceDropEvent 被从递送
DragSourceContextPeer ,经由
DragSourceContext 到
dragDropEnd 的方法
DragSourceListener 与注册小号
DragSourceContext 和与其相关联的
DragSource 。
|
DragSourceEvent |
这个类是
DragSourceDragEvent 和
DragSourceDropEvent 的基类。
|
DropTarget |
该
DropTarget 与相关
Component 时
Component 希望接受拖放操作期间下降。
|
DropTarget.DropTargetAutoScroller |
这个受保护的嵌套类实现自动滚动
|
DropTargetAdapter |
用于接收丢弃目标事件的抽象适配器类。
|
DropTargetContext |
甲
DropTargetContext 每当用拖放操作相关联的逻辑光标用的可见几何一致创建
Component 与相关联的
DropTarget 。
|
DropTargetDragEvent |
所述
DropTargetDragEvent 被输送到
DropTargetListener 经由其dragEnter事件()和的dragover()方法。
|
DropTargetDropEvent |
所述
DropTargetDropEvent 经由递送
DropTargetListener 降()方法。
|
DropTargetEvent |
DropTargetEvent 是
DropTargetDragEvent 和
DropTargetDropEvent 的基础类。
|
MouseDragGestureRecognizer |
DragGestureRecognizer 这个抽象子类定义了一个基于鼠标的手势的
DragGestureRecognizer 。
|
异常 | 描述 |
---|---|
InvalidDnDOperationException |
java.awt.dnd包中的各种方法抛出此异常。
|
This package defines the classes and interfaces necessary to perform Drag and Drop operations in Java. It defines classes for the drag-source and the drop-target, as well as events for transferring the data being dragged. This package also provides a means for giving visual feedback to the user throughout the duration of the Drag and Drop operation.
A typical Drag and Drop operation can be decomposed into the following states (not entirely sequentially):
DragSource
comes into existence, associated with some presentation element (Component
) in the GUI, to initiate a Drag and Drop of some potentially Transferable
data. DropTarget
(s) come into/go out of existence, associated with presentation elements in the GUI (Components), potentially capable of consuming Transferable
data types. DragGestureRecognizer
is obtained from the DragSource
and is associated with a Component
in order to track and identify any Drag initiating gesture by the user over the Component
. Component
, which the registered DragGestureRecognizer
detects, and notifies its DragGestureListener
of. Note: Although this API 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
. This package contains the abstract class MouseDragGestureRecognizer
for recognizing mouse device gestures. Other abstract subclasses may be provided by the platform to support other input devices or particular Component
class semantics.
DragGestureListener
causes the DragSource
to initiate 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. Component
(s) in the GUI with associated 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 based upon the operation(s) supported and the data type(s) involved. 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 Component
(s) and 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:
DragSource
and DropTarget
: Copy, Move or Reference(link). DragSource
and the set of data types comprehensible by the DropTarget
. DragSource
and DropTarget
receive notifications that include, and result in the type negotiation and transfer of, the information associated with the DragSource
via a Transferable
object. Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.