|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Event
Event is a platform-independent class that encapsulates events from the local Graphical User Interface(GUI) platform.
The event contains an id which indicates the type of event it is and which other Event variables are relavent for the event. For keyboard events, key will contain a value indicating the key that was activated and modifiers will contain the modifiers. For KEY_PRESS and KEY_RELEASE event ids, the value of key will be the unicode character code for the key; for KEY_ACTION and KEY_ACTION_RELEASE, the value of key will be one of the defined action-key identifiers in the Event class (PGUP, PGDN, F1, F2, etc).
Field Summary | |
static int |
ACTION_EVENT
An action event. |
static int |
ALT_MASK
The alt modifier constant. |
Object |
arg
An arbitrary argument. |
int |
clickCount
The number of consecutive clicks. |
static int |
CTRL_MASK
The control modifier constant. |
static int |
DOWN
The down arrow action-key. |
static int |
END
The end action-key. |
Event |
evt
The next event. |
static int |
F1
The F1 function action-key. |
static int |
F10
The F10 function action-key. |
static int |
F11
The F11 function action-key. |
static int |
F12
The F12 function action-key. |
static int |
F2
The F2 function action-key. |
static int |
F3
The F3 function action-key. |
static int |
F4
The F4 function action-key. |
static int |
F5
The F5 function action-key. |
static int |
F6
The F6 function action-key. |
static int |
F7
The F7 function action-key. |
static int |
F8
The F8 function action-key. |
static int |
F9
The F9 function action-key. |
static int |
GOT_FOCUS
A component gained the focus. |
static int |
HOME
The home action-key. |
int |
id
The type of this event. |
int |
key
The key that was pressed in a keyboard event. |
static int |
KEY_ACTION
The action-key press keyboard event. |
static int |
KEY_ACTION_RELEASE
The action-key release keyboard event. |
static int |
KEY_PRESS
The key press keyboard event. |
static int |
KEY_RELEASE
The key release keyboard event. |
static int |
LEFT
The left arrow action-key. |
static int |
LIST_DESELECT
|
static int |
LIST_SELECT
|
static int |
LOAD_FILE
A file loading event. |
static int |
LOST_FOCUS
A component lost the focus. |
static int |
META_MASK
The meta modifier constant. |
int |
modifiers
The state of the modifier keys. |
static int |
MOUSE_DOWN
The mouse down event. |
static int |
MOUSE_DRAG
The mouse drag event. |
static int |
MOUSE_ENTER
The mouse enter event. |
static int |
MOUSE_EXIT
The mouse exit event. |
static int |
MOUSE_MOVE
The mouse move event. |
static int |
MOUSE_UP
The mouse up event. |
static int |
PGDN
The page down action-key. |
static int |
PGUP
The page up action-key. |
static int |
RIGHT
The right arrow action-key. |
static int |
SAVE_FILE
A file saving event. |
static int |
SCROLL_ABSOLUTE
The absolute scroll event. |
static int |
SCROLL_LINE_DOWN
The line down scroll event. |
static int |
SCROLL_LINE_UP
The line up scroll event. |
static int |
SCROLL_PAGE_DOWN
The page down scroll event. |
static int |
SCROLL_PAGE_UP
The page up scroll event. |
static int |
SHIFT_MASK
The shift modifier constant. |
Object |
target
The target component. |
static int |
UP
The up arrow action-key. |
long |
when
The time stamp. |
static int |
WINDOW_DEICONIFY
The de-iconify window event. |
static int |
WINDOW_DESTROY
The destroy window event. |
static int |
WINDOW_EXPOSE
The expose window event. |
static int |
WINDOW_ICONIFY
The iconify window event. |
static int |
WINDOW_MOVED
The move window event. |
int |
x
The x coordinate of the event. |
int |
y
The y coordinate of the event. |
Constructor Summary | |
Event(Object target,
int id,
Object arg)
Constructs an event with the specified target component, event type, and argument. |
|
Event(Object target,
long when,
int id,
int x,
int y,
int key,
int modifiers)
Constructs an 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. |
|
Event(Object target,
long when,
int id,
int x,
int y,
int key,
int modifiers,
Object arg)
Constructs an event with the specified target component, time stamp, event type, x and y coordinates, keyboard key, state of the modifier keys and argument. |
Method Summary | |
boolean |
controlDown()
Checks if the control key is down. |
boolean |
metaDown()
Checks if the meta key is down. |
protected String |
paramString()
Returns the parameter String of this Event. |
boolean |
shiftDown()
Checks if the shift key is down. |
String |
toString()
Returns the String representation of this Event's values. |
void |
translate(int x,
int y)
Translates an event relative to the given component. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int SHIFT_MASK
public static final int CTRL_MASK
public static final int META_MASK
public static final int ALT_MASK
public static final int HOME
public static final int END
public static final int PGUP
public static final int PGDN
public static final int UP
public static final int DOWN
public static final int LEFT
public static final int RIGHT
public static final int F1
public static final int F2
public static final int F3
public static final int F4
public static final int F5
public static final int F6
public static final int F7
public static final int F8
public static final int F9
public static final int F10
public static final int F11
public static final int F12
public static final int WINDOW_DESTROY
public static final int WINDOW_EXPOSE
public static final int WINDOW_ICONIFY
public static final int WINDOW_DEICONIFY
public static final int WINDOW_MOVED
public static final int KEY_PRESS
public static final int KEY_RELEASE
public static final int KEY_ACTION
public static final int KEY_ACTION_RELEASE
public static final int MOUSE_DOWN
public static final int MOUSE_UP
public static final int MOUSE_MOVE
public static final int MOUSE_ENTER
public static final int MOUSE_EXIT
public static final int MOUSE_DRAG
public static final int SCROLL_LINE_UP
public static final int SCROLL_LINE_DOWN
public static final int SCROLL_PAGE_UP
public static final int SCROLL_PAGE_DOWN
public static final int SCROLL_ABSOLUTE
public static final int LIST_SELECT
public static final int LIST_DESELECT
public static final int ACTION_EVENT
public static final int LOAD_FILE
public static final int SAVE_FILE
public static final int GOT_FOCUS
public static final int LOST_FOCUS
public Object target
public long when
public int id
public int x
public int y
public int key
public int modifiers
public int clickCount
public Object arg
public Event evt
Constructor Detail |
public Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)
target
- the target componentwhen
- the time stampid
- the event typex
- the x coordinatey
- the y coordinatekey
- the key pressed in a keyboard eventmodifiers
- the state of the modifier keysarg
- the specified argumentpublic Event(Object target, long when, int id, int x, int y, int key, int modifiers)
target
- the target componentwhen
- the time stampid
- the event typex
- the x coordinatey
- the y coordinatekey
- the key pressed in a keyboard eventmodifiers
- the state of the modifier keyspublic Event(Object target, int id, Object arg)
target
- the target componentid
- the event typearg
- the specified argumentMethod Detail |
public void translate(int x, int y)
x
- the x coordinatey
- the y coordinatepublic boolean shiftDown()
modifiers
,
controlDown()
,
metaDown()
public boolean controlDown()
modifiers
,
shiftDown()
,
metaDown()
public boolean metaDown()
modifiers
,
shiftDown()
,
controlDown()
protected String paramString()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |