public class DragSourceDragEvent extends DragSourceEvent
DragSourceDragEvent
从
DragSourceContextPeer
交付,通过
DragSourceContext
,到
DragSourceListener
,
DragSourceContext
和与其相关的
DragSource
注册。
报告的DragSourceDragEvent
零目标滴行动和反映拖动操作的当前状态的空用户滴行动。
空目标滴行动是DnDConstants
表示选择当前的拖放目标如果这滴行动如果这滴行动不是通过拖动源支持拖动源或DnDConstants.ACTION_NONE
支持拖放操作。
空用户滴行动取决于拖动源和用户选择的下拉作用支持拖放操作。用户可以在拖动操作期间按修改键键来选择一个下拉动作:
按Ctrl + Shift -> action_linkCtrl -> action_copy移-> action_move如果用户选择放弃行动,空用户滴行动是
DnDConstants
表示所选滴行动如果这滴行动如果这滴行动不是通过拖动源支持拖动源或
DnDConstants.ACTION_NONE
支持。
如果用户不选择一个下拉动作,对DnDConstants
表示行动的支持下降拖动源集合中搜索DnDConstants.ACTION_MOVE
,然后DnDConstants.ACTION_COPY
,然后DnDConstants.ACTION_LINK
和空用户滴行动是第一个常数的发现。如果没有不断的被发现是空用户滴行动DnDConstants.ACTION_NONE
。
source
Constructor and Description |
---|
DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers)
构建了一个
DragSourceDragEvent 。
|
DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y)
构建了一个
DragSourceDragEvent 给指定的
DragSourceContext ,用户滴行动,目标降作用,改性剂和坐标。
|
Modifier and Type | Method and Description |
---|---|
int |
getDropAction()
此方法返回目标拖放操作的逻辑交叉点和由拖动源支持的拖放操作集。
|
int |
getGestureModifiers()
此方法返回表示与用户的操作相关的输入设备的当前状态的一个
int 修饰符。
|
int |
getGestureModifiersEx()
此方法返回表示该输入装置扩展剂与用户的手势相关的当前状态的
int 。
|
int |
getTargetActions()
此方法返回目标拖放动作。
|
int |
getUserAction()
此方法返回用户拖放动作。
|
getDragSourceContext, getLocation, getX, getY
getSource, toString
public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers)
DragSourceDragEvent
。这类通常实例化的
DragSourceContextPeer
而不是直接由客户端代码。这
DragSourceDragEvent
坐标都没有指定,那么
getLocation
将返回
null
此事件。
争论dropAction
和action
应该是DnDConstants
表示单个动作。争论modifiers
应该是一位掩码的老java.awt.event.InputEvent.*_MASK
常数或扩展java.awt.event.InputEvent.*_DOWN_MASK
常数的位掩码。此构造函数不投无效dropAction
任何例外,action
和modifiers
。
dsc
-
DragSourceContext
,管理该事件通知。
dropAction
-用户滴行动。
action
-目标滴行动。
modifiers
的修饰键在事件(Shift、Ctrl、Alt、元)或扩展_down_mask或老_mask修饰符应该被使用,但这两个模型的不能混合在一个事件。使用扩展的改性剂是优选的。
null
dsc
IllegalArgumentException
。
InputEvent
,
DragSourceEvent.getLocation()
public DragSourceDragEvent(DragSourceContext dsc, int dropAction, int action, int modifiers, int x, int y)
DragSourceDragEvent
给指定的
DragSourceContext
,用户滴行动,目标降作用,改性剂和坐标。
争论dropAction
和action
应该是DnDConstants
表示单个动作。争论modifiers
应该是一位掩码的老java.awt.event.InputEvent.*_MASK
常数或扩展java.awt.event.InputEvent.*_DOWN_MASK
常数的位掩码。此构造函数不投无效dropAction
任何例外,action
和modifiers
。
dsc
-与此事件相关的
DragSourceContext
。
dropAction
-用户滴行动。
action
-目标滴行动。
modifiers
的修饰键在事件(Shift、Ctrl、Alt、元)或扩展_down_mask或老_mask修饰符应该被使用,但这两个模型的不能混合在一个事件。使用扩展的改性剂是优选的。
x
-光标位置的横坐标
y
-光标位置的垂直坐标
null
dsc
IllegalArgumentException
。
InputEvent
public int getTargetActions()
public int getGestureModifiers()
int
修饰符。通常情况下,这些将是鼠标按钮或键盘修饰语。
如果modifiers
传递给构造函数是无效的,此方法返回他们不变。
public int getGestureModifiersEx()
public int getUserAction()
public int getDropAction()
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.