public abstract class DragGestureRecognizer extends Object implements Serializable
DragGestureRecognizer是一个可以与一个特定的
Component为了识别依赖于平台的拖启动手势相关平台依赖的听众的规范抽象基类。
适当的DragGestureRecognizer子类的实例是从一个特定Component相关的DragSource获得,或从Toolkit对象通过其createDragGestureRecognizer()方法。
一旦DragGestureRecognizer是与一个特定的Component将登记相应的监听器接口以Component跟踪输入事件传递到Component相关。
一旦DragGestureRecognizer标识序列对Component事件拖累引发的姿态,它将通过调用其gestureRecognized()方法通知其单播DragGestureListener。
当混凝土DragGestureRecognizer实例检测拖启动手势在Component是相关联的,它发射一DragGestureEvent的DragGestureListener对DragGestureListener事件的单播事件源注册。这DragGestureListener是引起相关DragSource启动拖放操作(如适用)。
| Modifier and Type | Field and Description |
|---|---|
protected Component |
component
与此相关的
Component
DragGestureRecognizer。
|
protected DragGestureListener |
dragGestureListener
与此相关的
DragGestureListener
DragGestureRecognizer。
|
protected DragSource |
dragSource
与此相关的
DragSource
DragGestureRecognizer。
|
protected ArrayList<InputEvent> |
events
事件列表(按顺序),
DragGestureRecognizer“公认”为“手势”引发的阻力。
|
protected int |
sourceActions
代表类型的
int(S)行动(S)进行拖放操作。
|
| Modifier | Constructor and Description |
|---|---|
protected |
DragGestureRecognizer(DragSource ds)
构建一个新的
DragGestureRecognizer给予
DragSource用于拖放操作。
|
protected |
DragGestureRecognizer(DragSource ds, Component c)
构建一个新的
DragGestureRecognizer给予
DragSource用于拖放操作,和
Component这
DragGestureRecognizer应该“观察”拖动起始姿势。
|
protected |
DragGestureRecognizer(DragSource ds, Component c, int sa)
构建一个新的
DragGestureRecognizer给予
DragSource用于拖放操作,这
DragGestureRecognizer应该“观察”引发的
Component拖动手势,和行动(S)支持这个拖放操作。
|
protected |
DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
构建一个新的
DragGestureRecognizer给予
DragSource用于拖放操作,这
DragGestureRecognizer应该“观察”引发的
Component拖动手势,动作(S)这个拖放操作的支持,和
DragGestureListener通知一旦拖启动手势已经被发现。
|
| Modifier and Type | Method and Description |
|---|---|
void |
addDragGestureListener(DragGestureListener dgl)
登记一个新的
DragGestureListener。
|
protected void |
appendEvent(InputEvent awtie)
通过这个识别器的组件注册监听器应记录所有事件,是公认的事件,去组成一个拖放启动手势通过这个API的系列的一部分。
|
protected void |
fireDragGestureRecognized(int dragAction, Point p)
通知draggesturelistener发生拖放启动手势。
|
Component |
getComponent()
这个方法返回
Component是“观察”的
DragGestureRecognizer拖动起始姿势。
|
DragSource |
getDragSource()
这个方法返回
DragSource这
DragGestureRecognizer将用以处理拖放操作。
|
int |
getSourceActions()
此方法返回表示动作类型int()这个拖放操作支持。
|
InputEvent |
getTriggerEvent()
此方法返回启动拖放操作的事件序列中的第一个事件。
|
protected abstract void |
registerListeners()
登记本DragGestureRecognizer的听众与组件的子类必须重写此方法
|
void |
removeDragGestureListener(DragGestureListener dgl)
注销当前DragGestureListener
|
void |
resetRecognizer()
重置系统,如果其目前识别手势,忽略它。
|
void |
setComponent(Component c)
设置组件的draggesturerecognizer与registerlisteners()和unregisterlisteners()相关的被称为作为一个副作用是适当的。
|
void |
setSourceActions(int actions)
此方法设置此拖放操作的允许源拖放操作(S)。
|
protected abstract void |
unregisterListeners()
注销这DragGestureRecognizer的听众与组件的子类必须重写此方法
|
protected DragSource dragSource
DragSource
DragGestureRecognizer。
protected Component component
Component
DragGestureRecognizer。
protected transient DragGestureListener dragGestureListener
DragGestureListener
DragGestureRecognizer。
protected int sourceActions
int(S)行动(S)进行拖放操作。
protected ArrayList<InputEvent> events
DragGestureRecognizer“公认”为“手势”引发的阻力。
protected DragGestureRecognizer(DragSource ds, Component c, int sa, DragGestureListener dgl)
DragGestureRecognizer给予
DragSource用于拖放操作,这
DragGestureRecognizer应该“观察”引发的
Component拖动手势,动作(S)这个拖放操作的支持,和
DragGestureListener通知一旦拖启动手势已经被发现。
ds -
DragSource这
DragGestureRecognizer将使用过程中的拖放操作
c -这
DragGestureRecognizer应该“观察”的事件流的
Component,为了检测拖启动手势。如果这个值是
null的
DragGestureRecognizer,不与任何
Component相关。
sa -集(逻辑或)的,这
DnDConstants拖放操作支持
dgl -
DragGestureRecognizer通知时,拖动手势检测
IllegalArgumentException如果DS是
null。
protected DragGestureRecognizer(DragSource ds, Component c, int sa)
DragGestureRecognizer给予
DragSource用于拖放操作,这
DragGestureRecognizer应该“观察”引发的
Component拖动手势,和行动(S)支持这个拖放操作。
ds -
DragSource这
DragGestureRecognizer将使用过程中的拖放操作
c -这
DragGestureRecognizer应该“观察”的事件流的
Component,为了检测拖启动手势。如果这个值是
null的
DragGestureRecognizer,不与任何
Component相关。
sa -集(逻辑或)的
DnDConstants这个拖放操作将支持
IllegalArgumentException如果DS是
null。
protected DragGestureRecognizer(DragSource ds, Component c)
DragGestureRecognizer给予
DragSource用于拖放操作,和
Component这
DragGestureRecognizer应该“观察”拖动起始姿势。
ds -
DragSource这
DragGestureRecognizer将使用过程中的拖放操作
c -这
DragGestureRecognizer应该“观察”的事件流的
Component,为了检测拖启动手势。如果这个值是
null的
DragGestureRecognizer,不与任何
Component相关。
IllegalArgumentException如果DS是
null。
protected DragGestureRecognizer(DragSource ds)
DragGestureRecognizer给予
DragSource用于拖放操作。
ds -
DragSource这
DragGestureRecognizer将使用过程中的拖放操作
IllegalArgumentException如果DS是
null。
protected abstract void registerListeners()
protected abstract void unregisterListeners()
public DragSource getDragSource()
DragSource这
DragGestureRecognizer将用以处理拖放操作。
public Component getComponent()
Component是“观察”的
DragGestureRecognizer拖动起始姿势。
public void setComponent(Component c)
c -
Component或
null
public int getSourceActions()
public void setSourceActions(int actions)
actions -允许源拖动操作(S)
public InputEvent getTriggerEvent()
public void resetRecognizer()
public void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException
DragGestureListener。
dgl -
DragGestureListener与这个
DragGestureRecognizer
登记。
TooManyListenersException -如果一个
DragGestureListener已添加。
public void removeDragGestureListener(DragGestureListener dgl)
dgl -
DragGestureListener注销这
DragGestureRecognizer
IllegalArgumentException(等于)目前注册
DragGestureListener。
protected void fireDragGestureRecognized(int dragAction,
Point p)
dragAction由用户最初选择的动作手势
p -点(在元件坐标)的手势起源
protected void appendEvent(InputEvent awtie)
这种方法是通过一个DragGestureRecognizer实现添加一个InputEvent类(它认为是一个在一系列的事件,包括拖放操作)对这DragGestureRecognizer保持内部事件的数组。
awtie -
InputEvent添加到事件
DragGestureRecognizer内部阵列。注意,
null不是有效值,并将被忽略。
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.