1 /* 2 * @(#)MouseMotionAdapter.java 1.15 03/12/19 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.awt.event; 9 10 /** 11 * An abstract adapter class for receiving mouse motion events. 12 * The methods in this class are empty. This class exists as 13 * convenience for creating listener objects. 14 * <P> 15 * Mouse motion events occur when a mouse is moved or dragged. 16 * (Many such events will be generated in a normal program. 17 * To track clicks and other mouse events, use the MouseAdapter.) 18 * <P> 19 * Extend this class to create a <code>MouseEvent</code> listener 20 * and override the methods for the events of interest. (If you implement the 21 * <code>MouseMotionListener</code> interface, you have to define all of 22 * the methods in it. This abstract class defines null methods for them 23 * all, so you can only have to define methods for events you care about.) 24 * <P> 25 * Create a listener object using the extended class and then register it with 26 * a component using the component's <code>addMouseMotionListener</code> 27 * method. When the mouse is moved or dragged, the relevant method in the 28 * listener object is invoked and the <code>MouseEvent</code> is passed to it. 29 * 30 * @author Amy Fowler 31 * @version 1.15 12/19/03 32 * 33 * @see MouseEvent 34 * @see MouseMotionListener 35 * @see <a HREF="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a> 36 * @see <a HREF="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a> 37 * 38 * @since 1.1 39 */ 40 public abstract class MouseMotionAdapter implements MouseMotionListener { 41 /** 42 * Invoked when a mouse button is pressed on a component and then 43 * dragged. Mouse drag events will continue to be delivered to 44 * the component where the first originated until the mouse button is 45 * released (regardless of whether the mouse position is within the 46 * bounds of the component). 47 */ 48 public void mouseDragged(MouseEvent e) {} 49 50 /** 51 * Invoked when the mouse button has been moved on a component 52 * (with no buttons no down). 53 */ 54 public void mouseMoved(MouseEvent e) {} 55 } 56