1. /*
  2. * @(#)MouseMotionListener.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. 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 <code>MouseListener</code>.)
  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. * @author Amy Fowler
  26. * @version 1.15, 12/19/03
  27. *
  28. * @see MouseMotionAdapter
  29. * @see MouseEvent
  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. * @since 1.1
  34. */
  35. public interface MouseMotionListener extends EventListener {
  36. /**
  37. * Invoked when a mouse button is pressed on a component and then
  38. * dragged. <code>MOUSE_DRAGGED</code> events will continue to be
  39. * delivered to the component where the drag originated until the
  40. * mouse button is released (regardless of whether the mouse position
  41. * is within the bounds of the component).
  42. * <p>
  43. * Due to platform-dependent Drag&Drop implementations,
  44. * <code>MOUSE_DRAGGED</code> events may not be delivered during a native
  45. * Drag&Drop operation.
  46. */
  47. public void mouseDragged(MouseEvent e);
  48. /**
  49. * Invoked when the mouse cursor has been moved onto a component
  50. * but no buttons have been pushed.
  51. */
  52. public void mouseMoved(MouseEvent e);
  53. }