1. /*
  2. * @(#)WindowAdapter.java 1.20 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 window events.
  10. * The methods in this class are empty. This class exists as
  11. * convenience for creating listener objects.
  12. * <P>
  13. * Extend this class to create a <code>WindowEvent</code> listener
  14. * and override the methods for the events of interest. (If you implement the
  15. * <code>WindowListener</code> interface, you have to define all of
  16. * the methods in it. This abstract class defines null methods for them
  17. * all, so you can only have to define methods for events you care about.)
  18. * <P>
  19. * Create a listener object using the extended class and then register it with
  20. * a Window using the window's <code>addWindowListener</code>
  21. * method. When the window's status changes by virtue of being opened,
  22. * closed, activated or deactivated, iconified or deiconified,
  23. * the relevant method in the listener
  24. * object is invoked, and the <code>WindowEvent</code> is passed to it.
  25. *
  26. * @see WindowEvent
  27. * @see WindowListener
  28. * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
  29. * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
  30. *
  31. * @author Carl Quinn
  32. * @author Amy Fowler
  33. * @author David Mendenhall
  34. * @version 1.20, 12/19/03
  35. * @since 1.1
  36. */
  37. public abstract class WindowAdapter
  38. implements WindowListener, WindowStateListener, WindowFocusListener
  39. {
  40. /**
  41. * Invoked when a window has been opened.
  42. */
  43. public void windowOpened(WindowEvent e) {}
  44. /**
  45. * Invoked when a window is in the process of being closed.
  46. * The close operation can be overridden at this point.
  47. */
  48. public void windowClosing(WindowEvent e) {}
  49. /**
  50. * Invoked when a window has been closed.
  51. */
  52. public void windowClosed(WindowEvent e) {}
  53. /**
  54. * Invoked when a window is iconified.
  55. */
  56. public void windowIconified(WindowEvent e) {}
  57. /**
  58. * Invoked when a window is de-iconified.
  59. */
  60. public void windowDeiconified(WindowEvent e) {}
  61. /**
  62. * Invoked when a window is activated.
  63. */
  64. public void windowActivated(WindowEvent e) {}
  65. /**
  66. * Invoked when a window is de-activated.
  67. */
  68. public void windowDeactivated(WindowEvent e) {}
  69. /**
  70. * Invoked when a window state is changed.
  71. * @since 1.4
  72. */
  73. public void windowStateChanged(WindowEvent e) {}
  74. /**
  75. * Invoked when the Window is set to be the focused Window, which means
  76. * that the Window, or one of its subcomponents, will receive keyboard
  77. * events.
  78. *
  79. * @since 1.4
  80. */
  81. public void windowGainedFocus(WindowEvent e) {}
  82. /**
  83. * Invoked when the Window is no longer the focused Window, which means
  84. * that keyboard events will no longer be delivered to the Window or any of
  85. * its subcomponents.
  86. *
  87. * @since 1.4
  88. */
  89. public void windowLostFocus(WindowEvent e) {}
  90. }