< prev index next >

src/java.desktop/share/classes/java/awt/dnd/DragSourceAdapter.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


  39  * Create a listener object using the extended class and then register it with
  40  * a {@code DragSource}. When the drag enters, moves over, or exits
  41  * a drop site, when the drop action changes, and when the drag ends, the
  42  * relevant method in the listener object is invoked, and the
  43  * {@code DragSourceEvent} is passed to it.
  44  * <p>
  45  * The drop site is <i>associated with the previous {@code dragEnter()}
  46  * invocation</i> if the latest invocation of {@code dragEnter()} on this
  47  * adapter corresponds to that drop site and is not followed by a
  48  * {@code dragExit()} invocation on this adapter.
  49  *
  50  * @see DragSourceEvent
  51  * @see DragSourceListener
  52  * @see DragSourceMotionListener
  53  *
  54  * @author David Mendenhall
  55  * @since 1.4
  56  */
  57 public abstract class DragSourceAdapter
  58     implements DragSourceListener, DragSourceMotionListener {





  59 
  60     /**
  61      * Called as the cursor's hotspot enters a platform-dependent drop site.
  62      * This method is invoked when all the following conditions are true:
  63      * <UL>
  64      * <LI>The cursor's hotspot enters the operable part of
  65      * a platform-dependent drop site.
  66      * <LI>The drop site is active.
  67      * <LI>The drop site accepts the drag.
  68      * </UL>
  69      *
  70      * @param dsde the {@code DragSourceDragEvent}
  71      */
  72     public void dragEnter(DragSourceDragEvent dsde) {}
  73 
  74     /**
  75      * Called as the cursor's hotspot moves over a platform-dependent drop site.
  76      * This method is invoked when all the following conditions are true:
  77      * <UL>
  78      * <LI>The cursor's hotspot has moved, but still intersects the


   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


  39  * Create a listener object using the extended class and then register it with
  40  * a {@code DragSource}. When the drag enters, moves over, or exits
  41  * a drop site, when the drop action changes, and when the drag ends, the
  42  * relevant method in the listener object is invoked, and the
  43  * {@code DragSourceEvent} is passed to it.
  44  * <p>
  45  * The drop site is <i>associated with the previous {@code dragEnter()}
  46  * invocation</i> if the latest invocation of {@code dragEnter()} on this
  47  * adapter corresponds to that drop site and is not followed by a
  48  * {@code dragExit()} invocation on this adapter.
  49  *
  50  * @see DragSourceEvent
  51  * @see DragSourceListener
  52  * @see DragSourceMotionListener
  53  *
  54  * @author David Mendenhall
  55  * @since 1.4
  56  */
  57 public abstract class DragSourceAdapter
  58     implements DragSourceListener, DragSourceMotionListener {
  59 
  60     /**
  61      * Constructs a {@code DragSourceAdapter}.
  62      */
  63     protected DragSourceAdapter() {}
  64 
  65     /**
  66      * Called as the cursor's hotspot enters a platform-dependent drop site.
  67      * This method is invoked when all the following conditions are true:
  68      * <UL>
  69      * <LI>The cursor's hotspot enters the operable part of
  70      * a platform-dependent drop site.
  71      * <LI>The drop site is active.
  72      * <LI>The drop site accepts the drag.
  73      * </UL>
  74      *
  75      * @param dsde the {@code DragSourceDragEvent}
  76      */
  77     public void dragEnter(DragSourceDragEvent dsde) {}
  78 
  79     /**
  80      * Called as the cursor's hotspot moves over a platform-dependent drop site.
  81      * This method is invoked when all the following conditions are true:
  82      * <UL>
  83      * <LI>The cursor's hotspot has moved, but still intersects the


< prev index next >