KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > event > WindowAdapter


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
8 package java.awt.event;
9
10 /**
11  * An abstract adapter class for receiving window events.
12  * The methods in this class are empty. This class exists as
13  * convenience for creating listener objects.
14  * <P>
15  * Extend this class to create a <code>WindowEvent</code> listener
16  * and override the methods for the events of interest. (If you implement the
17  * <code>WindowListener</code> interface, you have to define all of
18  * the methods in it. This abstract class defines null methods for them
19  * all, so you can only have to define methods for events you care about.)
20  * <P>
21  * Create a listener object using the extended class and then register it with
22  * a Window using the window's <code>addWindowListener</code>
23  * method. When the window's status changes by virtue of being opened,
24  * closed, activated or deactivated, iconified or deiconified,
25  * the relevant method in the listener
26  * object is invoked, and the <code>WindowEvent</code> is passed to it.
27  *
28  * @see WindowEvent
29  * @see WindowListener
30  * @see <a HREF="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window 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  * @author Carl Quinn
34  * @author Amy Fowler
35  * @author David Mendenhall
36  * @version 1.20, 12/19/03
37  * @since 1.1
38  */

39 public abstract class WindowAdapter
40     implements WindowListener JavaDoc, WindowStateListener JavaDoc, WindowFocusListener JavaDoc
41 {
42     /**
43      * Invoked when a window has been opened.
44      */

45     public void windowOpened(WindowEvent JavaDoc e) {}
46
47     /**
48      * Invoked when a window is in the process of being closed.
49      * The close operation can be overridden at this point.
50      */

51     public void windowClosing(WindowEvent JavaDoc e) {}
52
53     /**
54      * Invoked when a window has been closed.
55      */

56     public void windowClosed(WindowEvent JavaDoc e) {}
57
58     /**
59      * Invoked when a window is iconified.
60      */

61     public void windowIconified(WindowEvent JavaDoc e) {}
62
63     /**
64      * Invoked when a window is de-iconified.
65      */

66     public void windowDeiconified(WindowEvent JavaDoc e) {}
67
68     /**
69      * Invoked when a window is activated.
70      */

71     public void windowActivated(WindowEvent JavaDoc e) {}
72
73     /**
74      * Invoked when a window is de-activated.
75      */

76     public void windowDeactivated(WindowEvent JavaDoc e) {}
77
78     /**
79      * Invoked when a window state is changed.
80      * @since 1.4
81      */

82     public void windowStateChanged(WindowEvent JavaDoc e) {}
83
84     /**
85      * Invoked when the Window is set to be the focused Window, which means
86      * that the Window, or one of its subcomponents, will receive keyboard
87      * events.
88      *
89      * @since 1.4
90      */

91     public void windowGainedFocus(WindowEvent JavaDoc e) {}
92
93     /**
94      * Invoked when the Window is no longer the focused Window, which means
95      * that keyboard events will no longer be delivered to the Window or any of
96      * its subcomponents.
97      *
98      * @since 1.4
99      */

100     public void windowLostFocus(WindowEvent JavaDoc e) {}
101 }
102
Popular Tags