org.wings
Class SRootContainer

java.lang.Object
  extended by org.wings.SComponent
      extended by org.wings.SContainer
          extended by org.wings.SRootContainer
All Implemented Interfaces:
Serializable, Cloneable, Renderable
Direct Known Subclasses:
SFrame, SInternalFrame

public abstract class SRootContainer
extends SContainer

A root container. The classes derived from this class (SFrame and SInternalFrame) render in the content pane of this RootContainer.

The RootContainer has a stack of components. Ususally, the stack contains only one element, the content pane; this is the bottom-most component. When dialogs are added to the RootContainer, then these dialogs are stacked on top of this content pane and only that dialog is visible then. This emulates the behaviour of modal dialogs in a windowing system.

Author:
Holger Engels, Henner Zeller, Armin Haaf
See Also:
Serialized Form

Field Summary
protected  SContainer contentPane
          The container for the contentPane.
protected  SContainer windowsPane
          Contains all windows linked to this root container.
 
Fields inherited from class org.wings.SComponent
DONE_RENDERING, dynamicStyles, enabled, propertyChangeSupport, SELECTOR_ALL, START_RENDERING, visible, WHEN_FOCUSED_OR_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_IN_FOCUSED_FRAME
 
Constructor Summary
SRootContainer()
          default constructor initializes the stack layout system of this SRootContainer.
 
Method Summary
 SComponent addComponent(SComponent c, Object constraint, int index)
          Adds the component to the content pane of the root container.
 SContainer getContentPane()
          returns the content pane of this RootContainer.
 int getWindowCount()
           
 SContainer getWindowsPane()
          Returns the container that contains the windows linked to this root container.
protected  void initializeContentPane()
           
protected  void initializeWindowsPane()
           
 SWindow popWindow()
          remove the dialog, that is on top of the stack.
 void pushWindow(SWindow window)
          Push a new window on top of the stack.
 void remove(SComponent c)
          Removes the component from the content pane.
 void removeWindow(SWindow window)
           
 void setCG(RootContainerCG cg)
           
 void setContentPane(SContainer container)
          Sets the container for the contentPane.
protected  void setWindowsPane(SContainer windowsPane)
          Sets the container for the windowsPane.
 
Methods inherited from class org.wings.SContainer
add, add, add, add, addComponent, addComponent, addComponent, addContainerListener, addNotify, clone, fireContainerEvent, getComponent, getComponentCount, getComponentList, getComponents, getConstraintAt, getConstraintList, getLayout, invite, inviteEachComponent, isShowingChildren, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setCG, setLayout, setParentFrame, updateCG
 
Methods inherited from class org.wings.SComponent
addComponentListener, addDynamicStyle, addEventListener, addParentFrameListener, addPropertyChangeListener, addPropertyChangeListener, addRenderListener, addScriptListener, addStyle, fireComponentChangeEvent, fireFinalEvents, fireKeyEvents, fireRenderEvent, getActionMap, getBackground, getBorder, getCG, getClientProperty, getComponentPopupMenu, getDynamicStyle, getDynamicStyles, getFocusTraversalIndex, getFont, getForeground, getHorizontalAlignment, getInputMap, getInputMap, getListenerCount, getListenerList, getListeners, getLowLevelEventId, getName, getParent, getParentFrame, getPreferredSize, getRequestURL, getResidesInForm, getScriptListenerList, getScriptListeners, getSession, getShowAsFormComponent, getStyle, getToolTipText, getVerticalAlignment, isDifferent, isEnabled, isFocusOwner, isRecursivelyVisible, isReloadForced, isUpdatePossible, isVisible, paramString, processComponentEvent, processKeyEvents, processLowLevelEvent, putClientProperty, reload, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, reloadIfChange, removeComponentListener, removeDynamicStyle, removeEventListener, removeParentFrameListener, removePropertyChangeListener, removePropertyChangeListener, removeRenderListener, removeScriptListener, removeStyle, requestFocus, scrollRectToVisible, setActionMap, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributes, setBackground, setBorder, setCG, setComponentPopupMenu, setDynamicStyles, setEnabled, setFocusTraversalIndex, setFont, setForeground, setHorizontalAlignment, setInputMap, setInputMap, setName, setNameRaw, setParent, setPreferredSize, setReloadForced, setShowAsFormComponent, setStyle, setToolTipText, setVerticalAlignment, setVisible, toString, update, write
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

contentPane

protected SContainer contentPane
The container for the contentPane.


windowsPane

protected SContainer windowsPane
Contains all windows linked to this root container.

Constructor Detail

SRootContainer

public SRootContainer()
default constructor initializes the stack layout system of this SRootContainer.

Method Detail

initializeContentPane

protected void initializeContentPane()

initializeWindowsPane

protected void initializeWindowsPane()

setCG

public void setCG(RootContainerCG cg)

pushWindow

public void pushWindow(SWindow window)
Push a new window on top of the stack.

Parameters:
window - the SDialog that is to be shown on top.

popWindow

public SWindow popWindow()
remove the dialog, that is on top of the stack.

Returns:
the dialog, that is popped from the stack.

removeWindow

public void removeWindow(SWindow window)

getWindowCount

public int getWindowCount()
Returns:
the number of dialogs that are on the stack currently.

getContentPane

public SContainer getContentPane()
returns the content pane of this RootContainer.


getWindowsPane

public SContainer getWindowsPane()
Returns the container that contains the windows linked to this root container.

Returns:
The container that contains the windows linked to this root container.

setContentPane

public void setContentPane(SContainer container)
Sets the container for the contentPane.

Parameters:
container - the container for the contentPane.

setWindowsPane

protected void setWindowsPane(SContainer windowsPane)
Sets the container for the windowsPane. ! This is not like in swing. Each window object is bound to its frame or internal frame.

Parameters:
windowsPane - The container for the windowsPane.

addComponent

public SComponent addComponent(SComponent c,
                               Object constraint,
                               int index)
Adds the component to the content pane of the root container.

Overrides:
addComponent in class SContainer
Parameters:
c - the component to add
index - the index of the component
Returns:
the added component

remove

public void remove(SComponent c)
Removes the component from the content pane.

Overrides:
remove in class SContainer
Parameters:
c - the component to remove
See Also:
SContainer.remove(org.wings.SComponent)


wingS Swings ;-)