< prev index next >

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

Print this page


   1 /*
   2  * Copyright (c) 2001, 2003, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  54  * {@code Component} higher in the Z-order that has an associated active
  55  * {@code DropTarget}.
  56  * <p>
  57  * During the drag, the data associated with the current drag operation can be
  58  * retrieved by calling {@code getTransferable()} on
  59  * {@code DropTargetDragEvent} instances passed to the listener's
  60  * methods.
  61  * <p>
  62  * Note that {@code getTransferable()} on the
  63  * {@code DropTargetDragEvent} instance should only be called within the
  64  * respective listener's method and all the necessary data should be retrieved
  65  * from the returned {@code Transferable} before that method returns.
  66  *
  67  * @see DropTargetEvent
  68  * @see DropTargetListener
  69  *
  70  * @author David Mendenhall
  71  * @since 1.4
  72  */
  73 public abstract class DropTargetAdapter implements DropTargetListener {





  74 
  75     /**
  76      * Called while a drag operation is ongoing, when the mouse pointer enters
  77      * the operable part of the drop site for the {@code DropTarget}
  78      * registered with this listener.
  79      *
  80      * @param dtde the {@code DropTargetDragEvent}
  81      */
  82     public void dragEnter(DropTargetDragEvent dtde) {}
  83 
  84     /**
  85      * Called when a drag operation is ongoing, while the mouse pointer is still
  86      * over the operable part of the drop site for the {@code DropTarget}
  87      * registered with this listener.
  88      *
  89      * @param dtde the {@code DropTargetDragEvent}
  90      */
  91     public void dragOver(DropTargetDragEvent dtde) {}
  92 
  93     /**
   1 /*
   2  * Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  54  * {@code Component} higher in the Z-order that has an associated active
  55  * {@code DropTarget}.
  56  * <p>
  57  * During the drag, the data associated with the current drag operation can be
  58  * retrieved by calling {@code getTransferable()} on
  59  * {@code DropTargetDragEvent} instances passed to the listener's
  60  * methods.
  61  * <p>
  62  * Note that {@code getTransferable()} on the
  63  * {@code DropTargetDragEvent} instance should only be called within the
  64  * respective listener's method and all the necessary data should be retrieved
  65  * from the returned {@code Transferable} before that method returns.
  66  *
  67  * @see DropTargetEvent
  68  * @see DropTargetListener
  69  *
  70  * @author David Mendenhall
  71  * @since 1.4
  72  */
  73 public abstract class DropTargetAdapter implements DropTargetListener {
  74 
  75     /**
  76      * Constructs a {@code DropTargetAdapter}.
  77      */
  78     protected DropTargetAdapter() {}
  79 
  80     /**
  81      * Called while a drag operation is ongoing, when the mouse pointer enters
  82      * the operable part of the drop site for the {@code DropTarget}
  83      * registered with this listener.
  84      *
  85      * @param dtde the {@code DropTargetDragEvent}
  86      */
  87     public void dragEnter(DropTargetDragEvent dtde) {}
  88 
  89     /**
  90      * Called when a drag operation is ongoing, while the mouse pointer is still
  91      * over the operable part of the drop site for the {@code DropTarget}
  92      * registered with this listener.
  93      *
  94      * @param dtde the {@code DropTargetDragEvent}
  95      */
  96     public void dragOver(DropTargetDragEvent dtde) {}
  97 
  98     /**
< prev index next >