java.awt.event
Class ActionEvent
- Serializable
This event is generated when an action on a component (such as a
button press) occurs.
static int | ACTION_FIRST - The first id number in the range of action id's.
|
static int | ACTION_LAST - The last id number in the range of action id's.
|
static int | ACTION_PERFORMED - An event id indicating that an action has occurred.
|
static int | ALT_MASK - Bit mask indicating that the alt key was pressed.
|
static int | CTRL_MASK - Bit mask indicating the control key was pressed.
|
static int | META_MASK - Bit mask indicating the that meta key was pressed.
|
static int | SHIFT_MASK - Bit mask indicating the shift key was pressed.
|
ACTION_EVENT_MASK , ADJUSTMENT_EVENT_MASK , COMPONENT_EVENT_MASK , CONTAINER_EVENT_MASK , FOCUS_EVENT_MASK , HIERARCHY_BOUNDS_EVENT_MASK , HIERARCHY_EVENT_MASK , INPUT_METHOD_EVENT_MASK , INVOCATION_EVENT_MASK , ITEM_EVENT_MASK , KEY_EVENT_MASK , MOUSE_EVENT_MASK , MOUSE_MOTION_EVENT_MASK , MOUSE_WHEEL_EVENT_MASK , PAINT_EVENT_MASK , RESERVED_ID_MAX , TEXT_EVENT_MASK , WINDOW_EVENT_MASK , WINDOW_FOCUS_EVENT_MASK , WINDOW_STATE_EVENT_MASK , consumed , id |
ActionEvent(Object source, int id, String command) - Initializes a new instance of
ActionEvent with the
specified source, id, and command.
|
ActionEvent(Object source, int id, String command, int modifiers) - Initializes a new instance of
ActionEvent with the
specified source, id, command, and modifiers.
|
ActionEvent(Object source, int id, String command, long when, int modifiers) - Initializes a new instance of
ActionEvent with the
specified source, id, command, and modifiers, and timestamp.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
ACTION_FIRST
public static final int ACTION_FIRST
The first id number in the range of action id's.
ACTION_LAST
public static final int ACTION_LAST
The last id number in the range of action id's.
ACTION_PERFORMED
public static final int ACTION_PERFORMED
An event id indicating that an action has occurred.
ALT_MASK
public static final int ALT_MASK
Bit mask indicating that the alt key was pressed.
CTRL_MASK
public static final int CTRL_MASK
Bit mask indicating the control key was pressed.
META_MASK
public static final int META_MASK
Bit mask indicating the that meta key was pressed.
SHIFT_MASK
public static final int SHIFT_MASK
Bit mask indicating the shift key was pressed.
ActionEvent
public ActionEvent(Object source,
int id,
String command)
Initializes a new instance of ActionEvent
with the
specified source, id, and command. Note that an invalid id leads to
unspecified results.
source
- the event sourceid
- the event idcommand
- the command string for this action
ActionEvent
public ActionEvent(Object source,
int id,
String command,
int modifiers)
Initializes a new instance of ActionEvent
with the
specified source, id, command, and modifiers. Note that an invalid id
leads to unspecified results.
source
- the event sourceid
- the event idcommand
- the command string for this actionmodifiers
- the bitwise or of modifier keys down during the action
ActionEvent
public ActionEvent(Object source,
int id,
String command,
long when,
int modifiers)
Initializes a new instance of ActionEvent
with the
specified source, id, command, and modifiers, and timestamp. Note that
an invalid id leads to unspecified results.
source
- the event sourceid
- the event idcommand
- the command string for this actionwhen
- the timestamp of the eventmodifiers
- the bitwise or of modifier keys down during the action
getActionCommand
public String getActionCommand()
Returns the command string associated with this action.
- the command string associated with this action
getModifiers
public int getModifiers()
Returns the keys held down during the action. This value will be a
combination of the bit mask constants defined in this class, or 0 if no
modifiers were pressed.
getWhen
public long getWhen()
Gets the timestamp of when this action took place. Usually, this
corresponds to the timestamp of the underlying InputEvent.
- the timestamp of this action
paramString
public String paramString()
Returns a string that identifies the action event. This is in the format
"ACTION_PERFORMED,cmd=" + getActionCommand() + ",when=" + getWhen()
+ ",modifiers=" + <modifier string>
, where the modifier
string is in the order "Meta", "Ctrl", "Alt", "Shift", "Alt Graph", and
"Button1", separated by '+', according to the bits set in getModifiers().
- paramString in interface AWTEvent
- a string identifying the event
ActionEvent.java -- an action has been triggered
Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.