public class ConsumableActionEvent extends ActionEvent
ACTION_FIRST, ACTION_LAST, ACTION_PERFORMED, ALT_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
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
Constructor and Description |
---|
ConsumableActionEvent(Object source,
int id,
String command)
Constructs an
ActionEvent object. |
ConsumableActionEvent(Object source,
int id,
String command,
int modifiers)
Constructs an
ActionEvent object with modifier keys. |
ConsumableActionEvent(Object source,
int id,
String command,
long when,
int modifiers)
Constructs an
ActionEvent object with the specified modifier keys and timestamp. |
Modifier and Type | Method and Description |
---|---|
void |
consume()
Consumes this event, if this event can be consumed.
|
boolean |
isConsumed()
Returns whether this event has been consumed.
|
getActionCommand, getModifiers, getWhen, paramString
getSource
public ConsumableActionEvent(Object source, int id, String command)
ActionEvent
object.
Note that passing in an invalid id
results in unspecified behavior. This method throws an
IllegalArgumentException
if source
is null
. A null
command
string is legal, but not recommended.source
- the object that originated the eventid
- an integer that identifies the eventcommand
- a string that may specify a command (possibly one of several) associated with the eventIllegalArgumentException
- if source
is nullpublic ConsumableActionEvent(Object source, int id, String command, int modifiers)
ActionEvent
object with modifier keys.
Note that passing in an invalid id
results in unspecified behavior. This method throws an
IllegalArgumentException
if source
is null
. A null
command
string is legal, but not recommended.source
- the object that originated the eventid
- an integer that identifies the eventcommand
- a string that may specify a command (possibly one of several) associated with the eventmodifiers
- the modifier keys held down during this actionIllegalArgumentException
- if source
is nullpublic ConsumableActionEvent(Object source, int id, String command, long when, int modifiers)
ActionEvent
object with the specified modifier keys and timestamp.
Note that passing in an invalid id
results in unspecified behavior. This method throws an
IllegalArgumentException
if source
is null
. A null
command
string is legal, but not recommended.source
- the object that originated the eventid
- an integer that identifies the eventcommand
- a string that may specify a command (possibly one of several) associated with the eventwhen
- the time the event occurredmodifiers
- the modifier keys held down during this actionIllegalArgumentException
- if source
is nullpublic boolean isConsumed()
isConsumed
in class AWTEvent