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. 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>MouseEvent</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. * @author Amy Fowler
  29. * @version 1.15 12/19/03
  30. *
  31. * @see MouseEvent
  32. * @see MouseMotionListener
  33. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
  34. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  35. *
  36. * @since 1.1
  37. */
  38. public abstract class MouseMotionAdapter implements MouseMotionListener {
  39. /**
  40. * Invoked when a mouse button is pressed on a component and then
  41. * dragged. Mouse drag events will continue to be delivered to
  42. * the component where the first originated until the mouse button is
  43. * released (regardless of whether the mouse position is within the
  44. * bounds of the component).
  45. */
  46. public void mouseDragged(MouseEvent e) {}
  47. /**
  48. * Invoked when the mouse button has been moved on a component
  49. * (with no buttons no down).
  50. */
  51. public void mouseMoved(MouseEvent e) {}
  52. }