| java.lang.Object java.awt.Event
Event | public class Event implements java.io.Serializable(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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
Event.id field
that indicates what type of event it is and which other
Event variables are relevant for the event.
For keyboard events,
Event.key contains a value indicating which key was activated, and
Event.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.82 05/05/07 author: Sami Shaio since: JDK1.0 |
Field Summary | |
final public static int | ACTION_EVENT This event indicates that the user wants some action to occur. | final public static int | ALT_MASK This flag indicates that the Alt key was down when
the event occurred. | final public static int | BACK_SPACE The BackSpace key. | final public static int | CAPS_LOCK The Caps Lock key, a non-ASCII action key. | final public static int | CTRL_MASK This flag indicates that the Control key was down when the event
occurred. | final public static int | DELETE The Delete key. | final public static int | DOWN The Down Arrow key, a non-ASCII action key. | final public static int | END The End key, a non-ASCII action key. | final public static int | ENTER The Enter key. | final public static int | ESCAPE The Escape key. | final public static int | F1 The F1 function key, a non-ASCII action key. | final public static int | F10 The F10 function key, a non-ASCII action key. | final public static int | F11 The F11 function key, a non-ASCII action key. | final public static int | F12 The F12 function key, a non-ASCII action key. | final public static int | F2 The F2 function key, a non-ASCII action key. | final public static int | F3 The F3 function key, a non-ASCII action key. | final public static int | F4 The F4 function key, a non-ASCII action key. | final public static int | F5 The F5 function key, a non-ASCII action key. | final public static int | F6 The F6 function key, a non-ASCII action key. | final public static int | F7 The F7 function key, a non-ASCII action key. | final public static int | F8 The F8 function key, a non-ASCII action key. | final public static int | F9 The F9 function key, a non-ASCII action key. | final public static int | GOT_FOCUS A component gained the focus. | final public static int | HOME The Home key, a non-ASCII action key. | final public static int | INSERT The Insert key, a non-ASCII action key. | final public static int | KEY_ACTION The user has pressed a non-ASCII action key. | final public static int | KEY_ACTION_RELEASE The user has released a non-ASCII action key. | final public static int | KEY_PRESS The user has pressed a normal key. | final public static int | KEY_RELEASE The user has released a normal key. | final public static int | LEFT The Left Arrow key, a non-ASCII action key. | final public static int | LIST_DESELECT An item in a list has been deselected. | final public static int | LIST_SELECT An item in a list has been selected. | final public static int | LOAD_FILE A file loading event. | final public static int | LOST_FOCUS A component lost the focus. | final public static int | META_MASK This flag indicates that the Meta key was down when the event
occurred. | final public static int | MOUSE_DOWN The user has pressed the mouse button. | final public static int | MOUSE_DRAG The user has moved the mouse with a button pressed. | final public static int | MOUSE_ENTER The mouse has entered a component. | final public static int | MOUSE_EXIT The mouse has exited a component. | final public static int | MOUSE_MOVE The mouse has moved with no button pressed. | final public static int | MOUSE_UP The user has released the mouse button. | final public static int | NUM_LOCK The Num Lock key, a non-ASCII action key. | final public static int | PAUSE The Pause key, a non-ASCII action key. | final public static int | PGDN The Page Down key, a non-ASCII action key. | final public static int | PGUP The Page Up key, a non-ASCII action key. | final public static int | PRINT_SCREEN The Print Screen key, a non-ASCII action key. | final public static int | RIGHT The Right Arrow key, a non-ASCII action key. | final public static int | SAVE_FILE A file saving event. | final public static int | SCROLL_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 int | SCROLL_BEGIN The scroll begin event. | final public static int | SCROLL_END The scroll end event. | final public static int | SCROLL_LINE_DOWN The user has activated the line down
area of a scroll bar. | final public static int | SCROLL_LINE_UP The user has activated the line up
area of a scroll bar. | final public static int | SCROLL_LOCK The Scroll Lock key, a non-ASCII action key. | final public static int | SCROLL_PAGE_DOWN The user has activated the page down
area of a scroll bar. | final public static int | SCROLL_PAGE_UP The user has activated the page up
area of a scroll bar. | final public static int | SHIFT_MASK This flag indicates that the Shift key was down when the event
occurred. | final public static int | TAB The Tab key. | final public static int | UP The Up Arrow key, a non-ASCII action key. | final public static int | WINDOW_DEICONIFY The user has asked the window manager to de-iconify the window. | final public static int | WINDOW_DESTROY The user has asked the window manager to kill the window. | final public static int | WINDOW_EXPOSE The user has asked the window manager to expose the window. | final public static int | WINDOW_ICONIFY The user has asked the window manager to iconify the window. | final public static int | WINDOW_MOVED The user has asked the window manager to move the window. | public Object | arg An arbitrary argument of the event. | public int | clickCount For MOUSE_DOWN events, this field indicates the
number of consecutive clicks. | public Event | evt The next event. | public int | id Indicates which type of event the event is, and which
other Event variables are relevant for the event. | public int | key The key code of the key that was pressed in a keyboard event. | public int | modifiers The state of the modifier keys. | public Object | target The target component. | public long | when The time stamp. | public int | x The x coordinate of the event. | public int | y 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) NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public | Event(Object target, long when, int id, int x, int y, int key, int modifiers) NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public | Event(Object target, int id, Object arg) NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
Method Summary | |
void | consume() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public boolean | controlDown() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | char | getKeyEventChar() | static int | getOldEventKey(KeyEvent e) | boolean | isConsumed() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public boolean | metaDown() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | protected String | paramString() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public boolean | shiftDown() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public String | toString() NOTE: The Event class is obsolete and is
available only for backwards compatilibility. | public void | translate(int dx, int dy) NOTE: The Event class is obsolete and is
available only for backwards compatilibility. |
ACTION_EVENT | final public static int ACTION_EVENT(Code) | | This event indicates that the user wants some action to occur.
|
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.
|
BACK_SPACE | final public static int BACK_SPACE(Code) | | The BackSpace key.
|
CAPS_LOCK | final public static int CAPS_LOCK(Code) | | The Caps Lock key, a non-ASCII action key.
|
CTRL_MASK | final public static int CTRL_MASK(Code) | | This flag indicates that the Control key was down when the event
occurred.
|
DELETE | final public static int DELETE(Code) | | The Delete key.
|
DOWN | final public static int DOWN(Code) | | The Down Arrow key, a non-ASCII action key.
|
END | final public static int END(Code) | | The End key, a non-ASCII action key.
|
ENTER | final public static int ENTER(Code) | | The Enter key.
|
ESCAPE | final public static int ESCAPE(Code) | | The Escape key.
|
F1 | final public static int F1(Code) | | The F1 function key, a non-ASCII action key.
|
F10 | final public static int F10(Code) | | The F10 function key, a non-ASCII action key.
|
F11 | final public static int F11(Code) | | The F11 function key, a non-ASCII action key.
|
F12 | final public static int F12(Code) | | The F12 function key, a non-ASCII action key.
|
F2 | final public static int F2(Code) | | The F2 function key, a non-ASCII action key.
|
F3 | final public static int F3(Code) | | The F3 function key, a non-ASCII action key.
|
F4 | final public static int F4(Code) | | The F4 function key, a non-ASCII action key.
|
F5 | final public static int F5(Code) | | The F5 function key, a non-ASCII action key.
|
F6 | final public static int F6(Code) | | The F6 function key, a non-ASCII action key.
|
F7 | final public static int F7(Code) | | The F7 function key, a non-ASCII action key.
|
F8 | final public static int F8(Code) | | The F8 function key, a non-ASCII action key.
|
F9 | final public static int F9(Code) | | The F9 function key, a non-ASCII action key.
|
GOT_FOCUS | final public static int GOT_FOCUS(Code) | | A component gained the focus.
|
HOME | final public static int HOME(Code) | | The Home key, a non-ASCII action key.
|
INSERT | final public static int INSERT(Code) | | The Insert key, a non-ASCII action key.
|
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.
|
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.
|
KEY_PRESS | final public static int KEY_PRESS(Code) | | The user has pressed a normal key.
|
KEY_RELEASE | final public static int KEY_RELEASE(Code) | | The user has released a normal key.
|
LEFT | final public static int LEFT(Code) | | The Left Arrow key, a non-ASCII action key.
|
LIST_DESELECT | final public static int LIST_DESELECT(Code) | | An item in a list has been deselected.
|
LIST_SELECT | final public static int LIST_SELECT(Code) | | An item in a list has been selected.
|
LOAD_FILE | final public static int LOAD_FILE(Code) | | A file loading event.
|
LOST_FOCUS | final public static int LOST_FOCUS(Code) | | A component lost the focus.
|
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.
|
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_MASK flag indicates that the
right button has been pressed.
See Also: java.awt.Event.ALT_MASK See Also: java.awt.Event.META_MASK |
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 |
MOUSE_ENTER | final public static int MOUSE_ENTER(Code) | | The mouse has entered a component.
|
MOUSE_EXIT | final public static int MOUSE_EXIT(Code) | | The mouse has exited a component.
|
MOUSE_MOVE | final public static int MOUSE_MOVE(Code) | | The mouse has moved with no button pressed.
|
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_MASK flag indicates that the
right button has been released.
See Also: java.awt.Event.ALT_MASK See Also: java.awt.Event.META_MASK |
NUM_LOCK | final public static int NUM_LOCK(Code) | | The Num Lock key, a non-ASCII action key.
|
PAUSE | final public static int PAUSE(Code) | | The Pause key, a non-ASCII action key.
|
PGDN | final public static int PGDN(Code) | | The Page Down key, a non-ASCII action key.
|
PGUP | final public static int PGUP(Code) | | The Page Up key, a non-ASCII action key.
|
PRINT_SCREEN | final public static int PRINT_SCREEN(Code) | | The Print Screen key, a non-ASCII action key.
|
RIGHT | final public static int RIGHT(Code) | | The Right Arrow key, a non-ASCII action key.
|
SAVE_FILE | final public static int SAVE_FILE(Code) | | A file saving event.
|
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.
|
SCROLL_BEGIN | final public static int SCROLL_BEGIN(Code) | | The scroll begin event.
|
SCROLL_END | final public static int SCROLL_END(Code) | | The scroll end event.
|
SCROLL_LINE_DOWN | final public static int SCROLL_LINE_DOWN(Code) | | The user has activated the line down
area of a scroll bar.
|
SCROLL_LINE_UP | final public static int SCROLL_LINE_UP(Code) | | The user has activated the line up
area of a scroll bar.
|
SCROLL_LOCK | final public static int SCROLL_LOCK(Code) | | The Scroll Lock key, a non-ASCII action key.
|
SCROLL_PAGE_DOWN | final public static int SCROLL_PAGE_DOWN(Code) | | The user has activated the page down
area of a scroll bar.
|
SCROLL_PAGE_UP | final public static int SCROLL_PAGE_UP(Code) | | The user has activated the page up
area of a scroll bar.
|
SHIFT_MASK | final public static int SHIFT_MASK(Code) | | This flag indicates that the Shift key was down when the event
occurred.
|
TAB | final public static int TAB(Code) | | The Tab key.
|
UP | final public static int UP(Code) | | The Up Arrow key, a non-ASCII action key.
|
WINDOW_DEICONIFY | final public static int WINDOW_DEICONIFY(Code) | | The user has asked the window manager to de-iconify the window.
|
WINDOW_DESTROY | final public static int WINDOW_DESTROY(Code) | | The user has asked the window manager to kill the window.
|
WINDOW_EXPOSE | final public static int WINDOW_EXPOSE(Code) | | The user has asked the window manager to expose the window.
|
WINDOW_ICONIFY | final public static int WINDOW_ICONIFY(Code) | | The user has asked the window manager to iconify the window.
|
WINDOW_MOVED | final public static int WINDOW_MOVED(Code) | | The user has asked the window manager to move the window.
|
arg | public Object arg(Code) | | An arbitrary argument of the event. The value of this field
depends on the type of event.
arg has been replaced by event specific property.
|
clickCount | public int clickCount(Code) | | For MOUSE_DOWN events, this field indicates the
number of consecutive clicks. For other events, its value is
0 .
This field has been replaced by MouseEvent.getClickCount().
See Also: java.awt.event.MouseEvent#getClickCount(). |
evt | public Event evt(Code) | | The next event. This field is set when putting events into a
linked list.
This has been replaced by EventQueue.
See Also: java.awt.EventQueue |
id | public int id(Code) | | Indicates which type of event the event is, and which
other Event variables are relevant for the event.
This has been replaced by AWTEvent.getID()
See Also: java.awt.AWTEvent.getID |
modifiers | public int modifiers(Code) | | The state of the modifier keys.
This is replaced with InputEvent.getModifiers()
In java 1.1 MouseEvent and KeyEvent are subclasses
of InputEvent.
See Also: java.awt.event.InputEvent.getModifiers |
target | public Object target(Code) | | The target component. This indicates the component over which the
event occurred or with which the event is associated.
This object has been replaced by AWTEvent.getSource()
See Also: java.awt.AWTEvent.getSource |
Event | public Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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. |
Event | public Event(Object target, long when, int id, int x, int y, int key, int modifiers)(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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. |
Event | public Event(Object target, int id, Object arg)(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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. |
consume | void consume()(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
|
getKeyEventChar | char getKeyEventChar()(Code) | | |
isConsumed | boolean isConsumed()(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
|
paramString | protected String paramString()(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
Returns a string representing the state of this Event .
This method is intended to be used only for debugging purposes, and the
content and format of the returned string may vary between
implementations. The returned string may be empty but may not be
null .
the parameter string of this event |
toString | public String toString()(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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 dx, int dy)(Code) | | NOTE: The Event class is obsolete and is
available only for backwards compatilibility. It has been replaced
by the AWTEvent class and its subclasses.
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. |
|
|