public class DropTargetContext extends Object implements Serializable
DropTargetContext
创建与拖放操作时恰逢一个
DropTarget
相关
Component
可见几何体相关的逻辑光标。提供了一个潜在的
DropTargetContext
接收机一个拖放操作对终端用户提供适当的阻力下反馈机制,而且还影响后续的数据传输是否合适。
Modifier and Type | Class and Description |
---|---|
protected class |
DropTargetContext.TransferableProxy
TransferableProxy 是辅助内部类实现
Transferable 接口,可以作为另一个
Transferable 对象代表一个特定的拖放操作的数据传送代理。
|
Modifier and Type | Method and Description |
---|---|
protected void |
acceptDrag(int dragOperation)
接受阻力。
|
protected void |
acceptDrop(int dropOperation)
调用到信号,该下拉是使用指定的操作可以接受。
|
void |
addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
打电话时的
DropTargetContextPeer 相关。
|
protected Transferable |
createTransferableProxy(Transferable t, boolean local)
创建一个transferableproxy代理指定的转让。
|
void |
dropComplete(boolean success)
这种方法信号的下拉完成,如果它是成功的或不。
|
Component |
getComponent()
此方法返回与此相关的
Component
DropTargetContext 。
|
protected DataFlavor[] |
getCurrentDataFlavors()
得到该操作的操作数可用dataflavors
Transferable 。
|
protected List<DataFlavor> |
getCurrentDataFlavorsAsList()
此方法返回一个当前可用的
Transferable dataflavors操作数为一
java.util.List 。
|
DropTarget |
getDropTarget()
此方法返回与此相关的
DropTarget
DropTargetContext 。
|
protected int |
getTargetActions()
此方法返回表示当前的行动这一
int 将接受
DropTarget 。
|
protected Transferable |
getTransferable()
获取此操作的可转移(代理)操作数
|
protected boolean |
isDataFlavorSupported(DataFlavor df)
如果给定的
DataFlavor 由这个
DropTargetContext 支持此方法返回一个
boolean 指示。
|
protected void |
rejectDrag()
拒绝拖。
|
protected void |
rejectDrop()
打电话给信号说,下降是不可接受的。
|
void |
removeNotify()
打电话时的
DropTargetContextPeer 分离。
|
protected void |
setTargetActions(int actions)
这种方法设置当前的行动,这
DropTarget 接受。
|
public DropTarget getDropTarget()
DropTarget
DropTargetContext
。
DropTarget
DropTargetContext
public Component getComponent()
Component
DropTargetContext
。
public void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
DropTargetContextPeer
相关。
dtcp
-
DropTargetContextPeer
public void removeNotify()
DropTargetContextPeer
分离。
protected void setTargetActions(int actions)
DropTarget
接受。
actions
代表支持的行动
int
(S)
protected int getTargetActions()
int
将接受
DropTarget
。
DropTarget
接受
public void dropComplete(boolean success) throws InvalidDnDOperationException
success
-真正的成功,假如不
InvalidDnDOperationException
-如果一滴不突出/现存
protected void acceptDrag(int dragOperation)
dragOperation
-支持行动(S)
protected void rejectDrag()
protected void acceptDrop(int dropOperation)
dropOperation
-支持行动(S)
protected void rejectDrop()
protected DataFlavor[] getCurrentDataFlavors()
Transferable
。
DataFlavor[]
包含操作数的
Transferable
支持
DataFlavor
s。
protected List<DataFlavor> getCurrentDataFlavorsAsList()
Transferable
dataflavors操作数为一
java.util.List
。
java.util.List
protected boolean isDataFlavorSupported(DataFlavor df)
DataFlavor
由这个
DropTargetContext
支持此方法返回一个
boolean
指示。
df
-
DataFlavor
DataFlavor
指定的支持
protected Transferable getTransferable() throws InvalidDnDOperationException
Transferable
InvalidDnDOperationException
如果拖不突出/现存的
protected Transferable createTransferableProxy(Transferable t, boolean local)
t
-
Transferable被代理
local
-
true如果
t代表一个地方的拖放操作的结果。
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.