javax.rad.genui.container
Class AbstractWindow<C extends IWindow>

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<C>
          extended by javax.rad.genui.UIContainer<C>
              extended by javax.rad.genui.container.AbstractWindow<C>
Type Parameters:
C - instance of IWindow
All Implemented Interfaces:
ITranslatable, IWindow, IComponent, IContainer, IResource, INamedObject
Direct Known Subclasses:
AbstractFrame, UIWindow

public abstract class AbstractWindow<C extends IWindow>
extends UIContainer<C>
implements IWindow

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


Field Summary
 
Fields inherited from class javax.rad.genui.UIContainer
components
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Constructor Summary
protected AbstractWindow(C pWindow)
          Creates a new instance of AbstractWindow.
 
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 setVisible(boolean pVisible)
          Shows or hides this component depending on the value of parameter b.
 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.
protected  void topLevelAddNotify()
          Top level window or frame has to start addNotify, if not notified.
 
Methods inherited from class javax.rad.genui.UIContainer
add, add, add, add, addNotify, beforeAddNotify, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, removeNotify, setLayout, setZOrder, updateTranslation
 
Methods inherited from class javax.rad.genui.UIComponent
capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, requestFocus, setBackground, setBounds, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
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
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 

Constructor Detail

AbstractWindow

protected AbstractWindow(C pWindow)
Creates a new instance of AbstractWindow.

Parameters:
pWindow - the IWindow
See Also:
IWindow
Method Detail

topLevelAddNotify

protected void topLevelAddNotify()
Top level window or frame has to start addNotify, if not notified.


pack

public 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.

Specified by:
pack in interface IWindow

setVisible

public void setVisible(boolean pVisible)
Shows or hides this component depending on the value of parameter b.

Specified by:
setVisible in interface IComponent
Overrides:
setVisible in class UIComponent<C extends IWindow>
Parameters:
pVisible - if true, shows this component; otherwise, hides this component
See Also:
IComponent.isVisible()

dispose

public 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).

Specified by:
dispose in interface IWindow
See Also:
IWindow.pack(), IComponent.setVisible(boolean)

isDisposed

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

Specified by:
isDisposed in interface IWindow
Returns:
true if the window is disposed, otherwiese false

isActive

public 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.

Specified by:
isActive in interface IWindow
Returns:
whether this is the active Window.

toFront

public 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.

Specified by:
toFront in interface IWindow
See Also:
IWindow.toBack()

toBack

public 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.

Specified by:
toBack in interface IWindow
See Also:
IWindow.toFront()

centerRelativeTo

public 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.

Specified by:
centerRelativeTo in interface IWindow
Parameters:
pComponent - the component in relation to which the window's location is determined

eventWindowOpened

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

Specified by:
eventWindowOpened in interface IWindow
Returns:
the EventHandler for the window opened event.

eventWindowClosing

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

Specified by:
eventWindowClosing in interface IWindow
Returns:
the EventHandler for the window closing event.

eventWindowClosed

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

Specified by:
eventWindowClosed in interface IWindow
Returns:
the EventHandler for the window closed event.

eventWindowIconified

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

Specified by:
eventWindowIconified in interface IWindow
Returns:
the EventHandler for the window iconified event.

eventWindowDeiconified

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

Specified by:
eventWindowDeiconified in interface IWindow
Returns:
the EventHandler for the window deiconified event.

eventWindowActivated

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

Specified by:
eventWindowActivated in interface IWindow
Returns:
the EventHandler for the window activated event.

eventWindowDeactivated

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

Specified by:
eventWindowDeactivated in interface IWindow
Returns:
the EventHandler for the window deactivated event.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.