Source Code Cross Referenced for ToolkitEventHandler.java in  » 6.0-JDK-Modules » j2me » sun » porting » toolkit » Java Source Code / Java DocumentationJava Source Code and Java Documentation

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 geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » sun.porting.toolkit 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * @(#)ToolkitEventHandler.java	1.17 06/10/10
003:         *
004:         * Copyright  1990-2006 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation. 
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt). 
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA 
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions. 
025:         *
026:         */
027:
028:        package sun.porting.toolkit;
029:
030:        import sun.porting.windowsystem.Window;
031:
032:        /**
033:         * <code>ToolkitEventHandler</code>
034:         * is the only interface that a toolkit presents to the underlying window 
035:         * system.  It is the means for delivering events up into the toolkit.  
036:         * All of the other interactions between the window system and the toolkit are 
037:         * in the other direction, i.e. the toolkit issues a directive and the window 
038:         * system executes it.)
039:         *
040:         * @version 1.12, 08/19/02
041:         */
042:        public interface ToolkitEventHandler {
043:            /**
044:             * Delimiting number: a pointer event will be greater than POINTER_EVENT_START.
045:             */
046:            final int POINTER_EVENT_START = 0100;
047:            /**
048:             * Event ID for a pointer press (i.e. a press associated with position
049:             * information, like a mouse click, touchscreen press, etc).
050:             */
051:            final int POINTER_PRESSED = 0101;
052:            /**
053:             * Event ID for a pointer release (i.e. a press associated with position
054:             * information, like a mouse click, touchscreen press, etc).  The window
055:             * system must guarantee that the release is delivered to the same window
056:             * that got the press, unless the focus was explicitly redirected by
057:             * the toolkit.
058:             */
059:            final int POINTER_RELEASED = 0102;
060:            /**
061:             * Event ID for a drag, i.e. a position change that occurs between
062:             * POINTER_PRESSED and POINTER_RELEASED.  The window system is responsible
063:             * for delivering all drags to the same window that got the press, unless
064:             * the focus is explicitly redirected by the toolkit.
065:             */
066:            final int POINTER_DRAGGED = 0104;
067:            /** 
068:             * Event ID for a position change.  This ID is used when the pointer is
069:             * being moved but no buttons (etc) are pressed, i.e. not a "drag" event.
070:             */
071:            final int POINTER_MOVED = 0103;
072:            /**
073:             * Delimiting number: a pointer event will be less than POINTER_EVENT_END.
074:             * (Note that this must be updated if new pointer events are added.)
075:             */
076:            final int POINTER_EVENT_END = 0104;
077:
078:            /**
079:             * Called by the window system in order to deliver a pointer event.
080:             * @param w The window in which the event occurred.
081:             * @param when Time at which the event occurred, in milliseconds since
082:             *        1/1/70 UTC.
083:             * @param x x coordinate of position at which the event occurred.
084:             * Coordinates are relative to the window.
085:             * @param y y coordinate of position at which the event occurred.
086:             * Coordinates are relative to the window.
087:             * @param ID Type identifier indicating the kind of event
088:             * @param number Used to distinguish among several buttons (etc) that 
089:             *        could have been pressed or released.
090:             * @see java.lang.System#currentTimeMillis
091:             */
092:            void pointerEventOccurred(Window w, long when, int x, int y,
093:                    int ID, int number);
094:
095:            /**
096:             * Delimiting number: a key event will be greater than KEY_EVENT_START.
097:             */
098:            final int KEY_EVENT_START = 0200;
099:            /**
100:             * Event ID for a key press corresponding to a typewriter-style keyboard.
101:             */
102:            final int KEY_PRESSED = 0201;
103:            /**
104:             * Event ID for a key press corresponding to a typewriter-style keyboard.
105:             */
106:            final int KEY_RELEASED = 0202;
107:            /**
108:             * Event ID for an event indicating that a character was typed.  This
109:             * event is only generated if the window system has taken responsiblity
110:             * for translating KEY_PRESSED/KEY_RELEASED events into characters.
111:             */
112:            final int KEY_TYPED = 0203;
113:            /**
114:             * Event ID for a press of special "non-keyboard" keys, like
115:             * a "GO" key on a remote control.
116:             */
117:            final int ACTION_PRESSED = 0204;
118:            /**
119:             * Event ID for a release of special "non-keyboard" keys, like
120:             * a "GO" key on a remote control.
121:             */
122:            final int ACTION_RELEASED = 0205;
123:            /**
124:             * Delimiting number: a key event will be less than KEY_EVENT_END.
125:             * (Note that this must be updated if new key events are added.)
126:             */
127:            final int KEY_EVENT_END = 0206;
128:
129:            /**
130:             * Called by the window system in order to deliver a keyboard event.
131:             * Keyboard events are delivered to the window that currently has input
132:             * focus; whether this is the window that contains the pointer depends on
133:             * the focus policy implemented by the toolkit.
134:             * @param win The window to which the event is directed (the focus window).
135:             * @param when Time at which the event occurred, in milliseconds since
136:             *        1/1/70 UTC.
137:             * @param ID Type identifier indicating the kind of event
138:             * @param keycode A code identifying which key was pressed.
139:             * @param keychar Unicode character -- for KEY_TYPED only.
140:             * @see java.awt.event.KeyEvent
141:             * @see java.lang.System#currentTimeMillis
142:             */
143:            void keyboardEventOccurred(Window win, long when, int ID,
144:                    int keycode, char keychar);
145:
146:            /**
147:             * Delimiting number: a window event will be greater than WINDOW_EVENT_START.
148:             */
149:            final int WINDOW_EVENT_START = 0300;
150:            /**
151:             * Event ID for indicating that a window has been reshaped (moved and/or
152:             * resized).  For this event, {x, y, w, h} are DELTA VALUES, not absolute.
153:             */
154:            final int WINDOW_RESHAPED = 0301;
155:            /**
156:             * Event ID for indicating that a window has been assigned keyboard focus.
157:             */
158:            final int WINDOW_GOT_FOCUS = 0302;
159:            /**
160:             * Event ID for indicating that a window no longer has the keyboard focus.
161:             */
162:            final int WINDOW_LOST_FOCUS = 0303;
163:            /**
164:             * Event ID for indicating that a region of a window needs to be repainted.
165:             */
166:            final int WINDOW_DAMAGED = 0304;
167:            /**
168:             * Event ID for indicating that the pointing device has entered the window.
169:             */
170:            final int WINDOW_ENTERED = 0305;
171:            /**
172:             * Event ID for indicating that the pointing device has left the window.
173:             */
174:            final int WINDOW_EXITED = 0306;
175:            /**
176:             * Event ID for indicating that a window has been mapped (made visible).
177:             * The toolkit is allowed to use this event for optimization
178:             * purposes but must not depend on it, because it is optional.
179:             */
180:            final int WINDOW_MAPPED = 0307;
181:            /**
182:             * Event ID for indicating that a window has been unmapped (made invisible).
183:             * The toolkit is allowed to use this event for optimization
184:             * purposes but must not depend on it, because it is optional.
185:             */
186:            final int WINDOW_UNMAPPED = 0310;
187:            /**
188:             * Event ID for indicating that a mapped window has been clipped and/or 
189:             * completely covered by one or more other windows (this could include 
190:             * its children).  When the window is no longer completely invisible,
191:             * window system is expected to generate WINDOW_DAMAGED events for the
192:             * newly-visible portions of the window.)
193:             * WINDOW_INVISIBLE events must not be generated when the window is
194:             * unmapped.
195:             * The toolkit is allowed to use this event for optimization
196:             * purposes but must not depend on it, because it is optional.
197:             */
198:            final int WINDOW_INVISIBLE = 0311;
199:            /**
200:             * Delimiting number: a window event will be less than WINDOW_EVENT_END.
201:             * (Note that this must be updated if new window events are added.)
202:             */
203:            final int WINDOW_EVENT_END = 0312;
204:
205:            /**
206:             * Called by the window system in order to deliver a window event.
207:             * @param win The window on which the event occurred.
208:             * @param when Time at which the event occurred, in milliseconds since
209:             *        1/1/70 UTC.
210:             * @param x x coordinate of position at which the event occurred.
211:             * @param y y coordinate of position at which the event occurred.  
212:             *        Coordinates are relative
213:             *        to the window's parent for a reshape or map event, but relative 
214:             *        to the window itself for other events (enter, exit, and damage).
215:             * @param w Width of window (reshape or map event) or of the
216:             *          area to be repainted (damage event).
217:             * @param h Width of window (reshape or map event) or of the
218:             *          area to be repainted (damage event).
219:             * @param ID Type identifier indicating the kind of event
220:             * @see java.awt.event.KeyEvent
221:             * @see java.lang.System#currentTimeMillis
222:             */
223:            void windowEventOccurred(Window win, long when, int x, int y,
224:                    int w, int h, int ID);
225:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.