Source Code Cross Referenced for InternalFrameEvent.java in  » 6.0-JDK-Core » swing » javax » swing » event » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
Java Source Code / Java Documentation
1.6.0 JDK Core
2.6.0 JDK Modules
3.6.0 JDK Modules com.sun
4.6.0 JDK Modules com.sun.java
5.6.0 JDK Modules sun
6.6.0 JDK Platform
7.Ajax
8.Apache Harmony Java SE
9.Aspect oriented
10.Authentication Authorization
11.Blogger System
12.Build
13.Byte Code
14.Cache
15.Chart
16.Chat
17.Code Analyzer
18.Collaboration
19.Content Management System
20.Database Client
21.Database DBMS
22.Database JDBC Connection Pool
23.Database ORM
24.Development
25.EJB Server
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » swing » javax.swing.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001        /*
002         * Copyright 1998-2001 Sun Microsystems, Inc.  All Rights Reserved.
003         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004         *
005         * This code is free software; you can redistribute it and/or modify it
006         * under the terms of the GNU General Public License version 2 only, as
007         * published by the Free Software Foundation.  Sun designates this
008         * particular file as subject to the "Classpath" exception as provided
009         * by Sun in the LICENSE file that accompanied this code.
010         *
011         * This code is distributed in the hope that it will be useful, but WITHOUT
012         * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013         * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
014         * version 2 for more details (a copy is included in the LICENSE file that
015         * accompanied this code).
016         *
017         * You should have received a copy of the GNU General Public License version
018         * 2 along with this work; if not, write to the Free Software Foundation,
019         * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020         *
021         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022         * CA 95054 USA or visit www.sun.com if you need additional information or
023         * have any questions.
024         */
025        package javax.swing.event;
026
027        import java.awt.AWTEvent;
028        import javax.swing.JInternalFrame;
029
030        /**
031         * An <code>AWTEvent</code> that adds support for
032         * <code>JInternalFrame</code> objects as the event source.  This class has the
033         * same event types as <code>WindowEvent</code>,
034         * although different IDs are used.
035         * Help on handling internal frame events
036         * is in 
037         * <a href="http://java.sun.com/docs/books/tutorial/uiswing/events/internalframelistener.html" target="_top">How to Write an Internal Frame Listener</a>,
038         * a section in <em>The Java Tutorial</em>.
039         * <p>
040         * <strong>Warning:</strong>
041         * Serialized objects of this class will not be compatible with
042         * future Swing releases. The current serialization support is
043         * appropriate for short term storage or RMI between applications running
044         * the same version of Swing.  As of 1.4, support for long term storage
045         * of all JavaBeans<sup><font size="-2">TM</font></sup>
046         * has been added to the <code>java.beans</code> package.
047         * Please see {@link java.beans.XMLEncoder}.
048         *
049         * @see java.awt.event.WindowEvent
050         * @see java.awt.event.WindowListener
051         * @see JInternalFrame
052         * @see InternalFrameListener
053         *
054         * @version 1.23 05/05/07
055         * @author Thomas Ball
056         */
057        public class InternalFrameEvent extends AWTEvent {
058
059            /**
060             * The first number in the range of IDs used for internal frame events.
061             */
062            public static final int INTERNAL_FRAME_FIRST = 25549;
063
064            /**
065             * The last number in the range of IDs used for internal frame events.
066             */
067            public static final int INTERNAL_FRAME_LAST = 25555;
068
069            /**
070             * The "window opened" event.  This event is delivered only
071             * the first time the internal frame is made visible.
072             *
073             * @see JInternalFrame#show
074             */
075            public static final int INTERNAL_FRAME_OPENED = INTERNAL_FRAME_FIRST;
076
077            /**
078             * The "window is closing" event. This event is delivered when
079             * the user attempts to close the internal frame, such as by
080             * clicking the internal frame's close button,
081             * or when a program attempts to close the internal frame 
082             * by invoking the <code>setClosed</code> method.
083             *
084             * @see JInternalFrame#setDefaultCloseOperation
085             * @see JInternalFrame#doDefaultCloseAction
086             * @see JInternalFrame#setClosed
087             */
088            public static final int INTERNAL_FRAME_CLOSING = 1 + INTERNAL_FRAME_FIRST;
089
090            /**
091             * The "window closed" event. This event is delivered after
092             * the internal frame has been closed as the result of a call to 
093             * the <code>setClosed</code> or
094             * <code>dispose</code> method.
095             *
096             * @see JInternalFrame#setClosed
097             * @see JInternalFrame#dispose
098             */
099            public static final int INTERNAL_FRAME_CLOSED = 2 + INTERNAL_FRAME_FIRST;
100
101            /**
102             * The "window iconified" event.
103             * This event indicates that the internal frame
104             * was shrunk down to a small icon.
105             * 
106             * @see JInternalFrame#setIcon
107             */
108            public static final int INTERNAL_FRAME_ICONIFIED = 3 + INTERNAL_FRAME_FIRST;
109
110            /**
111             * The "window deiconified" event type. This event indicates that the
112             * internal frame has been restored to its normal size.
113             *
114             * @see JInternalFrame#setIcon
115             */
116            public static final int INTERNAL_FRAME_DEICONIFIED = 4 + INTERNAL_FRAME_FIRST;
117
118            /**
119             * The "window activated" event type. This event indicates that keystrokes
120             * and mouse clicks are directed towards this internal frame.
121             *
122             * @see JInternalFrame#show
123             * @see JInternalFrame#setSelected
124             */
125            public static final int INTERNAL_FRAME_ACTIVATED = 5 + INTERNAL_FRAME_FIRST;
126
127            /**
128             * The "window deactivated" event type. This event indicates that keystrokes
129             * and mouse clicks are no longer directed to the internal frame.
130             *
131             * @see JInternalFrame#setSelected
132             */
133            public static final int INTERNAL_FRAME_DEACTIVATED = 6 + INTERNAL_FRAME_FIRST;
134
135            /**
136             * Constructs an <code>InternalFrameEvent</code> object.
137             * @param source the <code>JInternalFrame</code> object that originated the event
138             * @param id     an integer indicating the type of event
139             */
140            public InternalFrameEvent(JInternalFrame source, int id) {
141                super (source, id);
142            }
143
144            /**
145             * Returns a parameter string identifying this event.
146             * This method is useful for event logging and for debugging.
147             *
148             * @return a string identifying the event and its attributes
149             */
150            public String paramString() {
151                String typeStr;
152                switch (id) {
153                case INTERNAL_FRAME_OPENED:
154                    typeStr = "INTERNAL_FRAME_OPENED";
155                    break;
156                case INTERNAL_FRAME_CLOSING:
157                    typeStr = "INTERNAL_FRAME_CLOSING";
158                    break;
159                case INTERNAL_FRAME_CLOSED:
160                    typeStr = "INTERNAL_FRAME_CLOSED";
161                    break;
162                case INTERNAL_FRAME_ICONIFIED:
163                    typeStr = "INTERNAL_FRAME_ICONIFIED";
164                    break;
165                case INTERNAL_FRAME_DEICONIFIED:
166                    typeStr = "INTERNAL_FRAME_DEICONIFIED";
167                    break;
168                case INTERNAL_FRAME_ACTIVATED:
169                    typeStr = "INTERNAL_FRAME_ACTIVATED";
170                    break;
171                case INTERNAL_FRAME_DEACTIVATED:
172                    typeStr = "INTERNAL_FRAME_DEACTIVATED";
173                    break;
174                default:
175                    typeStr = "unknown type";
176                }
177                return typeStr;
178            }
179
180            /**
181             * Returns the originator of the event.
182             *
183             * @return the <code>JInternalFrame</code> object that originated the event
184             * @since 1.3
185             */
186
187            public JInternalFrame getInternalFrame() {
188                return (source instanceof  JInternalFrame) ? (JInternalFrame) source
189                        : null;
190            }
191
192        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.