public class DropTargetContext extends Object implements Serializable
DropTargetContext每当用拖放操作相关联的逻辑光标用的可见几何一致创建Component与相关联的DropTarget 。
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代理指定的Transferable。
|
void |
dropComplete(boolean success)
该方法表明,下降完成并且成功。
|
Component |
getComponent()
此方法返回
Component与此相关
DropTargetContext 。
|
protected DataFlavor[] |
getCurrentDataFlavors()
获取此操作的
Transferable操作数的可用DataFlavors。
|
protected List<DataFlavor> |
getCurrentDataFlavorsAsList()
此方法返回当前可用的
Transferable操作数
Transferable作为
java.util.List 。
|
DropTarget |
getDropTarget()
此方法返回
DropTarget与此相关
DropTargetContext 。
|
protected int |
getTargetActions()
此方法返回一个
int表示
DropTarget将接受的当前操作。
|
protected Transferable |
getTransferable()
获取此操作的可转移(代理)操作数
|
protected boolean |
isDataFlavorSupported(DataFlavor df)
此方法返回一个
boolean指示给定的
DataFlavor是否由此
DropTargetContext 。
|
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动作的int
protected int getTargetActions()
int表示
DropTarget将接受的当前操作。
DropTarget
public void dropComplete(boolean success)
throws InvalidDnDOperationException
success - 如果没有成功,则为true
InvalidDnDOperationException - 如果一滴不突出/现存
protected void acceptDrag(int dragOperation)
dragOperation - 支持的操作
protected void rejectDrag()
protected void acceptDrop(int dropOperation)
dropOperation - 支持的动作
protected void rejectDrop()
protected DataFlavor[] getCurrentDataFlavors()
Transferable操作数的可用DataFlavors。
DataFlavor[]含有支持
DataFlavor S中的
Transferable操作数。
protected List<DataFlavor> getCurrentDataFlavorsAsList()
Transferable操作数
Transferable作为
java.util.List 。
java.util.List
protected boolean isDataFlavorSupported(DataFlavor df)
boolean表示,如果给定
DataFlavor受此支持
DropTargetContext 。
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.