java::awt::event::ComponentEvent Class Reference

Inheritance diagram for java::awt::event::ComponentEvent:

Inheritance graph
java::awt::event::ContainerEventjava::awt::event::FocusEventjava::awt::event::InputEventjava::awt::event::PaintEventjava::awt::event::WindowEventjava::awt::AWTEventjava::util::EventObjectjava::lang::Objectjava::awt::event::KeyEventjava::awt::event::MouseEventjava::awt::event::MouseWheelEvent
[legend]
Collaboration diagram for java::awt::event::ComponentEvent:

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

List of all members.


Detailed Description

A low-level event which indicates that a component moved, changed size, or changed visibility (also, the root class for the other component-level events).

Component events are provided for notification purposes ONLY; The AWT will automatically handle component moves and resizes internally so that GUI layout works properly regardless of whether a program is receiving these events or not.

In addition to serving as the base class for other component-related events (InputEvent, FocusEvent, WindowEvent, ContainerEvent), this class defines the events that indicate changes in a component's size, position, or visibility.

This low-level event is generated by a component object (such as a List) when the component is moved, resized, rendered invisible, or made visible again. The event is passed to every ComponentListener or ComponentAdapter object which registered to receive such events using the component's addComponentListener method. (ComponentAdapter objects implement the ComponentListener interface.) Each such listener object gets this ComponentEvent when the event occurs.

See also:
ComponentAdapter

ComponentListener

Tutorial: Writing a Component Listener

Reference: The Java Class Libraries (update file)

Author:
Carl Quinn
Version:
1.25 01/23/03
Since:
1.1

Public Types

enum  COMPONENT_EVENT_ID {
  COMPONENT_FIRST = 100, COMPONENT_MOVED = COMPONENT_FIRST, COMPONENT_RESIZED, COMPONENT_SHOWN,
  COMPONENT_HIDDEN, COMPONENT_LAST = COMPONENT_HIDDEN
}

Public Member Functions

 ComponentEvent (const Ref< Component > &source=0, jint id=COMPONENT_FIRST, jlong when=0)
 Constructs a ComponentEvent object.
virtual Ref< ComponentgetComponent () const
 Returns the originator of the event.
virtual String paramString () const
 Returns a parameter string identifying this event.

Member Enumeration Documentation

enum java::awt::event::ComponentEvent::COMPONENT_EVENT_ID

Enumerator:
COMPONENT_FIRST  The first number in the range of ids used for component events.
COMPONENT_MOVED  This event indicates that the component's position changed.
COMPONENT_RESIZED  This event indicates that the component's size changed.
COMPONENT_SHOWN  This event indicates that the component was made visible.
COMPONENT_HIDDEN  This event indicates that the component was rendered invisible.
COMPONENT_LAST  The last number in the range of ids used for component events.


Constructor & Destructor Documentation

java::awt::event::ComponentEvent::ComponentEvent ( const Ref< Component > &  source = 0,
jint  id = COMPONENT_FIRST,
jlong  when = 0 
)

Constructs a ComponentEvent object.

Note that passing in an invalid id results in unspecified behavior.

Parameters:
source the Component that originated the event
id an integer indicating the type of event


Member Function Documentation

virtual Ref<Component> java::awt::event::ComponentEvent::getComponent (  )  const [virtual]

Returns the originator of the event.

Returns:
the Component object that originated the event, or null if the object is not a Component.

virtual String java::awt::event::ComponentEvent::paramString (  )  const [virtual]

Returns a parameter string identifying this event.

This method is useful for event-logging and for debugging.

Returns:
a string identifying the event and its attributes

Reimplemented from java::awt::AWTEvent.

Reimplemented in java::awt::event::ContainerEvent, java::awt::event::FocusEvent, java::awt::event::KeyEvent, java::awt::event::MouseEvent, java::awt::event::MouseWheelEvent, java::awt::event::PaintEvent, and java::awt::event::WindowEvent.


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