KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > dnd > peer > DropTargetContextPeer


1 /*
2  * @(#)DropTargetContextPeer.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.dnd.peer;
9
10 import java.awt.Insets JavaDoc;
11
12 import java.awt.datatransfer.DataFlavor JavaDoc;
13 import java.awt.datatransfer.Transferable JavaDoc;
14 import java.awt.datatransfer.UnsupportedFlavorException JavaDoc;
15
16 import java.awt.dnd.DropTarget JavaDoc;
17 import java.awt.dnd.DropTargetContext JavaDoc;
18 import java.awt.dnd.InvalidDnDOperationException JavaDoc;
19
20 import java.io.InputStream JavaDoc;
21 import java.io.IOException JavaDoc;
22
23 /**
24  * <p>
25  * This interface is exposed by the underlying window system platform to
26  * enable control of platform DnD operations
27  * </p>
28  *
29  * @version 1.13, 12/19/03
30  * @since 1.2
31  *
32  */

33
34 public interface DropTargetContextPeer {
35
36     /**
37      * update the peer's notion of the Target's actions
38      */

39
40     void setTargetActions(int actions);
41
42     /**
43      * get the current Target actions
44      */

45
46     int getTargetActions();
47
48     /**
49      * get the DropTarget associated with this peer
50      */

51
52     DropTarget JavaDoc getDropTarget();
53
54     /**
55      * get the (remote) DataFlavors from the peer
56      */

57
58     DataFlavor JavaDoc[] getTransferDataFlavors();
59
60     /**
61      * get an input stream to the remote data
62      */

63
64     Transferable JavaDoc getTransferable() throws InvalidDnDOperationException JavaDoc;
65
66     /**
67      * @return if the DragSource Transferable is in the same JVM as the Target
68      */

69
70     boolean isTransferableJVMLocal();
71
72     /**
73      * accept the Drag
74      */

75
76     void acceptDrag(int dragAction);
77
78     /**
79      * reject the Drag
80      */

81
82     void rejectDrag();
83
84     /**
85      * accept the Drop
86      */

87
88     void acceptDrop(int dropAction);
89
90     /**
91      * reject the Drop
92      */

93
94     void rejectDrop();
95
96     /**
97      * signal complete
98      */

99
100     void dropComplete(boolean success);
101
102 }
103
Popular Tags