net.infonode.docking
Class FloatingWindow

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.infonode.gui.panel.BaseContainer
                      extended by net.infonode.gui.panel.BasePanel
                          extended by net.infonode.docking.DockingWindow
                              extended by net.infonode.docking.FloatingWindow
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class FloatingWindow
extends DockingWindow

A window that is floating on-top of the root window and containing another docking window.

A window can be maximized inside the floating window just as in a root window.

After a floating window has been closed it shouldn't be reused again.

Floating window inherits its component properties and shaped panel properties from the root window's window area. It is possible to set specific component and shaped panel properties for a floating window in the FloatingWindowProperties, see getFloatingWindowProperties().

A floating window is created by calling the RootWindow.createFloatingWindow(Point, Dimension, DockingWindow) method or indirectly created by calling the DockingWindow.undock(Point) method.

It's possible to add a menu bar to the floating window. Just call:

   myFloatingWindow.getRootPane().setJMenuBar(myMenuBar);
 

The floating window is placed as the BorderLayout.CENTER component of the content pane of the root pane. You can add additional components in the other BorderLayout positions. Example, add a status label at the bottom:

   myFloatingWindow.getRootPane().getContentPane().add(myStstusLabel, BroderLayout.SOUTH);
 

Since:
IDW 1.4.0
Version:
$Revision: 1.51 $
Author:
$Author: jesper $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.awt.event.AWTEventListener awtMouseEventListener
           
private  java.awt.Window dialog
           
private  javax.swing.JPanel dragPanel
           
private  DockingWindow maximizedWindow
           
private  PropertyMapTreeListener propertiesListener
           
private  ShapedPanel shapedPanel
           
private  java.lang.Runnable titleUpdater
           
private  DockingWindow window
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
FloatingWindow(RootWindow rootWindow)
           
FloatingWindow(RootWindow rootWindow, DockingWindow window, java.awt.Point p, java.awt.Dimension internalSize)
           
 
Method Summary
protected  DropAction acceptInteriorDrop(java.awt.Point p, DockingWindow window)
           
protected  boolean acceptsSplitWith(DockingWindow window)
           
protected  void afterWindowRemoved(DockingWindow window)
           
 void close()
          Removes this window from it's window parent.
protected  PropertyMap createPropertyObject()
           
protected  DropAction doAcceptDrop(java.awt.Point p, DockingWindow window)
           
protected  void doRemoveWindow(DockingWindow window)
           
protected  void doReplace(DockingWindow oldWindow, DockingWindow newWindow)
           
private  void doUpdateTitle()
           
protected  void fireTitleChanged()
           
 DockingWindow getChildWindow(int index)
          Returns the child window with index index.
 int getChildWindowCount()
          Returns the number of child windows.
(package private)  javax.swing.JPanel getDragPanel()
           
 FloatingWindowProperties getFloatingWindowProperties()
           Returns the property values for this floating window.
 javax.swing.Icon getIcon()
          Returns the icon for this window.
 DockingWindow getMaximizedWindow()
          Returns the maximized window in this floating window.
protected  PropertyMap getPropertyObject()
           
 DockingWindow getWindow()
          Returns the top level docking window inside this floating window.
 DockingWindowProperties getWindowProperties()
           Returns the properties for this window.
private  void internalSetMaximizedWindow(DockingWindow window)
           
 boolean isDockable()
          Returns true if this window can be docked to the root window from a floating window.
 boolean isMaximizable()
          Returns true if this window can be maximized by the user.
 boolean isMinimizable()
          Returns true if this window can be minimized by the user.
 boolean isRestorable()
          Returns true if this window can be restored by the user.
 boolean isUndockable()
          Returns true if this window can be undocked to a floating window.
 boolean isUndocked()
           
 void minimize()
          Floating window cannot be minimized
 void minimize(Direction direction)
          Floating window cannot be minimized
protected  DockingWindow read(java.io.ObjectInputStream in, ReadContext context, ViewReader viewReader)
           
(package private)  void removeWindowComponent(DockingWindow window)
           
(package private)  void restoreWindowComponent(DockingWindow window)
           
private  void setInternalSize(java.awt.Dimension size)
           
 void setMaximizedWindow(DockingWindow window)
          Sets the maximized window in this floating window.
 void setWindow(DockingWindow newWindow)
          Sets the top level docking window inside this floating window.
protected  void showChildWindow(DockingWindow window)
           
(package private)  void startDrag()
           
(package private)  void stopDrag()
           
protected  void update()
           
private  void updateFloatingWindow(java.util.Map map)
           
(package private)  boolean windowContainsPoint(java.awt.Point p)
           
protected  void write(java.io.ObjectOutputStream out, WriteContext context, ViewWriter viewWriter)
           
 
Methods inherited from class net.infonode.docking.DockingWindow
acceptChildDrop, acceptDrop, acceptSplitDrop, addListener, addTabMouseButtonListener, addWindow, addWindowItem, beforeDrop, beginOptimize, beginUpdateModel, childGainedFocus, childInsideTab, childRemoved, cleanUpModel, clearChildrenFocus, clearFocus, closeWithAbort, createTabWindow, detach, dock, dockWithAbort, endOptimize, endUpdateModel, fireTabWindowMouseButtonEvent, fireTabWindowMouseButtonEvent, fireViewFocusChanged, fireWindowDocked, fireWindowDocked, fireWindowDocking, fireWindowHidden, fireWindowMaximized, fireWindowMaximizing, fireWindowMinimized, fireWindowMinimizing, fireWindowRestored, fireWindowRestoring, fireWindowShown, fireWindowUndocked, fireWindowUndocking, getAncestors, getBestFittedWindow, getChildDropFilter, getChildEdgeDepth, getChildWindowIndex, getContentWindow, getDefaultDropAction, getEdgeDepth, getInsertTabDropFilter, getInteriorDropFilter, getLastFocusedChildWindow, getLocationWindow, getOptimizedWindow, getPopupMenuFactory, getPreferredFocusChild, getPreferredMinimizeDirection, getRootWindow, getSplitDropFilter, getTab, getTitle, getUpdateModel, getWindowItem, getWindowParent, hasParent, init, insideTab, internalClose, internalReplaceChildWindow, isChildShowingInRootWindow, isClosable, isMaximized, isMinimized, isShowingInRootWindow, makeVisible, maximize, maximizeWithAbort, minimizeWithAbort, minimizeWithAbort, needsTitleWindow, notifyListeners, oldRead, optimizeAfter, optimizeWindowLayout, readLocations, removeChildWindow, removeListener, removeTabMouseButtonListener, removeWindow, replaceChildWindow, restore, restoreFocus, restoreWithAbort, rootChanged, setFocused, setLastMinimizedDirection, setPopupMenuFactory, setPreferredMinimizeDirection, showPopupMenu, showsWindowTitle, split, split, startDrag, storeAncestors, toString, undock, undockWithAbort, updateButtonVisibility, updateWindowItem, updateWindowItems, writeLocations
 
Methods inherited from class net.infonode.gui.panel.BasePanel
setComponent, setSouthComponent
 
Methods inherited from class net.infonode.gui.panel.BaseContainer
paintComponent, setBackground, setFont, setForeground, setOpaque, setUI
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

window

private DockingWindow window

dialog

private java.awt.Window dialog

dragPanel

private javax.swing.JPanel dragPanel

shapedPanel

private ShapedPanel shapedPanel

maximizedWindow

private DockingWindow maximizedWindow

titleUpdater

private java.lang.Runnable titleUpdater

awtMouseEventListener

private java.awt.event.AWTEventListener awtMouseEventListener

propertiesListener

private PropertyMapTreeListener propertiesListener
Constructor Detail

FloatingWindow

FloatingWindow(RootWindow rootWindow)

FloatingWindow

FloatingWindow(RootWindow rootWindow,
               DockingWindow window,
               java.awt.Point p,
               java.awt.Dimension internalSize)
Method Detail

setWindow

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

Parameters:
newWindow - the top level docking window, null for no window i.e. empty floating window

getWindow

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

Returns:
the top level docking window inside this floating window

setMaximizedWindow

public void setMaximizedWindow(DockingWindow window)
Sets the maximized window in this floating window.

Parameters:
window - the window to maximize, must be a member of the window tree inside this floating window

getMaximizedWindow

public DockingWindow getMaximizedWindow()
Returns the maximized window in this floating window.

Returns:
maximized window or null if no window is maximized

getFloatingWindowProperties

public FloatingWindowProperties getFloatingWindowProperties()

Returns the property values for this floating window.

Floating window inherits its component properties and shaped panel properties from the root window's window area. It is possible to set specific component and shaped panel properties for a floating window in the FloatingWindowProperties.

Returns:
the property values for this floating window

getWindowProperties

public DockingWindowProperties getWindowProperties()

Returns the properties for this window.

Note: A floating window only uses the close enabled and title provider properties of the docking window properties.

Overrides:
getWindowProperties in class DockingWindow
Returns:
the properties for this window

minimize

public void minimize()
Floating window cannot be minimized

Overrides:
minimize in class DockingWindow

minimize

public void minimize(Direction direction)
Floating window cannot be minimized

Overrides:
minimize in class DockingWindow
Parameters:
direction -

isDockable

public boolean isDockable()
Description copied from class: DockingWindow
Returns true if this window can be docked to the root window from a floating window.

Overrides:
isDockable in class DockingWindow
Returns:
true if this window can be docked
See Also:
DockingWindow.dock()

isMaximizable

public boolean isMaximizable()
Description copied from class: DockingWindow
Returns true if this window can be maximized by the user.

Overrides:
isMaximizable in class DockingWindow
Returns:
true if this window can be maximized
See Also:
DockingWindow.maximize()

isMinimizable

public boolean isMinimizable()
Description copied from class: DockingWindow
Returns true if this window can be minimized by the user.

Overrides:
isMinimizable in class DockingWindow
Returns:
true if this window can be minimized
See Also:
DockingWindow.minimize()

isRestorable

public boolean isRestorable()
Description copied from class: DockingWindow
Returns true if this window can be restored by the user.

Overrides:
isRestorable in class DockingWindow
Returns:
true if this window can be restored
See Also:
DockingWindow.restore()

isUndockable

public boolean isUndockable()
Description copied from class: DockingWindow
Returns true if this window can be undocked to a floating window.

Overrides:
isUndockable in class DockingWindow
Returns:
true if this window can be undocked
See Also:
DockingWindow.undock(Point)

close

public void close()
Description copied from class: DockingWindow

Removes this window from it's window parent. If the window parent is a split window or a tab window with one child, it will be removed as well.

The location of this window is saved and the window can be restored to that location using the DockingWindow.restore() method.

This method will call the DockingWindowListener.windowClosed(DockingWindow) method of all the listeners of this window and all window ancestors. The listeners of child windows will not be notified, for example closing a tab window containing views will not notify the listeners of views in that tab window.

Overrides:
close in class DockingWindow

getIcon

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

Specified by:
getIcon in class DockingWindow
Returns:
the icon

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

isUndocked

public boolean isUndocked()
Overrides:
isUndocked in class DockingWindow

startDrag

void startDrag()

stopDrag

void stopDrag()

getDragPanel

javax.swing.JPanel getDragPanel()

windowContainsPoint

boolean windowContainsPoint(java.awt.Point p)

internalSetMaximizedWindow

private void internalSetMaximizedWindow(DockingWindow window)

doReplace

protected void doReplace(DockingWindow oldWindow,
                         DockingWindow newWindow)
Specified by:
doReplace in class DockingWindow

doRemoveWindow

protected void doRemoveWindow(DockingWindow window)
Specified by:
doRemoveWindow in class DockingWindow

afterWindowRemoved

protected void afterWindowRemoved(DockingWindow window)
Overrides:
afterWindowRemoved in class DockingWindow

doUpdateTitle

private void doUpdateTitle()

acceptsSplitWith

protected boolean acceptsSplitWith(DockingWindow window)
Overrides:
acceptsSplitWith in class DockingWindow

doAcceptDrop

protected DropAction doAcceptDrop(java.awt.Point p,
                                  DockingWindow window)
Overrides:
doAcceptDrop in class DockingWindow

acceptInteriorDrop

protected DropAction acceptInteriorDrop(java.awt.Point p,
                                        DockingWindow window)
Overrides:
acceptInteriorDrop in class DockingWindow

update

protected void update()
Specified by:
update in class DockingWindow

removeWindowComponent

void removeWindowComponent(DockingWindow window)
Specified by:
removeWindowComponent in class DockingWindow

restoreWindowComponent

void restoreWindowComponent(DockingWindow window)
Specified by:
restoreWindowComponent in class DockingWindow

showChildWindow

protected void showChildWindow(DockingWindow window)
Overrides:
showChildWindow in class DockingWindow

getPropertyObject

protected PropertyMap getPropertyObject()
Specified by:
getPropertyObject in class DockingWindow

createPropertyObject

protected PropertyMap createPropertyObject()
Specified by:
createPropertyObject in class DockingWindow

updateFloatingWindow

private void updateFloatingWindow(java.util.Map map)

fireTitleChanged

protected void fireTitleChanged()
Overrides:
fireTitleChanged in class DockingWindow

setInternalSize

private void setInternalSize(java.awt.Dimension size)

read

protected DockingWindow read(java.io.ObjectInputStream in,
                             ReadContext context,
                             ViewReader viewReader)
                      throws java.io.IOException
Throws:
java.io.IOException

write

protected void write(java.io.ObjectOutputStream out,
                     WriteContext context,
                     ViewWriter viewWriter)
              throws java.io.IOException
Overrides:
write in class DockingWindow
Throws:
java.io.IOException