280
281 /**
282 * This method sets the permitted source drag action(s)
283 * for this Drag and Drop operation.
284 * <P>
285 * @param actions the permitted source drag action(s)
286 */
287
288 public synchronized void setSourceActions(int actions) {
289 sourceActions = actions & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
290 }
291
292 /**
293 * This method returns the first event in the
294 * series of events that initiated
295 * the Drag and Drop operation.
296 * <P>
297 * @return the initial event that triggered the drag gesture
298 */
299
300 public InputEvent getTriggerEvent() { return events.isEmpty() ? null : (InputEvent)events.get(0); }
301
302 /**
303 * Reset the Recognizer, if its currently recognizing a gesture, ignore
304 * it.
305 */
306
307 public void resetRecognizer() { events.clear(); }
308
309 /**
310 * Register a new <code>DragGestureListener</code>.
311 * <P>
312 * @param dgl the <code>DragGestureListener</code> to register
313 * with this <code>DragGestureRecognizer</code>.
314 * <P>
315 * @throws java.util.TooManyListenersException if a
316 * <code>DragGestureListener</code> has already been added.
317 */
318
319 public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException {
320 if (dragGestureListener != null)
|
280
281 /**
282 * This method sets the permitted source drag action(s)
283 * for this Drag and Drop operation.
284 * <P>
285 * @param actions the permitted source drag action(s)
286 */
287
288 public synchronized void setSourceActions(int actions) {
289 sourceActions = actions & (DnDConstants.ACTION_COPY_OR_MOVE | DnDConstants.ACTION_LINK);
290 }
291
292 /**
293 * This method returns the first event in the
294 * series of events that initiated
295 * the Drag and Drop operation.
296 * <P>
297 * @return the initial event that triggered the drag gesture
298 */
299
300 public InputEvent getTriggerEvent() { return events.isEmpty() ? null : events.get(0); }
301
302 /**
303 * Reset the Recognizer, if its currently recognizing a gesture, ignore
304 * it.
305 */
306
307 public void resetRecognizer() { events.clear(); }
308
309 /**
310 * Register a new <code>DragGestureListener</code>.
311 * <P>
312 * @param dgl the <code>DragGestureListener</code> to register
313 * with this <code>DragGestureRecognizer</code>.
314 * <P>
315 * @throws java.util.TooManyListenersException if a
316 * <code>DragGestureListener</code> has already been added.
317 */
318
319 public synchronized void addDragGestureListener(DragGestureListener dgl) throws TooManyListenersException {
320 if (dragGestureListener != null)
|