public class DragSourceDropEvent extends DragSourceEvent
DragSourceDropEvent被从递送DragSourceContextPeer ,经由DragSourceContext到dragDropEnd的方法DragSourceListener与注册小号DragSourceContext和与其相关联的DragSource 。
它包含足够的信息,用于操作的发起者,以便在操作完成时向最终用户提供适当的反馈。
source| Constructor and Description |
|---|
DragSourceDropEvent(DragSourceContext dsc)
构造一个
DragSourceDropEvent用于不会导致丢弃的拖动。
|
DragSourceDropEvent(DragSourceContext dsc, int action, boolean success)
构建一个
DragSourceDropEvent一个下降,给定
DragSourceContext ,下降动作,和一个
boolean表示跌落是否成功。
|
DragSourceDropEvent(DragSourceContext dsc, int action, boolean success, int x, int y)
构造一个
DragSourceDropEvent一滴,给出
DragSourceContext ,下降动作,一个
boolean指示下降是否成功,并且坐标。
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDropAction()
该方法返回一个
int ,表示由目标对投影对象执行的操作。
|
boolean |
getDropSuccess()
此方法返回一个
boolean指示下降是否成功。
|
getDragSourceContext, getLocation, getX, getYgetSource, toStringpublic DragSourceDropEvent(DragSourceContext dsc, int action, boolean success)
DragSourceDropEvent的一个下降,给定DragSourceContext ,下降动作,和一个boolean表示跌落是否成功。
此DragSourceDropEvent的DragSourceDropEvent未指定,因此getLocation将为此事件返回null 。
参数action应该是代表一个动作的DnDConstants之一。 此构造函数不会为无效action引发任何action 。
dsc -在
DragSourceContext与此相关
DragSourceDropEvent
action - 放行动
success - 一个布尔值,指示下降是否成功
IllegalArgumentException - 如果
dsc是
null 。
DragSourceEvent.getLocation()
public DragSourceDropEvent(DragSourceContext dsc, int action, boolean success, int x, int y)
DragSourceDropEvent一滴,给出DragSourceContext ,下降动作,一个boolean表示跌落是否成功,并且坐标。
参数action应该是DnDConstants ,代表一个动作。 此构造函数不会为无效action引发任何action 。
dsc -在
DragSourceContext与此相关
DragSourceDropEvent
action - 放行动
success - 一个布尔值,表示下降是否成功
x - 光标位置的水平坐标
y - 光标位置的垂直坐标
IllegalArgumentException - 如果
dsc是
null 。
public DragSourceDropEvent(DragSourceContext dsc)
DragSourceDropEvent用于不会导致丢弃的拖动。
此DragSourceDropEvent的DragSourceDropEvent未指定,因此getLocation将为此事件返回null 。
dsc -
DragSourceContext
IllegalArgumentException - 如果
dsc是
null 。
DragSourceEvent.getLocation()
public boolean getDropSuccess()
boolean指示下降是否成功。
true如果下降目标接受掉落并成功执行放置动作;
false如果下降目标拒绝了下降,或者如果下降目标接受了下降,但未能执行放弃操作。
public int getDropAction()
int ,表示由目标执行的关于该删除主题的操作。
DnDConstants.ACTION_NONE.
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.