< prev index next >

src/java.desktop/share/classes/java/awt/dnd/DragSourceContext.java

Print this page




 262      * Returns the {@code DragGestureEvent}
 263      * that initially triggered the drag.
 264      *
 265      * @return the Event that triggered the drag
 266      */
 267 
 268     public DragGestureEvent getTrigger() { return trigger; }
 269 
 270     /**
 271      * Returns a bitwise mask of {@code DnDConstants} that
 272      * represent the set of drop actions supported by the drag source for the
 273      * drag operation associated with this {@code DragSourceContext}.
 274      *
 275      * @return the drop actions supported by the drag source
 276      */
 277     public int  getSourceActions() {
 278         return sourceActions;
 279     }
 280 
 281     /**
 282      * Sets the cursor for this drag operation to the specified
 283      * {@code Cursor}.  If the specified {@code Cursor}
 284      * is {@code null}, the default drag cursor behavior is
 285      * activated for this drag operation, otherwise it is deactivated.
 286      *
 287      * @param c     the initial {@code Cursor} for this drag operation,
 288      *                       or {@code null} for the default cursor handling;
 289      *                       see {@linkplain Cursor class
 290      *                       level documentation} for more details
 291      *                       on the cursor handling during drag and drop
 292      *
 293      */
 294 
 295     public synchronized void setCursor(Cursor c) {
 296         useCustomCursor = (c != null);
 297         setCursorImpl(c);
 298     }
 299 
 300     /**
 301      * Returns the current drag {@code Cursor}.
 302      *
 303      * @return the current drag {@code Cursor}


 304      */
 305 
 306     public Cursor getCursor() { return cursor; }
 307 
 308     /**
 309      * Add a {@code DragSourceListener} to this
 310      * {@code DragSourceContext} if one has not already been added.
 311      * If a {@code DragSourceListener} already exists,
 312      * this method throws a {@code TooManyListenersException}.
 313      *
 314      * @param dsl the {@code DragSourceListener} to add.
 315      * Note that while {@code null} is not prohibited,
 316      * it is not acceptable as a parameter.
 317      *
 318      * @throws TooManyListenersException if
 319      * a {@code DragSourceListener} has already been added
 320      */
 321 
 322     public synchronized void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException {
 323         if (dsl == null) return;




 262      * Returns the {@code DragGestureEvent}
 263      * that initially triggered the drag.
 264      *
 265      * @return the Event that triggered the drag
 266      */
 267 
 268     public DragGestureEvent getTrigger() { return trigger; }
 269 
 270     /**
 271      * Returns a bitwise mask of {@code DnDConstants} that
 272      * represent the set of drop actions supported by the drag source for the
 273      * drag operation associated with this {@code DragSourceContext}.
 274      *
 275      * @return the drop actions supported by the drag source
 276      */
 277     public int  getSourceActions() {
 278         return sourceActions;
 279     }
 280 
 281     /**
 282      * Sets the custom cursor for this drag operation to the specified
 283      * {@code Cursor}.  If the specified {@code Cursor}
 284      * is {@code null}, the default drag cursor behavior is
 285      * activated for this drag operation, otherwise it is deactivated.
 286      *
 287      * @param c     the initial {@code Cursor} for this drag operation,
 288      *                       or {@code null} for the default cursor handling;
 289      *                       see {@linkplain Cursor class
 290      *                       level documentation} for more details
 291      *                       on the cursor handling during drag and drop
 292      *
 293      */
 294 
 295     public synchronized void setCursor(Cursor c) {
 296         useCustomCursor = (c != null);
 297         setCursorImpl(c);
 298     }
 299 
 300     /**
 301      * Returns the current custom drag {@code Cursor}.
 302      *
 303      * @return the current custom drag {@code Cursor}, if it was set
 304      *         otherwise returns {@code null}. 
 305      * @see #setCursor
 306      */
 307 
 308     public Cursor getCursor() { return cursor; }
 309 
 310     /**
 311      * Add a {@code DragSourceListener} to this
 312      * {@code DragSourceContext} if one has not already been added.
 313      * If a {@code DragSourceListener} already exists,
 314      * this method throws a {@code TooManyListenersException}.
 315      *
 316      * @param dsl the {@code DragSourceListener} to add.
 317      * Note that while {@code null} is not prohibited,
 318      * it is not acceptable as a parameter.
 319      *
 320      * @throws TooManyListenersException if
 321      * a {@code DragSourceListener} has already been added
 322      */
 323 
 324     public synchronized void addDragSourceListener(DragSourceListener dsl) throws TooManyListenersException {
 325         if (dsl == null) return;


< prev index next >