javax.rad.ui.container
Interface IWindow

All Superinterfaces:
IComponent, IContainer, INamedObject, IResource
All Known Subinterfaces:
IFrame, IInternalFrame, ILauncher
All Known Implementing Classes:
About, AbstractFrame, AbstractWindow, Error, Login, Message, SwingAbstractFrame, SwingApplet.SwingAppletLauncher, SwingApplication, SwingFrame, SwingInternalFrame, UIFrame, UIInternalFrame, UILauncher, UIWindow

public interface IWindow
extends IContainer

Platform and technology independent Window definition. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .

See Also:
Window, JWindow

Method Summary
 void centerRelativeTo(IComponent pComponent)
          Centers the window relative to the specified component.
 void dispose()
          Releases all of the native screen resources used by this IWindow, its subcomponents, and all of its owned children.
 WindowHandler eventWindowActivated()
          The EventHandler for the window activated event.
 WindowHandler eventWindowClosed()
          The EventHandler for the window closed event.
 WindowHandler eventWindowClosing()
          The EventHandler for the window closing event.
 WindowHandler eventWindowDeactivated()
          The EventHandler for the window deactivated event.
 WindowHandler eventWindowDeiconified()
          The EventHandler for the window deiconified event.
 WindowHandler eventWindowIconified()
          The EventHandler for the window iconified event.
 WindowHandler eventWindowOpened()
          The EventHandler for the window opened event.
 boolean isActive()
          Returns whether this IWindow is active.
 boolean isDisposed()
          Checks whether the window is disposed already.
 void pack()
          Causes this IWindow to be sized to fit the preferred size and layouts of its subcomponents.
 void toBack()
          If this IWindow is visible, sends this IWindow to the back and may cause it to lose focus or activation if it is the focused or active Window.
 void toFront()
          If this IWindow is visible, brings this IWindow to the front and may make it the focused Window.
 
Methods inherited from interface javax.rad.ui.IContainer
add, add, add, add, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, setLayout
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Method Detail

pack

void pack()
Causes this IWindow to be sized to fit the preferred size and layouts of its subcomponents. If the window and/or its owner are not yet displayable, both are made displayable before calculating the preferred size. The IWindow will be validated after the preferredSize is calculated.


dispose

void dispose()
Releases all of the native screen resources used by this IWindow, its subcomponents, and all of its owned children. That is, the resources for these IComponents will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.

The IWindow and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the IWindow was disposed (not accounting for additional modifications between those actions).

See Also:
pack(), IComponent.setVisible(boolean)

isDisposed

boolean isDisposed()
Checks whether the window is disposed already.

Returns:
true if the window is disposed, otherwiese false

isActive

boolean isActive()
Returns whether this IWindow is active. Only a Frame or a Dialog may be active. 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.

Returns:
whether this is the active Window.

toFront

void toFront()
If this IWindow is visible, brings this IWindow to the front and may make it the focused Window.

Places this IWindow at the top of the stacking order and shows it in front of any other Windows in this VM. No action will take place if this Window is not visible. Some platforms do not allow Windows which own other Windows to appear on top of those owned Windows. Some platforms may not permit this VM to place its Windows above windows of native applications, or Windows of other VMs. This permission may depend on whether a Window in this VM is already focused. Every attempt will be made to move this Window as high as possible in the stacking order; however, developers should not assume that this method will move this Window above all other windows in every situation.

Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is the focused or active Window until this Window receives a WINDOW_GAINED_FOCUS or WINDOW_ACTIVATED event. On platforms where the top-most window is the focused window, this method will probably focus this Window, if it is not already focused. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged.

If this method causes this Window to be focused, and this Window is a Frame or a Dialog, it will also become activated. If this Window is focused, but it is not a Frame or a Dialog, then the first Frame or Dialog that is an owner of this Window will be activated.

If this window is blocked by modal dialog, then the blocking dialog is brought to the front and remains above the blocked window.

See Also:
toBack()

toBack

void toBack()
If this IWindow is visible, sends this IWindow to the back and may cause it to lose focus or activation if it is the focused or active Window.

Places this IWindow at the bottom of the stacking order and shows it behind any other Windows in this VM. No action will take place is this Window is not visible. Some platforms do not allow Windows which are owned by other Windows to appear below their owners. Every attempt will be made to move this Window as low as possible in the stacking order; however, developers should not assume that this method will move this Window below all other windows in every situation.

Because of variations in native windowing systems, no guarantees about changes to the focused and active Windows can be made. Developers must never assume that this Window is no longer the focused or active Window until this Window receives a WINDOW_LOST_FOCUS or WINDOW_DEACTIVATED event. On platforms where the top-most window is the focused window, this method will probably cause this Window to lose focus. In that case, the next highest, focusable Window in this VM will receive focus. On platforms where the stacking order does not typically affect the focused window, this method will probably leave the focused and active Windows unchanged.

See Also:
toFront()

centerRelativeTo

void centerRelativeTo(IComponent pComponent)
Centers the window relative to the specified component. If the component is not currently showing, or pComponent is null, the window is centered on the screen.

Parameters:
pComponent - the component in relation to which the window's location is determined

eventWindowOpened

WindowHandler eventWindowOpened()
The EventHandler for the window opened event.

Returns:
the EventHandler for the window opened event.

eventWindowClosing

WindowHandler eventWindowClosing()
The EventHandler for the window closing event.

Returns:
the EventHandler for the window closing event.

eventWindowClosed

WindowHandler eventWindowClosed()
The EventHandler for the window closed event.

Returns:
the EventHandler for the window closed event.

eventWindowIconified

WindowHandler eventWindowIconified()
The EventHandler for the window iconified event.

Returns:
the EventHandler for the window iconified event.

eventWindowDeiconified

WindowHandler eventWindowDeiconified()
The EventHandler for the window deiconified event.

Returns:
the EventHandler for the window deiconified event.

eventWindowActivated

WindowHandler eventWindowActivated()
The EventHandler for the window activated event.

Returns:
the EventHandler for the window activated event.

eventWindowDeactivated

WindowHandler eventWindowDeactivated()
The EventHandler for the window deactivated event.

Returns:
the EventHandler for the window deactivated event.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.