01 /*
02 * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package java.awt.event;
27
28 import java.util.EventListener;
29
30 /**
31 * The listener interface for receiving mouse motion events on a component.
32 * (For clicks and other mouse events, use the <code>MouseListener</code>.)
33 * <P>
34 * The class that is interested in processing a mouse motion event
35 * either implements this interface (and all the methods it
36 * contains) or extends the abstract <code>MouseMotionAdapter</code> class
37 * (overriding only the methods of interest).
38 * <P>
39 * The listener object created from that class is then registered with a
40 * component using the component's <code>addMouseMotionListener</code>
41 * method. A mouse motion event is generated when the mouse is moved
42 * or dragged. (Many such events will be generated). When a mouse motion event
43 * occurs, the relevant method in the listener object is invoked, and
44 * the <code>MouseEvent</code> is passed to it.
45 *
46 * @author Amy Fowler
47 * @version 1.23, 05/05/07
48 *
49 * @see MouseMotionAdapter
50 * @see MouseEvent
51 * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
52 *
53 * @since 1.1
54 */
55 public interface MouseMotionListener extends EventListener {
56
57 /**
58 * Invoked when a mouse button is pressed on a component and then
59 * dragged. <code>MOUSE_DRAGGED</code> events will continue to be
60 * delivered to the component where the drag originated until the
61 * mouse button is released (regardless of whether the mouse position
62 * is within the bounds of the component).
63 * <p>
64 * Due to platform-dependent Drag&Drop implementations,
65 * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
66 * Drag&Drop operation.
67 */
68 public void mouseDragged(MouseEvent e);
69
70 /**
71 * Invoked when the mouse cursor has been moved onto a component
72 * but no buttons have been pushed.
73 */
74 public void mouseMoved(MouseEvent e);
75
76 }
|