1. /*
  2. * @(#)MouseMotionListener.java 1.7 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. import java.util.EventListener;
  9. /**
  10. * The listener interface for receiving mouse motion events on a component.
  11. * (For clicks and other mouse events, use the MouseListener.)
  12. * <P>
  13. * The class that is interested in processing a mouse motion event
  14. * either implements this interface (and all the methods it
  15. * contains) or extends the abstract <code>MouseMotionAdapter</code> class
  16. * (overriding only the methods of interest).
  17. * <P>
  18. * The listener object created from that class is then registered with a
  19. * component using the component's <code>addMouseMotionListener</code>
  20. * method. A mouse motion event is generated when the mouse is moved
  21. * or dragged. (Many such events will be generated). When a mouse motion event
  22. * occurs, the relevant method in the listener object is invoked, and
  23. * the <code>MouseEvent</code> is passed to it.
  24. *
  25. * @see MouseMotionAdapter
  26. * @see MouseEvent
  27. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mousemotionlistener.html">Tutorial: Writing a Mouse Motion Listener</a>
  28. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  29. *
  30. * @version 1.7 11/29/01
  31. * @author Amy Fowler
  32. */
  33. public interface MouseMotionListener extends EventListener {
  34. /**
  35. * Invoked when a mouse button is pressed on a component and then
  36. * dragged. Mouse drag events will continue to be delivered to
  37. * the component where the first originated until the mouse button is
  38. * released (regardless of whether the mouse position is within the
  39. * bounds of the component).
  40. */
  41. public void mouseDragged(MouseEvent e);
  42. /**
  43. * Invoked when the mouse button has been moved on a component
  44. * (with no buttons no down).
  45. */
  46. public void mouseMoved(MouseEvent e);
  47. }