01: /*
02: *
03: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
04: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License version
08: * 2 only, as published by the Free Software Foundation.
09: *
10: * This program is distributed in the hope that it will be useful, but
11: * WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * General Public License version 2 for more details (a copy is
14: * included at /legal/license.txt).
15: *
16: * You should have received a copy of the GNU General Public License
17: * version 2 along with this work; if not, write to the Free Software
18: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19: * 02110-1301 USA
20: *
21: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
22: * Clara, CA 95054 or visit www.sun.com if you need additional
23: * information or have any questions.
24: */
25: package java.awt.event;
26:
27: import java.util.EventListener;
28:
29: /**
30: * The listener interface for receiving <code>WindowEvents</code>, including
31: * <code>WINDOW_GAINED_FOCUS</code> and <code>WINDOW_LOST_FOCUS</code> events.
32: * The class that is interested in processing a <code>WindowEvent</code>
33: * either implements this interface (and
34: * all the methods it contains) or extends the abstract
35: * <code>WindowAdapter</code> class (overriding only the methods of interest).
36: * The listener object created from that class is then registered with a
37: * <code>Window</code>
38: * using the <code>Window</code>'s <code>addWindowFocusListener</code> method.
39: * When the <code>Window</code>'s
40: * status changes by virtue of it being opened, closed, activated, deactivated,
41: * iconified, or deiconified, or by focus being transfered into or out of the
42: * <code>Window</code>, the relevant method in the listener object is invoked,
43: * and the <code>WindowEvent</code> is passed to it.
44: *
45: * @author David Mendenhall
46: * @version 1.5, 01/23/03
47: *
48: * @see WindowAdapter
49: * @see WindowEvent
50: * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/windowlistener.html">Tutorial: Writing a Window Listener</a>
51: * @see <a href="http://www.awl.com/cp/javaseries/jcl1_2.html">Reference: The Java Class Libraries (update file)</a>
52: *
53: * @since 1.4
54: */
55: public interface WindowFocusListener extends EventListener {
56:
57: /**
58: * Invoked when the Window is set to be the focused Window, which means
59: * that the Window, or one of its subcomponents, will receive keyboard
60: * events.
61: */
62: public void windowGainedFocus(WindowEvent e);
63:
64: /**
65: * Invoked when the Window is no longer the focused Window, which means
66: * that keyboard events will no longer be delivered to the Window or any of
67: * its subcomponents.
68: */
69: public void windowLostFocus(WindowEvent e);
70: }
|