Class FloatingWindow
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
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
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
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
accessibleContext, 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected DropAction
acceptInteriorDrop
(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
protected DropAction
doAcceptDrop
(Point p, DockingWindow window) protected void
doRemoveWindow
(DockingWindow window) protected void
doReplace
(DockingWindow oldWindow, DockingWindow newWindow) protected void
getChildWindow
(int index) Returns the child window with index index.int
Returns the number of child windows.Returns the property values for this floating window.getIcon()
Returns the icon for this window.Returns the maximized window in this floating window.protected PropertyMap
Returns the top level docking window inside this floating window.Returns the properties for this window.boolean
Returns true if this window can be docked to the root window from a floating window.boolean
Returns true if this window can be maximized by the user.boolean
Returns true if this window can be minimized by the user.boolean
Returns true if this window can be restored by the user.boolean
Returns true if this window can be undocked to a floating window.boolean
void
minimize()
Floating window cannot be minimizedvoid
Floating window cannot be minimizedprotected DockingWindow
read
(ObjectInputStream in, ReadContext context, ViewReader viewReader) 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) protected void
update()
protected void
write
(ObjectOutputStream out, WriteContext context, ViewWriter viewWriter) Methods inherited from class net.infonode.docking.DockingWindow
acceptChildDrop, acceptSplitDrop, addListener, addTabMouseButtonListener, addWindow, addWindowItem, beforeDrop, beginOptimize, beginUpdateModel, childInsideTab, childRemoved, cleanUpModel, clearChildrenFocus, clearFocus, closeWithAbort, createTabWindow, detach, dock, dockWithAbort, endOptimize, endUpdateModel, fireViewFocusChanged, fireWindowHidden, fireWindowShown, getAncestors, getBestFittedWindow, getChildEdgeDepth, getChildWindowIndex, getContentWindow, getEdgeDepth, getLastFocusedChildWindow, getLocationWindow, getOptimizedWindow, getPopupMenuFactory, getPreferredFocusChild, getPreferredMinimizeDirection, getRootWindow, 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, showsWindowTitle, split, split, startDrag, storeAncestors, toString, undock, undockWithAbort, updateButtonVisibility, updateWindowItem, 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, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, 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, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Method Details
-
setWindow
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
Returns the top level docking window inside this floating window.- Returns:
- the top level docking window inside this floating window
-
setMaximizedWindow
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
Returns the maximized window in this floating window.- Returns:
- maximized window or null if no window is maximized
-
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
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 classDockingWindow
- Returns:
- the properties for this window
-
minimize
public void minimize()Floating window cannot be minimized- Overrides:
minimize
in classDockingWindow
-
minimize
Floating window cannot be minimized- Overrides:
minimize
in classDockingWindow
- 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 classDockingWindow
- Returns:
- true if this window can be docked
- See Also:
-
isMaximizable
public boolean isMaximizable()Description copied from class:DockingWindow
Returns true if this window can be maximized by the user.- Overrides:
isMaximizable
in classDockingWindow
- Returns:
- true if this window can be maximized
- See Also:
-
isMinimizable
public boolean isMinimizable()Description copied from class:DockingWindow
Returns true if this window can be minimized by the user.- Overrides:
isMinimizable
in classDockingWindow
- Returns:
- true if this window can be minimized
- See Also:
-
isRestorable
public boolean isRestorable()Description copied from class:DockingWindow
Returns true if this window can be restored by the user.- Overrides:
isRestorable
in classDockingWindow
- Returns:
- true if this window can be restored
- See Also:
-
isUndockable
public boolean isUndockable()Description copied from class:DockingWindow
Returns true if this window can be undocked to a floating window.- Overrides:
isUndockable
in classDockingWindow
- Returns:
- true if this window can be undocked
- See Also:
-
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 classDockingWindow
-
getIcon
Description copied from class:DockingWindow
Returns the icon for this window.- Specified by:
getIcon
in classDockingWindow
- Returns:
- the icon
-
getChildWindow
Description copied from class:DockingWindow
Returns the child window with index index.- Specified by:
getChildWindow
in classDockingWindow
- 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 classDockingWindow
- Returns:
- the number of child windows
-
isUndocked
public boolean isUndocked()- Overrides:
isUndocked
in classDockingWindow
-
doReplace
- Specified by:
doReplace
in classDockingWindow
-
doRemoveWindow
- Specified by:
doRemoveWindow
in classDockingWindow
-
afterWindowRemoved
- Overrides:
afterWindowRemoved
in classDockingWindow
-
acceptsSplitWith
- Overrides:
acceptsSplitWith
in classDockingWindow
-
doAcceptDrop
- Overrides:
doAcceptDrop
in classDockingWindow
-
acceptInteriorDrop
- Overrides:
acceptInteriorDrop
in classDockingWindow
-
update
protected void update()- Specified by:
update
in classDockingWindow
-
showChildWindow
- Overrides:
showChildWindow
in classDockingWindow
-
getPropertyObject
- Specified by:
getPropertyObject
in classDockingWindow
-
createPropertyObject
- Specified by:
createPropertyObject
in classDockingWindow
-
fireTitleChanged
protected void fireTitleChanged()- Overrides:
fireTitleChanged
in classDockingWindow
-
read
protected DockingWindow read(ObjectInputStream in, ReadContext context, ViewReader viewReader) throws IOException - Throws:
IOException
-
write
protected void write(ObjectOutputStream out, WriteContext context, ViewWriter viewWriter) throws IOException - Overrides:
write
in classDockingWindow
- Throws:
IOException
-