java::awt::event::InputEvent Class Reference

Inheritance diagram for java::awt::event::InputEvent:

Inheritance graph
java::awt::event::KeyEventjava::awt::event::MouseEventjava::awt::event::ComponentEventjava::awt::AWTEventjava::util::EventObjectjava::lang::Objectjava::awt::event::MouseWheelEvent
[legend]
Collaboration diagram for java::awt::event::InputEvent:

Collaboration graph
java::awt::event::ComponentEventjava::awt::AWTEventjava::util::EventObjectjava::lang::Objectjava::lang::ObjectRefjava::lang::Interfacejava::lang::Comparable
[legend]

List of all members.


Detailed Description

The root event class for all component-level input events.

Input events are delivered to listeners before they are processed normally by the source where they originated. This allows listeners and component subclasses to "consume" the event so that the source will not process them in their default manner. For example, consuming mousePressed events on a Button component will prevent the Button from being activated.

Author:
Carl Quinn
Version:
1.29 01/23/03
See also:
KeyEvent

KeyAdapter

MouseEvent

MouseAdapter

MouseMotionAdapter

Since:
1.1

Public Types

enum  MODIFIER_MASK {
  SHIFT_DOWN_MASK = 1 << 0, CTRL_DOWN_MASK = 1 << 1, META_DOWN_MASK = 1 << 2, ALT_DOWN_MASK = 1 << 3,
  BUTTON1_DOWN_MASK = 1 << 4, BUTTON2_DOWN_MASK = 1 << 5, BUTTON3_DOWN_MASK = 1 << 6, ALT_GRAPH_DOWN_MASK = 1 << 7
}

Public Member Functions

virtual jint getModifiers () const
 Returns the modifier mask for this event.
virtual void consume ()
 Consumes this event so that it will not be processed in the default manner by the source which originated it.
virtual jboolean isShiftDown () const
 Returns whether or not the Shift modifier is down on this event.
virtual jboolean isControlDown () const
 Returns whether or not the Control modifier is down on this event.
virtual jboolean isMetaDown () const
 Returns whether or not the Meta modifier is down on this event.
virtual jboolean isAltDown () const
 Returns whether or not the Alt modifier is down on this event.
virtual jboolean isButton1Down () const
 Returns whether or not the Button1 modifier is down on this event.
virtual jboolean isButton2Down () const
 Returns whether or not the Button1 modifier is down on this event.
virtual jboolean isButton3Down () const
 Returns whether or not the Button1 modifier is down on this event.
virtual jboolean isAltGraphDown () const
 Returns whether or not the AltGraph modifier is down on this event.

Static Public Member Functions

static String getModifiersText (jint modifiers)
 Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".

Protected Member Functions

 InputEvent (const Ref< Component > &source=0, jint id=0, jlong when=0, jint modifiers=0)
 Constructs an InputEvent object with the specified source component, modifiers, and type.

Protected Attributes

jint modifiers
 The state of the modifier mask at the time the input event was fired.

Member Enumeration Documentation

enum java::awt::event::InputEvent::MODIFIER_MASK

Enumerator:
SHIFT_DOWN_MASK  The Shift key extended modifier constant.

Since:
1.4
CTRL_DOWN_MASK  The Control key extended modifier constant.

Since:
1.4
META_DOWN_MASK  The Meta key extended modifier constant.

Since:
1.4
ALT_DOWN_MASK  The Alt key extended modifier constant.

Since:
1.4
BUTTON1_DOWN_MASK  The Mouse Button1 extended modifier constant.

Since:
1.4
BUTTON2_DOWN_MASK  The Mouse Button2 extended modifier constant.

Since:
1.4
BUTTON3_DOWN_MASK  The Mouse Button3 extended modifier constant.

Since:
1.4
ALT_GRAPH_DOWN_MASK  The AltGraph key extended modifier constant.

Since:
1.4


Constructor & Destructor Documentation

java::awt::event::InputEvent::InputEvent ( const Ref< Component > &  source = 0,
jint  id = 0,
jlong  when = 0,
jint  modifiers = 0 
) [protected]

Constructs an InputEvent object with the specified source component, modifiers, and type.

Parameters:
source the object where the event originated
id the event type
when the time the event occurred
modifiers represents the modifier keys and mouse buttons down while the event occurred


Member Function Documentation

virtual jint java::awt::event::InputEvent::getModifiers (  )  const [virtual]

Returns the modifier mask for this event.

virtual void java::awt::event::InputEvent::consume (  )  [virtual]

Consumes this event so that it will not be processed in the default manner by the source which originated it.

Reimplemented from java::awt::AWTEvent.

Reimplemented in java::awt::event::KeyEvent, and java::awt::event::MouseEvent.

virtual jboolean java::awt::event::InputEvent::isShiftDown (  )  const [virtual]

Returns whether or not the Shift modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isControlDown (  )  const [virtual]

Returns whether or not the Control modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isMetaDown (  )  const [virtual]

Returns whether or not the Meta modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isAltDown (  )  const [virtual]

Returns whether or not the Alt modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isButton1Down (  )  const [virtual]

Returns whether or not the Button1 modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isButton2Down (  )  const [virtual]

Returns whether or not the Button1 modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isButton3Down (  )  const [virtual]

Returns whether or not the Button1 modifier is down on this event.

virtual jboolean java::awt::event::InputEvent::isAltGraphDown (  )  const [virtual]

Returns whether or not the AltGraph modifier is down on this event.

static String java::awt::event::InputEvent::getModifiersText ( jint  modifiers  )  [static]

Returns a String describing the extended modifier keys and mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".

These strings can be localized by changing the awt.properties file.

Parameters:
modifiers a modifier mask describing the extended modifier keys and mouse buttons for the event
Returns:
a text description of the combination of extended modifier keys and mouse buttons that were held down during the event.
Since:
1.4


Member Data Documentation

jint java::awt::event::InputEvent::modifiers [protected]

The state of the modifier mask at the time the input event was fired.

See also:
getModifiers()

getModifiersEx()

java.awt.event.KeyEvent

java.awt.event.MouseEvent


The documentation for this class was generated from the following file:
Generated on Fri May 16 11:56:16 2008 for CrossPlatformJavaLikeC++API by  doxygen 1.5.3