Java Doc for Event.java in  » 6.0-JDK-Modules » j2me » java » awt » 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 » java.awt 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.awt.Event

Event
public class Event implements java.io.Serializable(Code)
Event is a platform-independent class that encapsulates events from the platform's Graphical User Interface in the Java 1.0 event model. In Java 1.1 and later versions, the Event class is maintained only for backwards compatibilty. The information in this class description is provided to assist programmers in converting Java 1.0 programs to the new event model.

In the Java 1.0 event model, an event contains an id field that indicates what type of event it is and which other Event variables are relevant for the event.

For keyboard events, key contains a value indicating which key was activated, and modifiers contains the modifiers for that event. For the KEY_PRESS and KEY_RELEASE event ids, the value of key is the unicode character code for the key. For KEY_ACTION and KEY_ACTION_RELEASE, the value of key is one of the defined action-key identifiers in the Event class (PGUP, PGDN, F1, F2, etc).
version:
   1.62 08/19/02
author:
   Sami Shaio
since:
   JDK1.0



Field Summary
final public static  intACTION_EVENT
     This event indicates that the user wants some action to occur.
final public static  intALT_MASK
     This flag indicates that the Alt key was down when the event occurred.
final public static  intBACK_SPACE
     The BackSpace key.
final public static  intCAPS_LOCK
     The Caps Lock key, a non-ASCII action key.
final public static  intCTRL_MASK
     This flag indicates that the Control key was down when the event occurred.
final public static  intDELETE
     The Delete key.
final public static  intDOWN
     The Down Arrow key, a non-ASCII action key.
final public static  intEND
     The End key, a non-ASCII action key.
final public static  intENTER
     The Enter key.
final public static  intESCAPE
     The Escape key.
final public static  intF1
     The F1 function key, a non-ASCII action key.
final public static  intF10
     The F10 function key, a non-ASCII action key.
final public static  intF11
     The F11 function key, a non-ASCII action key.
final public static  intF12
     The F12 function key, a non-ASCII action key.
final public static  intF2
     The F2 function key, a non-ASCII action key.
final public static  intF3
     The F3 function key, a non-ASCII action key.
final public static  intF4
     The F4 function key, a non-ASCII action key.
final public static  intF5
     The F5 function key, a non-ASCII action key.
final public static  intF6
     The F6 function key, a non-ASCII action key.
final public static  intF7
     The F7 function key, a non-ASCII action key.
final public static  intF8
     The F8 function key, a non-ASCII action key.
final public static  intF9
     The F9 function key, a non-ASCII action key.
final public static  intGOT_FOCUS
     A component gained the focus.
final public static  intHOME
     The Home key, a non-ASCII action key.
final public static  intINSERT
     The Insert key, a non-ASCII action key.
final public static  intKEY_ACTION
     The user has pressed a non-ASCII action key.
final public static  intKEY_ACTION_RELEASE
     The user has released a non-ASCII action key.
final public static  intKEY_PRESS
     The user has pressed a normal key.
final public static  intKEY_RELEASE
     The user has released a normal key.
final public static  intLEFT
     The Left Arrow key, a non-ASCII action key.
final public static  intLIST_DESELECT
     An item in a list has been deselected.
final public static  intLIST_SELECT
     An item in a list has been selected.
final public static  intLOAD_FILE
     A file loading event.
final public static  intLOST_FOCUS
     A component lost the focus.
final public static  intMETA_MASK
     This flag indicates that the Meta key was down when the event occurred.
final public static  intMOUSE_DOWN
     The user has pressed the mouse button.
final public static  intMOUSE_DRAG
     The user has moved the mouse with a button pressed.
final public static  intMOUSE_ENTER
     The mouse has entered a component.
final public static  intMOUSE_EXIT
     The mouse has exited a component.
final public static  intMOUSE_MOVE
     The mouse has moved with no button pressed.
final public static  intMOUSE_UP
     The user has released the mouse button.
final public static  intNUM_LOCK
     The Num Lock key, a non-ASCII action key.
final public static  intPAUSE
     The Pause key, a non-ASCII action key.
final public static  intPGDN
     The Page Down key, a non-ASCII action key.
final public static  intPGUP
     The Page Up key, a non-ASCII action key.
final public static  intPRINT_SCREEN
     The Print Screen key, a non-ASCII action key.
final public static  intRIGHT
     The Right Arrow key, a non-ASCII action key.
final public static  intSAVE_FILE
     A file saving event.
final public static  intSCROLL_ABSOLUTE
     The user has moved the bubble (thumb) in a scroll bar, moving to an "absolute" position, rather than to an offset from the last postion.
final public static  intSCROLL_BEGIN
     The scroll begin event.
final public static  intSCROLL_END
     The scroll end event.
final public static  intSCROLL_LINE_DOWN
     The user has activated the line down area of a scroll bar.
final public static  intSCROLL_LINE_UP
     The user has activated the line up area of a scroll bar.
final public static  intSCROLL_LOCK
     The Scroll Lock key, a non-ASCII action key.
final public static  intSCROLL_PAGE_DOWN
     The user has activated the page down area of a scroll bar.
final public static  intSCROLL_PAGE_UP
     The user has activated the page up area of a scroll bar.
final public static  intSHIFT_MASK
     This flag indicates that the Shift key was down when the event occurred.
final public static  intTAB
     The Tab key.
final public static  intUP
     The Up Arrow key, a non-ASCII action key.
final public static  intWINDOW_DEICONIFY
     The user has asked the window manager to de-iconify the window.
final public static  intWINDOW_DESTROY
     The user has asked the window manager to kill the window.
final public static  intWINDOW_EXPOSE
     The user has asked the window manager to expose the window.
final public static  intWINDOW_ICONIFY
     The user has asked the window manager to iconify the window.
final public static  intWINDOW_MOVED
     The user has asked the window manager to move the window.
public  Objectarg
     An arbitrary argument of the event.
public  intclickCount
     For MOUSE_DOWN events, this field indicates the number of consecutive clicks.
public  Eventevt
     The next event.
public  intid
     Indicates which type of event the event is, and which other Event variables are relevant for the event.
public  intkey
     The key code of the key that was pressed in a keyboard event.
public  intmodifiers
     The state of the modifier keys.

NOTE: changing the modifier keys is not recommended, because many native implementations do not recognize modifier changes.

public  Objecttarget
     The target component.
public  longwhen
     The time stamp.
public  intx
     The x coordinate of the event.
public  inty
     The y coordinate of the event.

Constructor Summary
public  Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)
     Creates an instance of Event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and argument.
public  Event(Object target, long when, int id, int x, int y, int key, int modifiers)
     Creates an instance of Event, with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and an argument set to null.
public  Event(Object target, int id, Object arg)
     Creates an instance of Event with the specified target component, event type, and argument.

Method Summary
 voidconsume()
    
public  booleancontrolDown()
     Checks if the Control key is down.
 chargetKeyEventChar()
    
static  intgetOldEventKey(KeyEvent e)
    
 booleanisConsumed()
    
public  booleanmetaDown()
     Checks if the Meta key is down.
protected  StringparamString()
     Returns the parameter string representing this event.
public  booleanshiftDown()
     Checks if the Shift key is down.
public  StringtoString()
     Returns a representation of this event's values as a string.
public  voidtranslate(int x, int y)
     Translates this event so that its x and y coordinates are increased by dx and dy, respectively.

Field Detail
ACTION_EVENT
final public static int ACTION_EVENT(Code)
This event indicates that the user wants some action to occur.
since:
   JDK1.0



ALT_MASK
final public static int ALT_MASK(Code)
This flag indicates that the Alt key was down when the event occurred. For mouse events, this flag indicates that the middle mouse button was pressed or released.
since:
   JDK1.0



BACK_SPACE
final public static int BACK_SPACE(Code)
The BackSpace key.
since:
   JDK1.0



CAPS_LOCK
final public static int CAPS_LOCK(Code)
The Caps Lock key, a non-ASCII action key.
since:
   JDK1.0



CTRL_MASK
final public static int CTRL_MASK(Code)
This flag indicates that the Control key was down when the event occurred.
since:
   JDK1.0



DELETE
final public static int DELETE(Code)
The Delete key.
since:
   JDK1.0



DOWN
final public static int DOWN(Code)
The Down Arrow key, a non-ASCII action key.
since:
   JDK1.0



END
final public static int END(Code)
The End key, a non-ASCII action key.
since:
   JDK1.0



ENTER
final public static int ENTER(Code)
The Enter key.
since:
   JDK1.0



ESCAPE
final public static int ESCAPE(Code)
The Escape key.
since:
   JDK1.0



F1
final public static int F1(Code)
The F1 function key, a non-ASCII action key.
since:
   JDK1.0



F10
final public static int F10(Code)
The F10 function key, a non-ASCII action key.
since:
   JDK1.0



F11
final public static int F11(Code)
The F11 function key, a non-ASCII action key.
since:
   JDK1.0



F12
final public static int F12(Code)
The F12 function key, a non-ASCII action key.
since:
   JDK1.0



F2
final public static int F2(Code)
The F2 function key, a non-ASCII action key.
since:
   JDK1.0



F3
final public static int F3(Code)
The F3 function key, a non-ASCII action key.
since:
   JDK1.0



F4
final public static int F4(Code)
The F4 function key, a non-ASCII action key.
since:
   JDK1.0



F5
final public static int F5(Code)
The F5 function key, a non-ASCII action key.
since:
   JDK1.0



F6
final public static int F6(Code)
The F6 function key, a non-ASCII action key.
since:
   JDK1.0



F7
final public static int F7(Code)
The F7 function key, a non-ASCII action key.
since:
   JDK1.0



F8
final public static int F8(Code)
The F8 function key, a non-ASCII action key.
since:
   JDK1.0



F9
final public static int F9(Code)
The F9 function key, a non-ASCII action key.
since:
   JDK1.0



GOT_FOCUS
final public static int GOT_FOCUS(Code)
A component gained the focus.
since:
   JDK1.0



HOME
final public static int HOME(Code)
The Home key, a non-ASCII action key.
since:
   JDK1.0



INSERT
final public static int INSERT(Code)
The Insert key, a non-ASCII action key.
since:
   JDK1.0



KEY_ACTION
final public static int KEY_ACTION(Code)
The user has pressed a non-ASCII action key. The key field contains a value that indicates that the event occurred on one of the action keys, which comprise the 12 function keys, the arrow (cursor) keys, Page Up, Page Down, Home, End, Print Screen, Scroll Lock, Caps Lock, Num Lock, Pause, and Insert.
since:
   JDK1.0



KEY_ACTION_RELEASE
final public static int KEY_ACTION_RELEASE(Code)
The user has released a non-ASCII action key. The key field contains a value that indicates that the event occurred on one of the action keys, which comprise the 12 function keys, the arrow (cursor) keys, Page Up, Page Down, Home, End, Print Screen, Scroll Lock, Caps Lock, Num Lock, Pause, and Insert.
since:
   JDK1.0



KEY_PRESS
final public static int KEY_PRESS(Code)
The user has pressed a normal key.
since:
   JDK1.0



KEY_RELEASE
final public static int KEY_RELEASE(Code)
The user has released a normal key.
since:
   JDK1.0



LEFT
final public static int LEFT(Code)
The Left Arrow key, a non-ASCII action key.
since:
   JDK1.0



LIST_DESELECT
final public static int LIST_DESELECT(Code)
An item in a list has been deselected.
since:
   JDK1.0



LIST_SELECT
final public static int LIST_SELECT(Code)
An item in a list has been selected.
since:
   JDK1.0



LOAD_FILE
final public static int LOAD_FILE(Code)
A file loading event.
since:
   JDK1.0



LOST_FOCUS
final public static int LOST_FOCUS(Code)
A component lost the focus.
since:
   JDK1.0



META_MASK
final public static int META_MASK(Code)
This flag indicates that the Meta key was down when the event occurred. For mouse events, this flag indicates that the right button was pressed or released.
since:
   JDK1.0



MOUSE_DOWN
final public static int MOUSE_DOWN(Code)
The user has pressed the mouse button. The ALT_MASK flag indicates that the middle button has been pressed. The META_MASKflag indicates that the right button has been pressed.
See Also:   java.awt.Event.ALT_MASK
See Also:   java.awt.Event.META_MASK
since:
   JDK1.0



MOUSE_DRAG
final public static int MOUSE_DRAG(Code)
The user has moved the mouse with a button pressed. The ALT_MASK flag indicates that the middle button is being pressed. The META_MASK flag indicates that the right button is being pressed.
See Also:   java.awt.Event.ALT_MASK
See Also:   java.awt.Event.META_MASK
since:
   JDK1.0



MOUSE_ENTER
final public static int MOUSE_ENTER(Code)
The mouse has entered a component.
since:
   JDK1.0



MOUSE_EXIT
final public static int MOUSE_EXIT(Code)
The mouse has exited a component.
since:
   JDK1.0



MOUSE_MOVE
final public static int MOUSE_MOVE(Code)
The mouse has moved with no button pressed.
since:
   JDK1.0



MOUSE_UP
final public static int MOUSE_UP(Code)
The user has released the mouse button. The ALT_MASK flag indicates that the middle button has been released. The META_MASKflag indicates that the right button has been released.
See Also:   java.awt.Event.ALT_MASK
See Also:   java.awt.Event.META_MASK
since:
   JDK1.0



NUM_LOCK
final public static int NUM_LOCK(Code)
The Num Lock key, a non-ASCII action key.
since:
   JDK1.0



PAUSE
final public static int PAUSE(Code)
The Pause key, a non-ASCII action key.
since:
   JDK1.0



PGDN
final public static int PGDN(Code)
The Page Down key, a non-ASCII action key.
since:
   JDK1.0



PGUP
final public static int PGUP(Code)
The Page Up key, a non-ASCII action key.
since:
   JDK1.0



PRINT_SCREEN
final public static int PRINT_SCREEN(Code)
The Print Screen key, a non-ASCII action key.
since:
   JDK1.0



RIGHT
final public static int RIGHT(Code)
The Right Arrow key, a non-ASCII action key.
since:
   JDK1.0



SAVE_FILE
final public static int SAVE_FILE(Code)
A file saving event.
since:
   JDK1.0



SCROLL_ABSOLUTE
final public static int SCROLL_ABSOLUTE(Code)
The user has moved the bubble (thumb) in a scroll bar, moving to an "absolute" position, rather than to an offset from the last postion.
since:
   JDK1.0



SCROLL_BEGIN
final public static int SCROLL_BEGIN(Code)
The scroll begin event.
since:
   JDK1.0



SCROLL_END
final public static int SCROLL_END(Code)
The scroll end event.
since:
   JDK1.0



SCROLL_LINE_DOWN
final public static int SCROLL_LINE_DOWN(Code)
The user has activated the line down area of a scroll bar.
since:
   JDK1.0



SCROLL_LINE_UP
final public static int SCROLL_LINE_UP(Code)
The user has activated the line up area of a scroll bar.
since:
   JDK1.0



SCROLL_LOCK
final public static int SCROLL_LOCK(Code)
The Scroll Lock key, a non-ASCII action key.
since:
   JDK1.0



SCROLL_PAGE_DOWN
final public static int SCROLL_PAGE_DOWN(Code)
The user has activated the page down area of a scroll bar.
since:
   JDK1.0



SCROLL_PAGE_UP
final public static int SCROLL_PAGE_UP(Code)
The user has activated the page up area of a scroll bar.
since:
   JDK1.0



SHIFT_MASK
final public static int SHIFT_MASK(Code)
This flag indicates that the Shift key was down when the event occurred.
since:
   JDK1.0



TAB
final public static int TAB(Code)
The Tab key.
since:
   JDK1.0



UP
final public static int UP(Code)
The Up Arrow key, a non-ASCII action key.
since:
   JDK1.0



WINDOW_DEICONIFY
final public static int WINDOW_DEICONIFY(Code)
The user has asked the window manager to de-iconify the window.
since:
   JDK1.0



WINDOW_DESTROY
final public static int WINDOW_DESTROY(Code)
The user has asked the window manager to kill the window.
since:
   JDK1.0



WINDOW_EXPOSE
final public static int WINDOW_EXPOSE(Code)
The user has asked the window manager to expose the window.
since:
   JDK1.0



WINDOW_ICONIFY
final public static int WINDOW_ICONIFY(Code)
The user has asked the window manager to iconify the window.
since:
   JDK1.0



WINDOW_MOVED
final public static int WINDOW_MOVED(Code)
The user has asked the window manager to move the window.
since:
   JDK1.0



arg
public Object arg(Code)
An arbitrary argument of the event. The value of this field depends on the type of event.
since:
   JDK1.0



clickCount
public int clickCount(Code)
For MOUSE_DOWN events, this field indicates the number of consecutive clicks. For other events, its value is 0.
since:
   JDK1.0



evt
public Event evt(Code)
The next event. This field is set when putting events into a linked list.
since:
   JDK1.0



id
public int id(Code)
Indicates which type of event the event is, and which other Event variables are relevant for the event.
since:
   JDK1.0



key
public int key(Code)
The key code of the key that was pressed in a keyboard event.
since:
   JDK1.0



modifiers
public int modifiers(Code)
The state of the modifier keys.

NOTE: changing the modifier keys is not recommended, because many native implementations do not recognize modifier changes. This is especially true when the shift modifier is changed.
since:
   JDK1.0




target
public Object target(Code)
The target component. This indicates the component over which the event occurred or with which the event is associated.
since:
   JDK1.0



when
public long when(Code)
The time stamp.
since:
   JDK1.0



x
public int x(Code)
The x coordinate of the event.
since:
   JDK1.0



y
public int y(Code)
The y coordinate of the event.
since:
   JDK1.0




Constructor Detail
Event
public Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)(Code)
Creates an instance of Event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and argument.
Parameters:
  target - the target component.
Parameters:
  when - the time stamp.
Parameters:
  id - the event type.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate.
Parameters:
  key - the key pressed in a keyboard event.
Parameters:
  modifiers - the state of the modifier keys.
Parameters:
  arg - the specified argument.
since:
   JDK1.0



Event
public Event(Object target, long when, int id, int x, int y, int key, int modifiers)(Code)
Creates an instance of Event, with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys, and an argument set to null.
Parameters:
  target - the target component.
Parameters:
  when - the time stamp.
Parameters:
  id - the event type.
Parameters:
  x - the x coordinate.
Parameters:
  y - the y coordinate.
Parameters:
  key - the key pressed in a keyboard event.
Parameters:
  modifiers - the state of the modifier keys.
since:
   JDK1.0



Event
public Event(Object target, int id, Object arg)(Code)
Creates an instance of Event with the specified target component, event type, and argument.
Parameters:
  target - the target component.
Parameters:
  id - the event type.
Parameters:
  arg - the specified argument.
since:
   JDK1.0




Method Detail
consume
void consume()(Code)



controlDown
public boolean controlDown()(Code)
Checks if the Control key is down. true if the key is down; false otherwise.
See Also:   java.awt.Event.modifiers
See Also:   java.awt.Event.shiftDown
See Also:   java.awt.Event.metaDown
since:
   JDK1.0



getKeyEventChar
char getKeyEventChar()(Code)



getOldEventKey
static int getOldEventKey(KeyEvent e)(Code)



isConsumed
boolean isConsumed()(Code)



metaDown
public boolean metaDown()(Code)
Checks if the Meta key is down. true if the key is down; false otherwise.
See Also:   java.awt.Event.modifiers
See Also:   java.awt.Event.shiftDown
See Also:   java.awt.Event.controlDown
since:
   JDK1.0



paramString
protected String paramString()(Code)
Returns the parameter string representing this event. This string is useful for debugging. the parameter string of this event.
since:
   JDK1.0



shiftDown
public boolean shiftDown()(Code)
Checks if the Shift key is down. true if the key is down; false otherwise.
See Also:   java.awt.Event.modifiers
See Also:   java.awt.Event.controlDown
See Also:   java.awt.Event.metaDown
since:
   JDK1.0



toString
public String toString()(Code)
Returns a representation of this event's values as a string. a string that represents the event and the valuesof its member fields.
See Also:   java.awt.Event.paramString
since:
   JDK1.1



translate
public void translate(int x, int y)(Code)
Translates this event so that its x and y coordinates are increased by dx and dy, respectively.

This method translates an event relative to the given component. This involves, at a minimum, translating the coordinates into the local coordinate system of the given component. It may also involve translating a region in the case of an expose event.
Parameters:
  dx - the distance to translate the x coordinate.
Parameters:
  dy - the distance to translate the y coordinate.
since:
   JDK1.0




Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.