|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
java.lang.Objectjava.awt.dnd.DropTargetContext
public class DropTargetContext
每當與 Drag 和 Drop 操作相關的邏輯鼠標和與 DropTarget 相關的 Component 的可見幾何結構重合時,就創建一個 DropTargetContext。DropTargetContext 為放置操作的潛在接收者提供一種機制,該機制既為終端使用者提供適當的拖動反饋,也影響適當的後續資料傳輸。
| 巢狀類別摘要 | |
|---|---|
protected class |
DropTargetContext.TransferableProxy
TransferableProxy 是一個說明器內部類別,它實作 Transferable 介面,並用作另一個表示特定 drag-n-drop(拖放)操作資料轉換的 Transferable 物件的代理。 |
| 方法摘要 | |
|---|---|
protected void |
acceptDrag(int dragOperation)
接受該 Drag。 |
protected void |
acceptDrop(int dropOperation)
調用以指示放置操作是可接受的(使用指定的操作)。 |
void |
addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
與 DropTargetContextPeer 關聯時調用。 |
protected Transferable |
createTransferableProxy(Transferable t,
boolean local)
創建一個代理指定 Transferable 的 TransferableProxy。 |
void |
dropComplete(boolean success)
此方法指示放置操作完成以及成功與否。 |
Component |
getComponent()
此方法返回與此 DropTargetContext 相關的 Component。 |
protected DataFlavor[] |
getCurrentDataFlavors()
獲取此操作的 Transferable 操作數的可用 DataFlavor。 |
protected List<DataFlavor> |
getCurrentDataFlavorsAsList()
此方法返回 Transferable 操作數當前可用的 DataFlavor,作為一個 java.util.List。 |
DropTarget |
getDropTarget()
此方法返回與此 DropTargetContext 相關的 DropTarget。 |
protected int |
getTargetActions()
此方法返回一個 int,表示此 DropTarget 將接受的當前操作。 |
protected Transferable |
getTransferable()
獲取此操作的 Transferable(代理)操作數 |
protected boolean |
isDataFlavorSupported(DataFlavor df)
此方法返回一個 boolean 值,指示給定的 DataFlavor 是否受此 DropTargetContext 支持。 |
protected void |
rejectDrag()
拒絕該 Drag。 |
protected void |
rejectDrop()
調用以指示放置操作是不可接受的。 |
void |
removeNotify()
取消與 DropTargetContextPeer 的關聯時調用。 |
protected void |
setTargetActions(int actions)
此方法設置此 DropTarget 可接受的當前操作。 |
| 從類別 java.lang.Object 繼承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 方法詳細資訊 |
|---|
public DropTarget getDropTarget()
DropTargetContext 相關的 DropTarget。
DropTargetContext 相關的 DropTargetpublic Component getComponent()
DropTargetContext 相關的 Component。
public void addNotify(java.awt.dnd.peer.DropTargetContextPeer dtcp)
DropTargetContextPeer 關聯時調用。
dtcp - DropTargetContextPeerpublic void removeNotify()
DropTargetContextPeer 的關聯時調用。
protected void setTargetActions(int actions)
DropTarget 可接受的當前操作。
actions - 一個 int,表示受支持的操作protected int getTargetActions()
int,表示此 DropTarget 將接受的當前操作。
DropTarget 可接受的當前操作
public void dropComplete(boolean success)
throws InvalidDnDOperationException
success - 如果成功,則為 true;否則為 false
InvalidDnDOperationException - 如果放置操作未完成/成功protected void acceptDrag(int dragOperation)
dragOperation - 受支持的操作protected void rejectDrag()
protected void acceptDrop(int dropOperation)
dropOperation - 受支持的操作protected void rejectDrop()
protected DataFlavor[] getCurrentDataFlavors()
Transferable 操作數的可用 DataFlavor。
DataFlavor[],它包含受支持的 Transferable 操作數的 DataFlavor。protected List<DataFlavor> getCurrentDataFlavorsAsList()
Transferable 操作數當前可用的 DataFlavor,作為一個 java.util.List。
java.util.Listprotected 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 - 要被代理的 Transferablelocal - 如果 t 表示本地 drag-n-drop 操作的結果,則為 true。
|
JavaTM 2 Platform Standard Ed. 6 |
|||||||||
| 上一個類別 下一個類別 | 框架 無框架 | |||||||||
| 摘要: 巢狀 | 欄位 | 建構子 | 方法 | 詳細資訊: 欄位 | 建構子 | 方法 | |||||||||
版權所有 2008 Sun Microsystems, Inc. 保留所有權利。請遵守GNU General Public License, version 2 only。