net.infonode.docking
Class RootWindow

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bynet.infonode.gui.panel.BaseContainer
                      extended bynet.infonode.gui.panel.BasePanel
                          extended bynet.infonode.docking.DockingWindow
                              extended bynet.infonode.docking.RootWindow
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Readable, ReadWritable, Serializable, Writable

public class RootWindow
extends DockingWindow
implements ReadWritable

The root window is a top level container for docking windows. Docking windows can't be dragged outside of their root window. The property values of a root window is inherited to the docking windows inside it.

Version:
$Revision: 1.129 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RootWindow(boolean heavyweightSupport, ViewSerializer viewSerializer)
          Creates an empty root window with support for heavyweight components inside the views.
RootWindow(boolean heavyweightSupport, ViewSerializer viewSerializer, DockingWindow window)
          Creates a root window with support for heavyweight components inside the views and the given window inside as window inside this root window.
RootWindow(ViewSerializer viewSerializer)
          Creates an empty root window.
RootWindow(ViewSerializer viewSerializer, DockingWindow window)
          Creates a root window with the given window as window inside this root window.
 
Method Summary
 FloatingWindow createFloatingWindow(Point location, Dimension innerSize, DockingWindow window)
           Creates and shows a floating window with the given window as top-level window in the floating window or without any top-level window i.e. empty floating window.
 DockingWindow getChildWindow(int index)
          Returns the child window with index index.
 int getChildWindowCount()
          Returns the number of child windows.
 Direction getClosestWindowBar(DockingWindow window)
          Returns the direction of the closest enabled window bar to a docking window.
 View getFocusedView()
          Returns the view that currently contains the focus.
 Icon getIcon()
          Returns the icon for this window.
 DockingWindow getMaximizedWindow()
          Returns the maximized window in this root window, or null if there no maximized window.
 RootWindow getRootWindow()
          Returns the RootWindow which contains this window, null if there is none.
 RootWindowProperties getRootWindowProperties()
          Returns the property values for this root window.
 ViewSerializer getViewSerializer()
          Returns the view serializer object for the views inside this root window.
 DockingWindow getWindow()
          Returns the top level docking window inside this root window.
 WindowBar getWindowBar(Direction direction)
          Returns the window bar in the direction.
 void read(ObjectInputStream in)
          Reads a previously written window state.
 void read(ObjectInputStream in, boolean readProperties)
          Reads a previously written window state.
 void removeView(View view)
          Removes all internal references to a view.
 void setMaximizedWindow(DockingWindow window)
          Sets the maximized window in this root window.
 void setWindow(DockingWindow newWindow)
          Sets the top level docking window inside this root window.
 void updateUI()
           
 void write(ObjectOutputStream out)
          Writes the state of this root window and all child windows.
 void write(ObjectOutputStream out, boolean writeProperties)
          Writes the state of this root window and all child windows.
 
Methods inherited from class net.infonode.docking.DockingWindow
addListener, addTabMouseButtonListener, close, closeWithAbort, dock, dockWithAbort, getChildWindowIndex, getLastFocusedChildWindow, getPopupMenuFactory, getPreferredMinimizeDirection, getTitle, getWindowParent, getWindowProperties, isClosable, isDockable, isMaximizable, isMaximized, isMinimizable, isMinimized, isRestorable, isUndockable, isUndocked, makeVisible, maximize, maximizeWithAbort, minimize, minimize, minimizeWithAbort, minimizeWithAbort, removeListener, removeTabMouseButtonListener, replaceChildWindow, restore, restoreFocus, restoreWithAbort, setPopupMenuFactory, setPreferredMinimizeDirection, split, startDrag, toString, undock, undockWithAbort
 
Methods inherited from class net.infonode.gui.panel.BaseContainer
setBackground, setFont, setForeground, setOpaque, setUI
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getWidth, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RootWindow

public RootWindow(ViewSerializer viewSerializer)
Creates an empty root window.

Parameters:
viewSerializer - used when reading and writing views
Since:
IDW 1.1.0

RootWindow

public RootWindow(boolean heavyweightSupport,
                  ViewSerializer viewSerializer)
Creates an empty root window with support for heavyweight components inside the views.

Parameters:
heavyweightSupport - true for heavy weight component support, otherwise false
viewSerializer - used when reading and writing views
Since:
IDW 1.4.0

RootWindow

public RootWindow(ViewSerializer viewSerializer,
                  DockingWindow window)
Creates a root window with the given window as window inside this root window.

Parameters:
viewSerializer - used when reading and writing views
window - the window that is placed inside the root window

RootWindow

public RootWindow(boolean heavyweightSupport,
                  ViewSerializer viewSerializer,
                  DockingWindow window)
Creates a root window with support for heavyweight components inside the views and the given window inside as window inside this root window.

Parameters:
heavyweightSupport - true for heavy weight component support, otherwise false
viewSerializer - used when reading and writing views
window - the window that is placed inside the root window
Since:
IDW 1.4.0
Method Detail

getFocusedView

public View getFocusedView()
Returns the view that currently contains the focus.

Returns:
The currently focused view, null if no view has focus

getRootWindowProperties

public RootWindowProperties getRootWindowProperties()
Returns the property values for this root window. The property values will be inherited to docking windows inside this root window.

Returns:
the property values for this root window

getClosestWindowBar

public Direction getClosestWindowBar(DockingWindow window)
Returns the direction of the closest enabled window bar to a docking window. The distance is measured from the window edge that is furthest away from the bar.

Parameters:
window - the docking window
Returns:
the direction of the closest enabled window bar to a docking window

getWindowBar

public WindowBar getWindowBar(Direction direction)
Returns the window bar in the direction.

Parameters:
direction - the direction
Returns:
the window bar in the direction

setWindow

public void setWindow(DockingWindow newWindow)
Sets the top level docking window inside this root window.

Parameters:
newWindow - the top level docking window

getWindow

public DockingWindow getWindow()
Returns the top level docking window inside this root window.

Returns:
the top level docking window inside this root window

createFloatingWindow

public FloatingWindow createFloatingWindow(Point location,
                                           Dimension innerSize,
                                           DockingWindow window)

Creates and shows a floating window with the given window as top-level window in the floating window or without any top-level window i.e. empty floating window.

Note 1: The created floating window is not visible per default. To make it visible, call FloatingWindow.getTopLevelAncestor().setVisible(true);

Note 2: Floating windows are dynamically created when a window is undocked and closed/removed when all windows inside the floating window has been removed (i.e. cloased/docked/undocked to another floating window) from the floating window. The root window has a refernce to the floating window as long as the floating window has windows inside it i.e. it is not necessary to keep references to the floating window because the root window will handle this.

Parameters:
location - the floating window's location on the screen
innerSize - the inner dimension of the floating window's top level container i.e.the size of the root pane
window - the docking window that is the top level window in this floating window or null for no top-level window i.e. empty floating window
Returns:
the floating window
Since:
IDW 1.4.0

getViewSerializer

public ViewSerializer getViewSerializer()
Returns the view serializer object for the views inside this root window.

Returns:
the view serializer object for the views inside this root window

getChildWindow

public DockingWindow getChildWindow(int index)
Description copied from class: DockingWindow
Returns the child window with index index.

Specified by:
getChildWindow in class DockingWindow
Parameters:
index - the child window index
Returns:
the child window

getChildWindowCount

public int getChildWindowCount()
Description copied from class: DockingWindow
Returns the number of child windows.

Specified by:
getChildWindowCount in class DockingWindow
Returns:
the number of child windows

getIcon

public Icon getIcon()
Description copied from class: DockingWindow
Returns the icon for this window.

Specified by:
getIcon in class DockingWindow
Returns:
the icon

write

public void write(ObjectOutputStream out)
           throws IOException
Writes the state of this root window and all child windows.

Specified by:
write in interface Writable
Parameters:
out - the stream on which to write the state
Throws:
IOException - if there is a stream error

write

public void write(ObjectOutputStream out,
                  boolean writeProperties)
           throws IOException
Writes the state of this root window and all child windows.

Parameters:
out - the stream on which to write the state
writeProperties - true if the property values for all docking windows should be written to the stream
Throws:
IOException - if there is a stream error

read

public void read(ObjectInputStream in)
          throws IOException
Reads a previously written window state. This will create child windows and read their state.

Specified by:
read in interface Readable
Parameters:
in - the stream from which to read the state
Throws:
IOException - if there is a stream error

read

public void read(ObjectInputStream in,
                 boolean readProperties)
          throws IOException
Reads a previously written window state. This will create child windows and read their state.

Parameters:
in - the stream from which to read the state
readProperties - true if the property values for all child windows should be read. This parameter can be set to true or false regardless of if the property values was included when the state was written, though obviously no property values are read if there aren't any in the stream.
Throws:
IOException - if there is a stream error

getMaximizedWindow

public DockingWindow getMaximizedWindow()
Returns the maximized window in this root window, or null if there no maximized window.

Returns:
the maximized window in this root window, or null if there no maximized window
Since:
IDW 1.1.0

setMaximizedWindow

public void setMaximizedWindow(DockingWindow window)
Sets the maximized window in this root window. This method takes the window component and displays it at the top in the root window. It does NOT modify the window tree structure, ie the window parent remains the unchanged.

Parameters:
window - the maximized window in this root window, null means no maximized window
Since:
IDW 1.1.0

removeView

public void removeView(View view)
Removes all internal references to a view. It's not possible to restore the view to the previous location after this method has been called. If the view is located in the window tree where this is the root nothing happens.

Parameters:
view - all internal references to this view are removed
Since:
IDW 1.4.0

getRootWindow

public RootWindow getRootWindow()
Description copied from class: DockingWindow
Returns the RootWindow which contains this window, null if there is none.

Overrides:
getRootWindow in class DockingWindow
Returns:
the RootWindow, null if there is none

updateUI

public void updateUI()


Copyright © 2007 NNL Technology AB. All Rights Reserved.