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

Print this page




 436      * <code>DropTargetListener</code> and passes it
 437      * the specified <code>DropTargetDropEvent</code>
 438      * if this <code>DropTarget</code> is active.
 439      *
 440      * @param dtde the <code>DropTargetDropEvent</code>
 441      *
 442      * @throws NullPointerException if <code>dtde</code> is null
 443      *         and at least one of the following is true: this
 444      *         <code>DropTarget</code> is not active, or there is
 445      *         no a <code>DropTargetListener</code> registered.
 446      *
 447      * @see #isActive
 448      */
 449     public synchronized void drop(DropTargetDropEvent dtde) {
 450         isDraggingInside = false;
 451 
 452         clearAutoscroll();
 453 
 454         if (dtListener != null && active)
 455             dtListener.drop(dtde);
 456         else { // we should'nt get here ...
 457             dtde.rejectDrop();
 458         }
 459     }
 460 
 461     /**
 462      * Gets the <code>FlavorMap</code>
 463      * associated with this <code>DropTarget</code>.
 464      * If no <code>FlavorMap</code> has been set for this
 465      * <code>DropTarget</code>, it is associated with the default
 466      * <code>FlavorMap</code>.
 467      *
 468      * @return the FlavorMap for this DropTarget
 469      */
 470 
 471     public FlavorMap getFlavorMap() { return flavorMap; }
 472 
 473     /**
 474      * Sets the <code>FlavorMap</code> associated
 475      * with this <code>DropTarget</code>.
 476      *




 436      * <code>DropTargetListener</code> and passes it
 437      * the specified <code>DropTargetDropEvent</code>
 438      * if this <code>DropTarget</code> is active.
 439      *
 440      * @param dtde the <code>DropTargetDropEvent</code>
 441      *
 442      * @throws NullPointerException if <code>dtde</code> is null
 443      *         and at least one of the following is true: this
 444      *         <code>DropTarget</code> is not active, or there is
 445      *         no a <code>DropTargetListener</code> registered.
 446      *
 447      * @see #isActive
 448      */
 449     public synchronized void drop(DropTargetDropEvent dtde) {
 450         isDraggingInside = false;
 451 
 452         clearAutoscroll();
 453 
 454         if (dtListener != null && active)
 455             dtListener.drop(dtde);
 456         else { // we shouldn't get here ...
 457             dtde.rejectDrop();
 458         }
 459     }
 460 
 461     /**
 462      * Gets the <code>FlavorMap</code>
 463      * associated with this <code>DropTarget</code>.
 464      * If no <code>FlavorMap</code> has been set for this
 465      * <code>DropTarget</code>, it is associated with the default
 466      * <code>FlavorMap</code>.
 467      *
 468      * @return the FlavorMap for this DropTarget
 469      */
 470 
 471     public FlavorMap getFlavorMap() { return flavorMap; }
 472 
 473     /**
 474      * Sets the <code>FlavorMap</code> associated
 475      * with this <code>DropTarget</code>.
 476      *