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