1. /*
  2. * @(#)MouseAdapter.java 1.14 00/02/02
  3. *
  4. * Copyright 1996-2000 Sun Microsystems, Inc. All Rights Reserved.
  5. *
  6. * This software is the proprietary information of Sun Microsystems, Inc.
  7. * Use is subject to license terms.
  8. *
  9. */
  10. package java.awt.event;
  11. /**
  12. * An abstract adapter class for receiving mouse events.
  13. * The methods in this class are empty. This class exists as
  14. * convenience for creating listener objects.
  15. * <P>
  16. * Mouse events let you track when a mouse is pressed, released, clicked,
  17. * when it enters a component, and when it exits.
  18. * (To track mouse moves and mouse drags, use the MouseMotionAdapter.)
  19. * <P>
  20. * Extend this class to create a <code>MouseEvent</code> listener
  21. * and override the methods for the events of interest. (If you implement the
  22. * <code>MouseListener</code> interface, you have to define all of
  23. * the methods in it. This abstract class defines null methods for them
  24. * all, so you can only have to define methods for events you care about.)
  25. * <P>
  26. * Create a listener object using the extended class and then register it with
  27. * a component using the component's <code>addMouseListener</code>
  28. * method. When a mouse button is pressed, released, or clicked (pressed and
  29. * released), or when the mouse cursor enters or exits the component,
  30. * the relevant method in the listener object is invoked
  31. * and the <code>MouseEvent</code> is passed to it.
  32. *
  33. * @author Carl Quinn
  34. * @version 1.8 08/02/97
  35. *
  36. * @see MouseEvent
  37. * @see MouseListener
  38. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/mouselistener.html">Tutorial: Writing a Mouse Listener</a>
  39. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  40. *
  41. * @since 1.1
  42. */
  43. public abstract class MouseAdapter implements MouseListener {
  44. /**
  45. * Invoked when the mouse has been clicked on a component.
  46. */
  47. public void mouseClicked(MouseEvent e) {}
  48. /**
  49. * Invoked when a mouse button has been pressed on a component.
  50. */
  51. public void mousePressed(MouseEvent e) {}
  52. /**
  53. * Invoked when a mouse button has been released on a component.
  54. */
  55. public void mouseReleased(MouseEvent e) {}
  56. /**
  57. * Invoked when the mouse enters a component.
  58. */
  59. public void mouseEntered(MouseEvent e) {}
  60. /**
  61. * Invoked when the mouse exits a component.
  62. */
  63. public void mouseExited(MouseEvent e) {}
  64. }