home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / awt / event / MouseMotionAdapter.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  2.5 KB  |  61 lines

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