java::awt::AWTEvent Class Reference

Inheritance diagram for java::awt::AWTEvent:

Inheritance graph
java::awt::event::ActionEventjava::awt::event::AdjustmentEventjava::awt::event::ComponentEventjava::awt::event::HierarchyEventjava::awt::event::InvocationEventjava::awt::event::ItemEventjava::awt::event::TextEventjava::util::EventObjectjava::lang::Objectjava::awt::event::ContainerEventjava::awt::event::FocusEventjava::awt::event::InputEventjava::awt::event::PaintEventjava::awt::event::WindowEventjava::awt::event::KeyEventjava::awt::event::MouseEventjava::awt::event::MouseWheelEvent
[legend]
Collaboration diagram for java::awt::AWTEvent:

Collaboration graph
java::util::EventObjectjava::lang::Objectjava::lang::ObjectRefjava::lang::Interfacejava::lang::Comparable
[legend]

List of all members.


Detailed Description

The root event class for all AWT events.

This class and its subclasses supercede the original java.awt.Event class. Subclasses of this root AWTEvent class defined outside of the java.awt.event package should define event ID values greater than the value defined by RESERVED_ID_MAX.

The event masks defined in this class are needed by Component subclasses which are using Component.enableEvents() to select for event types not selected by registered listeners. If a listener is registered on a component, the appropriate event mask is already set internally by the component.

The masks are also used to specify to which types of events an AWTEventListener should listen. The masks are bitwise-ORed together and passed to Toolkit.addAWTEventListener.

See also:
Component::enableEvents

Toolkit::addAWTEventListener

java.awt.event.ActionEvent

java.awt.event.AdjustmentEvent

java.awt.event.ComponentEvent

java.awt.event.ContainerEvent

java.awt.event.FocusEvent

java.awt.event.InputMethodEvent

java.awt.event.InvocationEvent

java.awt.event.ItemEvent

java.awt.event.HierarchyEvent

java.awt.event.KeyEvent

java.awt.event.MouseEvent

java.awt.event.MouseWheelEvent

java.awt.event.PaintEvent

java.awt.event.TextEvent

java.awt.event.WindowEvent

Author:
Carl Quinn

Amy Fowler

Version:
1.50 01/27/03
Since:
1.1

Public Types

enum  EVENT_MASK {
  COMPONENT_EVENT_MASK = 0x01, CONTAINER_EVENT_MASK = 0x02, FOCUS_EVENT_MASK = 0x04, KEY_EVENT_MASK = 0x08,
  MOUSE_EVENT_MASK = 0x10, MOUSE_MOTION_EVENT_MASK = 0x20, WINDOW_EVENT_MASK = 0x40, ACTION_EVENT_MASK = 0x80,
  ADJUSTMENT_EVENT_MASK = 0x100, ITEM_EVENT_MASK = 0x200, TEXT_EVENT_MASK = 0x400, INPUT_METHOD_EVENT_MASK = 0x800,
  INPUT_METHODS_ENABLED_MASK = 0x1000, PAINT_EVENT_MASK = 0x2000, INVOCATION_EVENT_MASK = 0x4000, HIERARCHY_EVENT_MASK = 0x8000,
  HIERARCHY_BOUNDS_EVENT_MASK = 0x10000, MOUSE_WHEEL_EVENT_MASK = 0x20000, WINDOW_STATE_EVENT_MASK = 0x40000, WINDOW_FOCUS_EVENT_MASK = 0x80000,
  RESERVED_ID_MAX = 1999
}

Public Member Functions

 AWTEvent (const ObjectRef &source=0, jint id=0, jlong when=0, jboolean consumed=false)
 Constructs an AWTEvent object with the specified source object and type.
virtual void setSource (const ObjectRef &newSource)
 Retargets an event to a new source.
virtual jint getID () const
 Returns the event type.
virtual void consume ()
 Consumes this event, if this event can be consumed.
virtual jboolean isConsumed () const
 Returns whether this event has been consumed.
virtual jlong getWhen () const
 Returns the timestamp of when this event occurred.
virtual String toString () const
 Returns a String representation of this object.
virtual String paramString () const
 Returns a string representing the state of this Event.

Protected Attributes

jint id
 The event's id.
jlong when
 The event's Time stamp in UTC format.
jboolean consumed
 Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.

Member Enumeration Documentation

enum java::awt::AWTEvent::EVENT_MASK

Enumerator:
COMPONENT_EVENT_MASK  The event mask for selecting component events.
CONTAINER_EVENT_MASK  The event mask for selecting container events.
FOCUS_EVENT_MASK  The event mask for selecting focus events.
KEY_EVENT_MASK  The event mask for selecting key events.
MOUSE_EVENT_MASK  The event mask for selecting mouse events.
MOUSE_MOTION_EVENT_MASK  The event mask for selecting mouse motion events.
WINDOW_EVENT_MASK  The event mask for selecting window events.
ACTION_EVENT_MASK  The event mask for selecting action events.
ADJUSTMENT_EVENT_MASK  The event mask for selecting adjustment events.
ITEM_EVENT_MASK  The event mask for selecting item events.
TEXT_EVENT_MASK  The event mask for selecting text events.
INPUT_METHOD_EVENT_MASK  The event mask for selecting input method events.
INPUT_METHODS_ENABLED_MASK  The pseudo event mask for enabling input methods.

We're using one bit in the eventMask so we don't need a separate field inputMethodsEnabled.

PAINT_EVENT_MASK  The event mask for selecting paint events.
INVOCATION_EVENT_MASK  The event mask for selecting invocation events.
HIERARCHY_EVENT_MASK  The event mask for selecting hierarchy events.
HIERARCHY_BOUNDS_EVENT_MASK  The event mask for selecting hierarchy bounds events.
MOUSE_WHEEL_EVENT_MASK  The event mask for selecting mouse wheel events.

Since:
1.4
WINDOW_STATE_EVENT_MASK  The event mask for selecting window state events.

Since:
1.4
WINDOW_FOCUS_EVENT_MASK  The event mask for selecting window focus events.

Since:
1.4
RESERVED_ID_MAX  The maximum value for reserved AWT event IDs.

Programs defining their own event IDs should use IDs greater than this value.


Constructor & Destructor Documentation

java::awt::AWTEvent::AWTEvent ( const ObjectRef source = 0,
jint  id = 0,
jlong  when = 0,
jboolean  consumed = false 
)

Constructs an AWTEvent object with the specified source object and type.

Parameters:
source the object where the event originated the event type


Member Function Documentation

virtual void java::awt::AWTEvent::setSource ( const ObjectRef newSource  )  [virtual]

Retargets an event to a new source.

This method is typically used to retarget an event to a lightweight child Component of the original heavyweight source.

This method is intended to be used only by event targeting subsystems, such as client-defined KeyboardFocusManagers. It is not for general client use.

Parameters:
newSource the new Object to which the event should be dispatched

virtual jint java::awt::AWTEvent::getID (  )  const [virtual]

Returns the event type.

virtual void java::awt::AWTEvent::consume (  )  [virtual]

Consumes this event, if this event can be consumed.

Only low-level, system events can be consumed

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

virtual jboolean java::awt::AWTEvent::isConsumed (  )  const [virtual]

Returns whether this event has been consumed.

virtual jlong java::awt::AWTEvent::getWhen (  )  const [virtual]

Returns the timestamp of when this event occurred.

virtual String java::awt::AWTEvent::toString (  )  const [virtual]

Returns a String representation of this object.

Reimplemented from java::util::EventObject.

Reimplemented in java::awt::event::InvocationEvent.

virtual String java::awt::AWTEvent::paramString (  )  const [virtual]

Returns a string representing the state of this Event.

This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Returns:
a string representation of this event

Reimplemented in java::awt::event::ActionEvent, java::awt::event::AdjustmentEvent, java::awt::event::ComponentEvent, java::awt::event::ContainerEvent, java::awt::event::FocusEvent, java::awt::event::HierarchyEvent, java::awt::event::InvocationEvent, java::awt::event::ItemEvent, java::awt::event::KeyEvent, java::awt::event::MouseEvent, java::awt::event::MouseWheelEvent, java::awt::event::PaintEvent, java::awt::event::TextEvent, and java::awt::event::WindowEvent.


Member Data Documentation

jint java::awt::AWTEvent::id [protected]

The event's id.

See also:
getID()

AWTEvent

jlong java::awt::AWTEvent::when [protected]

The event's Time stamp in UTC format.

The time stamp indicates when the input event was created.

See also:
getWhen()

jboolean java::awt::AWTEvent::consumed [protected]

Controls whether or not the event is sent back down to the peer once the source has processed it - false means it's sent to the peer; true means it's not.

Semantic events always have a 'true' value since they were generated by the peer in response to a low-level event.

See also:
consume

isConsumed


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