Fields Summary |
---|
private static final long | serialVersionUIDThe Constant serialVersionUID. |
public static final int | SHIFT_MASKThe Constant SHIFT_MASK indicates that the Shift key is down when the
event occurred. |
public static final int | CTRL_MASKThe Constant CTRL_MASK indicates that the Control key is down when the
event occurred. |
public static final int | META_MASKThe Constant META_MASK indicates that the Meta key is down when t he
event occurred (or the right mouse button). |
public static final int | ALT_MASKThe Constant ALT_MASK indicates that the Alt key is down when the event
occurred (or the middle mouse button). |
public static final int | HOMEThe Constant HOME indicates Home key. |
public static final int | ENDThe Constant END indicates End key. |
public static final int | PGUPThe Constant PGUP indicates Page Up key. |
public static final int | PGDNThe Constant PGDN indicates Page Down key. |
public static final int | UPThe Constant UP indicates Up key. |
public static final int | DOWNThe Constant DOWN indicates Down key. |
public static final int | LEFTThe Constant LEFT indicates Left key. |
public static final int | RIGHTThe Constant RIGHT indicates Right key. |
public static final int | F1The Constant F1 indicates F1 key. |
public static final int | F2The Constant F2 indicates F2 key. |
public static final int | F3The Constant F3 indicates F3 key. |
public static final int | F4The Constant F4 indicates F4 key. |
public static final int | F5The Constant F5 indicates F5 key. |
public static final int | F6The Constant F6 indicates F6 key. |
public static final int | F7The Constant F7 indicates F7 key. |
public static final int | F8The Constant F8 indicates F8 key. |
public static final int | F9The Constant F9 indicates F9 key. |
public static final int | F10The Constant F10 indicates F10 key. |
public static final int | F11The Constant F11 indicates F11 key. |
public static final int | F12The Constant F12 indicates F12 key. |
public static final int | PRINT_SCREENThe Constant PRINT_SCREEN indicates Print Screen key. |
public static final int | SCROLL_LOCKThe Constant SCROLL_LOCK indicates Scroll Lock key. |
public static final int | CAPS_LOCKThe Constant CAPS_LOCK indicates Caps Lock key. |
public static final int | NUM_LOCKThe Constant NUM_LOCK indicates Num Lock key. |
public static final int | PAUSEThe Constant PAUSE indicates Pause key. |
public static final int | INSERTThe Constant INSERT indicates Insert key. |
public static final int | ENTERThe Constant ENTER indicates Enter key. |
public static final int | BACK_SPACEThe Constant BACK_SPACE indicates Back Space key. |
public static final int | TABThe Constant TAB indicates TAb key. |
public static final int | ESCAPEThe Constant ESCAPE indicates Escape key. |
public static final int | DELETEThe Constant DELETE indicates Delete key. |
public static final int | WINDOW_DESTROYThe Constant WINDOW_DESTROY indicates an event when the user has asked
the window manager to kill the window. |
public static final int | WINDOW_EXPOSEThe Constant WINDOW_EXPOSE indicates an event when the user has asked the
window manager to expose the window. |
public static final int | WINDOW_ICONIFYThe Constant WINDOW_ICONIFY indicates an event when the user has asked
the window manager to iconify the window. |
public static final int | WINDOW_DEICONIFYThe Constant WINDOW_DEICONIFY indicates an event when the user has asked
the window manager to deiconify the window. |
public static final int | WINDOW_MOVEDThe Constant WINDOW_MOVED indicates an event when the user has asked the
window manager to move the window. |
public static final int | KEY_PRESSThe Constant KEY_PRESS indicates an event when the user presses a normal
key. |
public static final int | KEY_RELEASEThe Constant KEY_RELEASE indicates an event when the user releases a
normal key. |
public static final int | KEY_ACTIONThe Constant KEY_ACTION indicates an event when the user pressed a
non-ASCII action key. |
public static final int | KEY_ACTION_RELEASEThe Constant KEY_ACTION_RELEASE indicates an event when the user released
a non-ASCII action key. |
public static final int | MOUSE_DOWNThe Constant MOUSE_DOWN indicates an event when the user has pressed the
mouse button. |
public static final int | MOUSE_UPThe Constant MOUSE_UP indicates an event when the user has released the
mouse button. |
public static final int | MOUSE_MOVEThe Constant MOUSE_MOVE indicates an event when the user has moved the
mouse with no button pressed. |
public static final int | MOUSE_ENTERThe Constant MOUSE_ENTER indicates an event when the mouse has entered a
component. |
public static final int | MOUSE_EXITThe Constant MOUSE_EXIT indicates an event when the mouse has exited a
component. |
public static final int | MOUSE_DRAGThe Constant MOUSE_DRAG indicates an event when the user has moved a
mouse with the pressed button. |
public static final int | SCROLL_LINE_UPThe Constant SCROLL_LINE_UP indicates an event when the user has
activated line-up area of scrollbar. |
public static final int | SCROLL_LINE_DOWNThe Constant SCROLL_LINE_DOWN indicates an event when the user has
activated line-down area of scrollbar. |
public static final int | SCROLL_PAGE_UPThe Constant SCROLL_PAGE_UP indicates an event when the user has
activated page up area of scrollbar. |
public static final int | SCROLL_PAGE_DOWNThe Constant SCROLL_PAGE_DOWN indicates an event when the user has
activated page down area of scrollbar. |
public static final int | SCROLL_ABSOLUTEThe Constant SCROLL_ABSOLUTE indicates an event when the user has moved
the bubble in a scroll bar. |
public static final int | SCROLL_BEGINThe Constant SCROLL_BEGIN indicates a scroll begin event. |
public static final int | SCROLL_ENDThe Constant SCROLL_END indicates a scroll end event. |
public static final int | LIST_SELECTThe Constant LIST_SELECT indicates that an item in a list has been
selected. |
public static final int | LIST_DESELECTThe Constant LIST_DESELECT indicates that an item in a list has been
unselected. |
public static final int | ACTION_EVENTThe Constant ACTION_EVENT indicates that the user wants some action to
occur. |
public static final int | LOAD_FILEThe Constant LOAD_FILE indicates a file loading event. |
public static final int | SAVE_FILEThe Constant SAVE_FILE indicates a file saving event. |
public static final int | GOT_FOCUSThe Constant GOT_FOCUS indicates that a component got the focus. |
public static final int | LOST_FOCUSThe Constant LOST_FOCUS indicates that the component lost the focus. |
public Object | targetThe target is the component with which the event is associated. |
public long | whenThe when is timestamp when event has occured. |
public int | idThe id indicates the type of the event. |
public int | xThe x coordinate of event. |
public int | yThe y coordinate of event. |
public int | keyThe key code of key event. |
public int | modifiersThe state of the modifier keys (given by a bitmask). |
public int | clickCountThe click count indicates the number of consecutive clicks. |
public Object | argThe argument of the event. |
public Event | evtThe next event. |
Constructors Summary |
---|
public Event(Object target, int id, Object arg)Instantiates a new event with the specified target component, event type,
and argument.
this(target, 0l, id, 0, 0, 0, 0, arg);
|
public Event(Object target, long when, int id, int x, int y, int key, int modifiers)Instantiates a new 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.
this(target, when, id, x, y, key, modifiers, null);
|
public Event(Object target, long when, int id, int x, int y, int key, int modifiers, Object arg)Instantiates a new event with the specified target component, time stamp,
event type, x and y coordinates, keyboard key, state of the modifier
keys, and an argument.
this.target = target;
this.when = when;
this.id = id;
this.x = x;
this.y = y;
this.key = key;
this.modifiers = modifiers;
this.arg = arg;
|
Methods Summary |
---|
public boolean | controlDown()Checks if Control key is down or not.
return (modifiers & CTRL_MASK) != 0;
|
private java.lang.String | getModifiersString()Gets a string representation of the modifiers.
String strMod = ""; //$NON-NLS-1$
if (shiftDown()) {
strMod += ",shift"; //$NON-NLS-1$
}
if (controlDown()) {
strMod += ",control"; //$NON-NLS-1$
}
if (metaDown()) {
strMod += ",meta"; //$NON-NLS-1$
}
return strMod;
|
public boolean | metaDown()Checks if Meta key is down or not.
return (modifiers & META_MASK) != 0;
|
protected java.lang.String | paramString()Returns a string representing the state of this Event.
return "id=" + id + ",x=" + x + ",y=" + y + //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
(key != 0 ? ",key=" + key + getModifiersString() : "") + //$NON-NLS-1$ //$NON-NLS-2$
",target=" + target + //$NON-NLS-1$
(arg != null ? ",arg=" + arg : ""); //$NON-NLS-1$ //$NON-NLS-2$
|
public boolean | shiftDown()Checks if Shift key is down or not.
return (modifiers & SHIFT_MASK) != 0;
|
public java.lang.String | toString()Returns a string representation of this Event.
/*
* The format is based on 1.5 release behavior which can be revealed by
* the following code: Event e = new Event(new Button(), 0l,
* Event.KEY_PRESS, 0, 0, Event.TAB, Event.SHIFT_MASK, "arg");
* System.out.println(e);
*/
return getClass().getName() + "[" + paramString() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
|
public void | translate(int dx, int dy)Translates x and y coordinates of his event to the x+dx and x+dy
coordinates.
x += dx;
y += dy;
|