44 |
import java.awt.HeadlessException; |
import java.awt.HeadlessException; |
45 |
import java.awt.Image; |
import java.awt.Image; |
46 |
import java.awt.Point; |
import java.awt.Point; |
47 |
|
import java.awt.Toolkit; |
48 |
import java.awt.datatransfer.FlavorMap; |
import java.awt.datatransfer.FlavorMap; |
49 |
|
import java.awt.datatransfer.SystemFlavorMap; |
50 |
import java.awt.datatransfer.Transferable; |
import java.awt.datatransfer.Transferable; |
51 |
import java.awt.dnd.peer.DragSourceContextPeer; |
import java.awt.dnd.peer.DragSourceContextPeer; |
52 |
|
import java.io.IOException; |
53 |
|
import java.io.ObjectInputStream; |
54 |
|
import java.io.ObjectOutputStream; |
55 |
import java.io.Serializable; |
import java.io.Serializable; |
56 |
import java.util.EventListener; |
import java.util.EventListener; |
57 |
|
|
58 |
|
/** |
59 |
|
* @since 1.2 |
60 |
|
*/ |
61 |
public class DragSource implements Serializable |
public class DragSource implements Serializable |
62 |
{ |
{ |
63 |
/** |
/** |
72 |
public static final Cursor DefaultMoveNoDrop = null; |
public static final Cursor DefaultMoveNoDrop = null; |
73 |
public static final Cursor DefaultLinkNoDrop = null; |
public static final Cursor DefaultLinkNoDrop = null; |
74 |
|
|
75 |
|
private transient FlavorMap flavorMap = SystemFlavorMap.getDefaultFlavorMap (); |
76 |
|
|
77 |
|
private transient DragSourceListener dragSourceListener; |
78 |
|
private transient DragSourceMotionListener dragSourceMotionListener; |
79 |
|
|
80 |
/** |
/** |
81 |
* Initializes the drag source. |
* Initializes the drag source. |
82 |
* |
* |
172 |
|
|
173 |
public FlavorMap getFlavorMap() |
public FlavorMap getFlavorMap() |
174 |
{ |
{ |
175 |
return null; |
return flavorMap; |
176 |
} |
} |
177 |
|
|
178 |
public DragGestureRecognizer |
public DragGestureRecognizer |
179 |
createDragGestureRecognizer(Class recognizer, Component c, int actions, |
createDragGestureRecognizer(Class recognizer, Component c, int actions, |
180 |
DragGestureListener dgl) |
DragGestureListener dgl) |
181 |
{ |
{ |
182 |
return null; |
return Toolkit.getDefaultToolkit () |
183 |
|
.createDragGestureRecognizer (recognizer, this, c, actions, |
184 |
|
dgl); |
185 |
} |
} |
186 |
|
|
187 |
public DragGestureRecognizer |
public DragGestureRecognizer |
188 |
createDefaultDragGestureRecognizer(Component c, int actions, |
createDefaultDragGestureRecognizer(Component c, int actions, |
189 |
DragGestureListener dgl) |
DragGestureListener dgl) |
190 |
{ |
{ |
191 |
return null; |
return createDragGestureRecognizer (MouseDragGestureRecognizer.class, c, |
192 |
|
actions, dgl); |
193 |
} |
} |
194 |
|
|
195 |
|
/** |
196 |
|
* @since 1.4 |
197 |
|
*/ |
198 |
public void addDragSourceListener(DragSourceListener l) |
public void addDragSourceListener(DragSourceListener l) |
199 |
{ |
{ |
200 |
|
DnDEventMulticaster.add (dragSourceListener, l); |
201 |
} |
} |
202 |
|
|
203 |
|
/** |
204 |
|
* @since 1.4 |
205 |
|
*/ |
206 |
public void removeDragSourceListener(DragSourceListener l) |
public void removeDragSourceListener(DragSourceListener l) |
207 |
{ |
{ |
208 |
|
DnDEventMulticaster.remove (dragSourceListener, l); |
209 |
} |
} |
210 |
|
|
211 |
|
/** |
212 |
|
* @since 1.4 |
213 |
|
*/ |
214 |
public DragSourceListener[] getDragSourceListeners() |
public DragSourceListener[] getDragSourceListeners() |
215 |
{ |
{ |
216 |
return null; |
return (DragSourceListener[]) getListeners (DragSourceListener.class); |
217 |
} |
} |
218 |
|
|
219 |
|
/** |
220 |
|
* @since 1.4 |
221 |
|
*/ |
222 |
public void addDragSourceMotionListener(DragSourceMotionListener l) |
public void addDragSourceMotionListener(DragSourceMotionListener l) |
223 |
{ |
{ |
224 |
|
DnDEventMulticaster.add (dragSourceMotionListener, l); |
225 |
} |
} |
226 |
|
|
227 |
|
/** |
228 |
|
* @since 1.4 |
229 |
|
*/ |
230 |
public void removeDragSourceMotionListener(DragSourceMotionListener l) |
public void removeDragSourceMotionListener(DragSourceMotionListener l) |
231 |
{ |
{ |
232 |
|
DnDEventMulticaster.remove (dragSourceMotionListener, l); |
233 |
} |
} |
234 |
|
|
235 |
public DragSourceMotionListener[] getDragSourceMotionListeners() |
/** |
236 |
|
* @since 1.4 |
237 |
|
*/ |
238 |
|
public DragSourceMotionListener[] getDragSourceMotionListeners () |
239 |
{ |
{ |
240 |
return null; |
return (DragSourceMotionListener[]) getListeners |
241 |
|
(DragSourceMotionListener.class); |
242 |
} |
} |
243 |
|
|
244 |
public EventListener[] getListeners(Class type) |
/** |
245 |
|
* @since 1.4 |
246 |
|
*/ |
247 |
|
public EventListener[] getListeners (Class listenerType) |
248 |
{ |
{ |
249 |
return null; |
if (listenerType == DragSourceListener.class) |
250 |
|
return DnDEventMulticaster.getListeners (dragSourceListener, |
251 |
|
listenerType); |
252 |
|
|
253 |
|
if (listenerType == DragSourceMotionListener.class) |
254 |
|
return DnDEventMulticaster.getListeners (dragSourceMotionListener, |
255 |
|
listenerType); |
256 |
|
|
257 |
|
// Return an empty EventListener array. |
258 |
|
return new EventListener [0]; |
259 |
} |
} |
260 |
} // class DragSource |
} // class DragSource |