KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > dnd > DragSourceListener


1 /*
2  * @(#)DragSourceListener.java 1.20 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;
9
10 import java.util.EventListener JavaDoc;
11
12 /**
13  * The <code>DragSourceListener</code> defines the
14  * event interface for originators of
15  * Drag and Drop operations to track the state of the user's gesture, and to
16  * provide appropriate &quot;drag over&quot;
17  * feedback to the user throughout the
18  * Drag and Drop operation.
19  * <p>
20  * The drop site is <i>associated with the previous <code>dragEnter()</code>
21  * invocation</i> if the latest invocation of <code>dragEnter()</code> on this
22  * listener:
23  * <ul>
24  * <li>corresponds to that drop site and
25  * <li> is not followed by a <code>dragExit()</code> invocation on this listener.
26  * </ul>
27  *
28  * @version 1.20, 12/19/03
29  * @since 1.2
30  */

31
32 public interface DragSourceListener extends EventListener JavaDoc {
33
34     /**
35      * Called as the cursor's hotspot enters a platform-dependent drop site.
36      * This method is invoked when all the following conditions are true:
37      * <UL>
38      * <LI>The cursor's hotspot enters the operable part of a platform-
39      * dependent drop site.
40      * <LI>The drop site is active.
41      * <LI>The drop site accepts the drag.
42      * </UL>
43      *
44      * @param dsde the <code>DragSourceDragEvent</code>
45      */

46     void dragEnter(DragSourceDragEvent JavaDoc dsde);
47
48     /**
49      * Called as the cursor's hotspot moves over a platform-dependent drop site.
50      * This method is invoked when all the following conditions are true:
51      * <UL>
52      * <LI>The cursor's hotspot has moved, but still intersects the
53      * operable part of the drop site associated with the previous
54      * dragEnter() invocation.
55      * <LI>The drop site is still active.
56      * <LI>The drop site accepts the drag.
57      * </UL>
58      *
59      * @param dsde the <code>DragSourceDragEvent</code>
60      */

61     void dragOver(DragSourceDragEvent JavaDoc dsde);
62
63     /**
64      * Called when the user has modified the drop gesture.
65      * This method is invoked when the state of the input
66      * device(s) that the user is interacting with changes.
67      * Such devices are typically the mouse buttons or keyboard
68      * modifiers that the user is interacting with.
69      *
70      * @param dsde the <code>DragSourceDragEvent</code>
71      */

72     void dropActionChanged(DragSourceDragEvent JavaDoc dsde);
73
74     /**
75      * Called as the cursor's hotspot exits a platform-dependent drop site.
76      * This method is invoked when any of the following conditions are true:
77      * <UL>
78      * <LI>The cursor's hotspot no longer intersects the operable part
79      * of the drop site associated with the previous dragEnter() invocation.
80      * </UL>
81      * OR
82      * <UL>
83      * <LI>The drop site associated with the previous dragEnter() invocation
84      * is no longer active.
85      * </UL>
86      * OR
87      * <UL>
88      * <LI> The drop site associated with the previous dragEnter() invocation
89      * has rejected the drag.
90      * </UL>
91      *
92      * @param dse the <code>DragSourceEvent</code>
93      */

94     void dragExit(DragSourceEvent JavaDoc dse);
95
96     /**
97      * This method is invoked to signify that the Drag and Drop
98      * operation is complete. The getDropSuccess() method of
99      * the <code>DragSourceDropEvent</code> can be used to
100      * determine the termination state. The getDropAction() method
101      * returns the operation that the drop site selected
102      * to apply to the Drop operation. Once this method is complete, the
103      * current <code>DragSourceContext</code> and
104      * associated resources become invalid.
105      *
106      * @param dsde the <code>DragSourceDropEvent</code>
107      */

108     void dragDropEnd(DragSourceDropEvent JavaDoc dsde);
109 }
110
111
112
113
114
115
116
Popular Tags