325N/A/*
325N/A * Copyright (c) 1997, 2003, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage java.awt.dnd;
325N/A
325N/Aimport java.util.EventListener;
325N/A
325N/A/**
325N/A * The <code>DragSourceListener</code> defines the
325N/A * event interface for originators of
325N/A * Drag and Drop operations to track the state of the user's gesture, and to
325N/A * provide appropriate &quot;drag over&quot;
325N/A * feedback to the user throughout the
325N/A * Drag and Drop operation.
325N/A * <p>
325N/A * The drop site is <i>associated with the previous <code>dragEnter()</code>
325N/A * invocation</i> if the latest invocation of <code>dragEnter()</code> on this
325N/A * listener:
325N/A * <ul>
325N/A * <li>corresponds to that drop site and
325N/A * <li> is not followed by a <code>dragExit()</code> invocation on this listener.
325N/A * </ul>
325N/A *
325N/A * @since 1.2
325N/A */
325N/A
325N/Apublic interface DragSourceListener extends EventListener {
325N/A
325N/A /**
325N/A * Called as the cursor's hotspot enters a platform-dependent drop site.
325N/A * This method is invoked when all the following conditions are true:
325N/A * <UL>
325N/A * <LI>The cursor's hotspot enters the operable part of a platform-
325N/A * dependent drop site.
325N/A * <LI>The drop site is active.
325N/A * <LI>The drop site accepts the drag.
325N/A * </UL>
325N/A *
325N/A * @param dsde the <code>DragSourceDragEvent</code>
325N/A */
325N/A void dragEnter(DragSourceDragEvent dsde);
325N/A
325N/A /**
325N/A * Called as the cursor's hotspot moves over a platform-dependent drop site.
325N/A * This method is invoked when all the following conditions are true:
325N/A * <UL>
325N/A * <LI>The cursor's hotspot has moved, but still intersects the
325N/A * operable part of the drop site associated with the previous
325N/A * dragEnter() invocation.
325N/A * <LI>The drop site is still active.
325N/A * <LI>The drop site accepts the drag.
325N/A * </UL>
325N/A *
325N/A * @param dsde the <code>DragSourceDragEvent</code>
325N/A */
325N/A void dragOver(DragSourceDragEvent dsde);
325N/A
325N/A /**
325N/A * Called when the user has modified the drop gesture.
325N/A * This method is invoked when the state of the input
325N/A * device(s) that the user is interacting with changes.
325N/A * Such devices are typically the mouse buttons or keyboard
325N/A * modifiers that the user is interacting with.
325N/A *
325N/A * @param dsde the <code>DragSourceDragEvent</code>
325N/A */
325N/A void dropActionChanged(DragSourceDragEvent dsde);
325N/A
325N/A /**
325N/A * Called as the cursor's hotspot exits a platform-dependent drop site.
325N/A * This method is invoked when any of the following conditions are true:
325N/A * <UL>
325N/A * <LI>The cursor's hotspot no longer intersects the operable part
325N/A * of the drop site associated with the previous dragEnter() invocation.
325N/A * </UL>
325N/A * OR
325N/A * <UL>
325N/A * <LI>The drop site associated with the previous dragEnter() invocation
325N/A * is no longer active.
325N/A * </UL>
325N/A * OR
325N/A * <UL>
325N/A * <LI> The drop site associated with the previous dragEnter() invocation
325N/A * has rejected the drag.
325N/A * </UL>
325N/A *
* @param dse the <code>DragSourceEvent</code>
*/
void dragExit(DragSourceEvent dse);
/**
* This method is invoked to signify that the Drag and Drop
* operation is complete. The getDropSuccess() method of
* the <code>DragSourceDropEvent</code> can be used to
* determine the termination state. The getDropAction() method
* returns the operation that the drop site selected
* to apply to the Drop operation. Once this method is complete, the
* current <code>DragSourceContext</code> and
* associated resources become invalid.
*
* @param dsde the <code>DragSourceDropEvent</code>
*/
void dragDropEnd(DragSourceDropEvent dsde);
}