public class DropTargetDropEvent extends DropTargetEvent
DropTargetDropEvent
通过
DropTargetListener
drop()方法交付。
报告的DropTargetDropEvent
零源滴行动和空用户滴行动,反映当前状态的拖放操作。
空源滴行动是一位掩码的DnDConstants
表示集落的行动支持拖动源这个拖放操作。
空用户滴行动取决于拖动源和用户选择的下拉作用支持拖放操作。用户可以在拖动操作期间按修改键键来选择一个下拉动作:
按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
。
context
source
Constructor and Description |
---|
DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions)
构建一个
DropTargetDropEvent 给出了此操作的
DropTargetContext ,拖
Cursor 热点在
Component 的坐标位置,当前选定的用户下降的动作,并由源支持行动的当前设置。
|
DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal)
构建一个
DropTargetEvent 给出了此操作的
DropTargetContext ,拖
Cursor 热点在
Component 的坐标位置,当前选定的用户下降动作,由源支持行动的当前设置,和
boolean 表示如果源是相同的JVM为目标。
|
Modifier and Type | Method and Description |
---|---|
void |
acceptDrop(int dropAction)
接受下拉,使用指定的动作。
|
void |
dropComplete(boolean success)
这个方法通知
DragSource ,熔滴过渡(S)完成。
|
DataFlavor[] |
getCurrentDataFlavors()
此方法返回当前dataflavors。
|
List<DataFlavor> |
getCurrentDataFlavorsAsList()
这个方法返回当前可用的
DataFlavor s作为
java.util.List 。
|
int |
getDropAction()
此方法返回用户拖放动作。
|
Point |
getLocation()
此方法返回一个
Point 表示在
Component 坐标的
Cursor 的当前位置。
|
int |
getSourceActions()
此方法返回源代码拖放操作。
|
Transferable |
getTransferable()
此方法返回的对象的
Transferable 下降有关。
|
boolean |
isDataFlavorSupported(DataFlavor df)
如果指定的
DataFlavor 可从源这个方法返回一个
boolean 指示。
|
boolean |
isLocalTransfer()
如果是在同一个JVM作为目标,这个方法返回一个
int 指示。
|
void |
rejectDrop()
拒绝下降。
|
getDropTargetContext
getSource, toString
public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions)
DropTargetDropEvent
给出了此操作的
DropTargetContext
,拖
Cursor
热点在
Component
的坐标位置,当前选定的用户下降的动作,并由源支持行动的当前设置。默认情况下,此构造函数假定目标不在同一个虚拟机作为源;即
isLocalTransfer()
将返回
false
。
dtc
-此操作的
DropTargetContext
cursorLocn
-“拖”光标的热点在
Component
位置坐标
dropAction
-用户滴行动。
srcActions
-源滴行动。
null
cursorlocn
NullPointerException
IllegalArgumentException
-如果dropaction不是一
DnDConstants
。
IllegalArgumentException
-如果srcactions不是
DnDConstants
一位掩码。
IllegalArgumentException
如果DTC
null
。
public DropTargetDropEvent(DropTargetContext dtc, Point cursorLocn, int dropAction, int srcActions, boolean isLocal)
DropTargetEvent
给出了此操作的
DropTargetContext
,拖
Cursor
热点在
Component
的坐标位置,当前选定的用户下降动作,由源支持行动的当前设置,和
boolean
表示如果源是相同的JVM为目标。
dtc
-此操作的droptargetcontext
cursorLocn
-组件的坐标“拖”光标的热点的位置
dropAction
-用户滴行动。
srcActions
-源滴行动。
isLocal
-如果源是相同的JVM为目标
null
cursorlocn
NullPointerException
IllegalArgumentException
-如果dropaction不是一
DnDConstants
。
IllegalArgumentException
-如果srcactions不是
DnDConstants
一位掩码。
IllegalArgumentException
如果DTC
null
。
public Point getLocation()
Point
表示在
Component
坐标的
Cursor
的当前位置。
Cursor
组件的坐标位置。
public DataFlavor[] getCurrentDataFlavors()
public List<DataFlavor> getCurrentDataFlavorsAsList()
DataFlavor
s作为
java.util.List
。
public boolean isDataFlavorSupported(DataFlavor df)
DataFlavor
可从源这个方法返回一个
boolean
指示。
df
-
DataFlavor
测试
public int getSourceActions()
public int getDropAction()
public Transferable getTransferable()
Transferable
下降有关。
Transferable
public void acceptDrop(int dropAction)
dropAction
-指定的动作
public void rejectDrop()
public void dropComplete(boolean success)
DragSource
,熔滴过渡(S)完成。
success
-
boolean
表明滴过渡(S)完成。
public boolean isLocalTransfer()
int
指示。
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.