java::awt::event::WindowEvent Class Reference

Inheritance diagram for java::awt::event::WindowEvent:

Inheritance graph
java::awt::event::ComponentEventjava::awt::AWTEventjava::util::EventObjectjava::lang::Object
[legend]
Collaboration diagram for java::awt::event::WindowEvent:

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

A low-level event that indicates that a window has changed its status.

This low-level event is generated by a Window object when it is opened, closed, activated, deactivated, iconified, or deiconified, or when focus is transfered into or out of the Window.

The event is passed to every WindowListener or WindowAdapter object which registered to receive such events using the window's addWindowListener method. (WindowAdapter objects implement the WindowListener interface.) Each such listener object gets this WindowEvent when the event occurs.

Author:
Carl Quinn

Amy Fowler

Version:
1.30, 01/23/03
See also:
WindowAdapter

WindowListener

Tutorial: Writing a Window Listener

Reference: The Java Class Libraries (update file)

Since:
JDK1.1

Public Types

enum  WINDOW_EVENT_ID {
  WINDOW_FIRST = 200, WINDOW_OPENED = WINDOW_FIRST, WINDOW_CLOSING, WINDOW_CLOSED,
  WINDOW_ICONIFIED, WINDOW_DEICONIFIED, WINDOW_ACTIVATED, WINDOW_DEACTIVATED,
  WINDOW_FOCUS_FIRST, WINDOW_GAINED_FOCUS = WINDOW_FOCUS_FIRST, WINDOW_LOST_FOCUS, WINDOW_FOCUS_LAST = WINDOW_LOST_FOCUS,
  WINDOW_STATE_FIRST, WINDOW_STATE_CHANGED = WINDOW_STATE_FIRST, WINDOW_STATE_LAST = WINDOW_STATE_CHANGED, WINDOW_LAST = WINDOW_STATE_CHANGED
}

Public Member Functions

 WindowEvent (const Ref< Window > &source=0, jint id=WINDOW_FIRST, const Ref< Window > &opposit=0, jint oldState=0, jint newState=0)
 Constructs a WindowEvent object.
virtual Ref< WindowgetWindow () const
 Returns the originator of the event.
virtual Ref< WindowgetOppositeWindow () const
 Returns the other Window involved in this focus or activation change.
virtual jint getOldState () const
 For WINDOW_STATE_CHANGED events returns the previous state of the window.
virtual jint getNewState () const
 For WINDOW_STATE_CHANGED events returns the new state of the window.
virtual String paramString () const
 Returns a parameter string identifying this event.

Protected Attributes

Ref< Windowopposite
 The other Window involved in this focus or activation change.
jint oldState
 TBS.
jint newState

Member Enumeration Documentation

enum java::awt::event::WindowEvent::WINDOW_EVENT_ID

Enumerator:
WINDOW_FIRST  The first number in the range of ids used for window events.
WINDOW_OPENED  The window opened event.

This event is delivered only the first time a window is made visible.

WINDOW_CLOSING  The "window is closing" event.

This event is delivered when the user attempts to close the window from the window's system menu. If the program does not explicitly hide or dispose the window while processing this event, the window close operation will be cancelled.

WINDOW_CLOSED  The window closed event.

This event is delivered after the window has been closed as the result of a call to dispose.

WINDOW_ICONIFIED  The window iconified event.

This event is delivered when the window has been changed from a normal to a minimized state. For many platforms, a minimized window is displayed as the icon specified in the window's iconImage property.

See also:
java.awt.Frame::setIconImage
WINDOW_DEICONIFIED  The window deiconified event type.

This event is delivered when the window has been changed from a minimized to a normal state.

WINDOW_ACTIVATED  The window-activated event type.

This event is delivered when the Window becomes the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.

WINDOW_DEACTIVATED  The window-deactivated event type.

This event is delivered when the Window is no longer the active Window. Only a Frame or a Dialog can be the active Window. The native windowing system may denote the active Window or its children with special decorations, such as a highlighted title bar. The active Window is always either the focused Window, or the first Frame or Dialog that is an owner of the focused Window.

WINDOW_FOCUS_FIRST  The first number in the range of ids used for window focus events.
WINDOW_GAINED_FOCUS  The window-gained-focus event type.

This event is delivered when the Window becomes the focused Window, which means that the Window, or one of its subcomponents, will receive keyboard events.

WINDOW_LOST_FOCUS  The window-lost-focus event type.

This event is delivered when a Window is no longer the focused Window, which means keyboard events will no longer be delivered to the Window or any of its subcomponents.

WINDOW_FOCUS_LAST  The last number in the range of ids used for window focus events.
WINDOW_STATE_FIRST  The first number in the range of ids used for window state events.
WINDOW_STATE_CHANGED  The window-state-changed event type.

This event is delivered when a Window's state is changed by virtue of it being iconified, maximized etc.

Since:
1.4
WINDOW_STATE_LAST  The last number in the range of ids used for window state events.
WINDOW_LAST  The last number in the range of ids used for window events.


Constructor & Destructor Documentation

java::awt::event::WindowEvent::WindowEvent ( const Ref< Window > &  source = 0,
jint  id = WINDOW_FIRST,
const Ref< Window > &  opposit = 0,
jint  oldState = 0,
jint  newState = 0 
)

Constructs a WindowEvent object.

Parameters:
source the Window object that originated the event
id an integer indicating the type of event.
opposite the other window involved in the focus or activation change, or null
oldState previous state of the window for window state change event
newState new state of the window for window state change event
Since:
1.4


Member Function Documentation

virtual Ref<Window> java::awt::event::WindowEvent::getWindow (  )  const [virtual]

Returns the originator of the event.

Returns:
the Window object that originated the event

virtual Ref<Window> java::awt::event::WindowEvent::getOppositeWindow (  )  const [virtual]

Returns the other Window involved in this focus or activation change.

For a WINDOW_ACTIVATED or WINDOW_GAINED_FOCUS event, this is the Window that lost activation or focus. For a WINDOW_DEACTIVATED or WINDOW_LOST_FOCUS event, this is the Window that gained activation or focus. For any other type of WindowEvent, or if the focus or activation change occurs with a native application, with a Java application in a different VM or context, or with no other Window, null is returned.

Returns:
the other Window involved in the focus or activation change, or null
Since:
1.4

virtual jint java::awt::event::WindowEvent::getOldState (  )  const [virtual]

For WINDOW_STATE_CHANGED events returns the previous state of the window.

The state is represented as a bitwise mask.

Returns:
a bitwise mask of the previous window state
See also:
java.awt.Frame::getExtendedState()
Since:
1.4

virtual jint java::awt::event::WindowEvent::getNewState (  )  const [virtual]

For WINDOW_STATE_CHANGED events returns the new state of the window.

The state is represented as a bitwise mask.

Returns:
a bitwise mask of the new window state
See also:
java.awt.Frame::getExtendedState()
Since:
1.4

virtual String java::awt::event::WindowEvent::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::event::ComponentEvent.


Member Data Documentation

Ref<Window> java::awt::event::WindowEvent::opposite [protected]

The other Window involved in this focus or activation change.

For a WINDOW_ACTIVATED or WINDOW_GAINED_FOCUS event, this is the Window that lost activation or focus. For a WINDOW_DEACTIVATED or WINDOW_LOST_FOCUS event, this is the Window that gained activation or focus. For any other type of WindowEvent, or if the focus or activation change occurs with a native application, a Java application in a different VM, or with no other Window, null is returned.

See also:
getOppositeWindow
Since:
1.4

jint java::awt::event::WindowEvent::oldState [protected]

TBS.

jint java::awt::event::WindowEvent::newState [protected]


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