- java.lang.Object
-
- java.util.EventObject
-
- java.awt.dnd.DragSourceEvent
-
- java.awt.dnd.DragSourceDropEvent
-
- All Implemented Interfaces:
-
Serializable
public class DragSourceDropEvent extends DragSourceEvent
所述DragSourceDropEvent从递送DragSourceContextPeer,经由DragSourceContext,到dragDropEnd的方法DragSourceListener与注册小号DragSourceContext和与其相关联的DragSource。 它包含足够的信息,用于操作的发起者,以便在操作完成时向最终用户提供适当的反馈。- 从以下版本开始:
- 1.2
- 另请参见:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
构造方法摘要
构造方法 Constructor 描述 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 方法 描述 intgetDropAction()此方法返回一个int表示由目标执行的关于该删除主题的操作。booleangetDropSuccess()此方法返回一个boolean指示下降是否成功。-
Methods inherited from class java.awt.dnd.DragSourceEvent
getDragSourceContext, getLocation, getX, getY
-
Methods inherited from class java.util.EventObject
getSource, toString
-
-
-
-
构造方法详细信息
-
DragSourceDropEvent
public DragSourceDropEvent(DragSourceContext dsc, int action, boolean success)
构建一个DragSourceDropEvent的一个下降,给出了DragSourceContext的下拉操作,以及一个boolean表示跌落是否成功。 此DragSourceDropEvent的坐标未指定,因此getLocation将为此事件返回null。参数
action应该是表示单个操作的DnDConstants之一。 此构造函数不会为无效的action引发任何异常。- 参数
-
dsc- 该DragSourceContext与此DragSourceDropEvent相关联 -
action- 放下的动作 -
success- 一个布尔值,指示下降是否成功 - 异常
-
IllegalArgumentException- 如果dsc是null。 - 另请参见:
-
DragSourceEvent.getLocation()
-
DragSourceDropEvent
public DragSourceDropEvent(DragSourceContext dsc, int action, boolean success, int x, int y)
构造一个DragSourceDropEvent一个下降,给出了DragSourceContext,下降动作,一个boolean表示下降是否成功,并且坐标。参数
action应该是代表一个动作的DnDConstants之一。 此构造函数不会为无效的action引发任何异常。- 参数
-
dsc-在DragSourceContext与此相关DragSourceDropEvent -
action- 下降动作 -
success- 一个布尔值,表示下降是否成功 -
x- 光标位置的水平坐标 -
y- 光标位置的垂直坐标 - 异常
-
IllegalArgumentException- 如果dsc是null。 - 从以下版本开始:
- 1.4
-
DragSourceDropEvent
public DragSourceDropEvent(DragSourceContext dsc)
构造一个DragSourceDropEvent用于不会导致丢弃的拖动。 此DragSourceDropEvent的坐标未指定,因此getLocation将为此事件返回null。- 参数
-
dsc-DragSourceContext - 异常
-
IllegalArgumentException- 如果dsc是null。 - 另请参见:
-
DragSourceEvent.getLocation()
-
-
方法详细信息
-
getDropSuccess
public boolean getDropSuccess()
此方法返回一个boolean指示下降是否成功。- 结果
-
true如果下拉目标接受掉落并成功执行了一个放置动作;false如果丢弃目标拒绝了该丢弃,或者如果丢弃目标接受了丢弃,但未能执行删除操作。
-
getDropAction
public int getDropAction()
此方法返回一个int表示目标对投影对象执行的操作。- 结果
-
the action performed by the target on the subject of the drop if the drop target accepted the drop and the target drop action is supported by the drag source; otherwise,
DnDConstants.ACTION_NONE.
-
-