Class DockingWindow
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- javax.swing.JComponent
-
- javax.swing.JPanel
-
- net.infonode.gui.panel.BaseContainer
-
- net.infonode.gui.panel.BasePanel
-
- net.infonode.docking.DockingWindow
-
- All Implemented Interfaces:
java.awt.image.ImageObserver,java.awt.MenuContainer,java.io.Serializable,javax.accessibility.Accessible
- Direct Known Subclasses:
AbstractTabWindow,FloatingWindow,RootWindow,SplitWindow,View
public abstract class DockingWindow extends BasePanel
This is the base class for all types of docking windows. The windows are structured in a tree, typically with aRootWindowat the root. Each DockingWindow has a window parent and a number of child windows.Warning: the non-public methods in this class can be changed in non-compatible ways in future versions.
- Version:
- $Revision: 1.120 $
- 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
-
-
Field Summary
Fields Modifier and Type Field Description private static intDROP_FLOATING_YOFFSETprivate DockingWindowlastFocusedChildWindowprivate java.lang.ref.WeakReferencelastRootWindowprivate java.util.ArrayListlistenersprivate java.util.ArrayListmouseButtonListenersprivate static intoptimizeDepthprivate static java.util.HashSetoptimizeWindowsprivate WindowPopupMenuFactorypopupMenuFactoryprivate PropertyMapListenerpropertiesListenerprivate PropertyMapTreeListenerpropertyObjectTreeListenerprivate WindowTabtabprivate static intupdateModelDepthprivate WindowItemwindowItemprivate DockingWindowwindowParent-
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
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDockingWindow(WindowItem windowItem)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected DropActionacceptChildDrop(java.awt.Point p, DockingWindow window)(package private) DropActionacceptDrop(java.awt.Point p, DockingWindow window)protected DropActionacceptInteriorDrop(java.awt.Point p, DockingWindow window)protected DropActionacceptSplitDrop(java.awt.Point p, DockingWindow window, int splitDistance)protected booleanacceptsSplitWith(DockingWindow window)voidaddListener(DockingWindowListener listener)Adds a listener which will reveive events for this window and all child windows.voidaddTabMouseButtonListener(MouseButtonListener listenerDocking)Adds a listener that receives mouse button events for window tabs.protected DockingWindowaddWindow(DockingWindow window)protected voidaddWindowItem(DockingWindow w, int index)protected voidafterWindowRemoved(DockingWindow window)protected voidbeforeDrop(DockingWindow target)protected static voidbeginOptimize(DockingWindow window)protected static voidbeginUpdateModel()(package private) voidchildGainedFocus(DockingWindow child, View view)protected booleanchildInsideTab()protected voidchildRemoved(DockingWindow child)protected voidcleanUpModel()protected voidclearChildrenFocus(DockingWindow child, View view)protected voidclearFocus(View view)voidclose()Removes this window from it's window parent.voidcloseWithAbort()Same asclose(), but theDockingWindowListener.windowClosing(DockingWindow)method of the window listeners will be called before closing the window, giving them the possibility to abort the close operation.protected abstract PropertyMapcreatePropertyObject()protected DropActioncreateTabWindow(DockingWindow window)protected java.awt.WindowcreateTopLevelComponent()protected voiddetach()protected DropActiondoAcceptDrop(java.awt.Point p, DockingWindow window)voiddock()Docks the window to the RootWindow to the location it had before it was undocked.voiddockWithAbort()Same asdock(), but theDockingWindowListener.windowDocking(DockingWindow)method of the window listeners will be called before docking the window, giving them the possibility to abort the dock operation.private voiddoFireWindowDocked(DockingWindow window)private voiddoFireWindowMinimized(DockingWindow window)private voiddoFireWindowRestored(DockingWindow window)private voiddoFireWindowUndocked(DockingWindow window)private voiddoMinimize()private voiddoMinimize(Direction direction)protected abstract voiddoRemoveWindow(DockingWindow window)protected abstract voiddoReplace(DockingWindow oldWindow, DockingWindow newWindow)private java.util.ArrayListdoRestore()private DockingWindowdoRestoreFromMaximize()private voiddoUpdate()protected static voidendOptimize()protected static voidendUpdateModel()private voidfindViews(java.util.ArrayList views)(package private) voidfireTabWindowMouseButtonEvent(java.awt.event.MouseEvent event)(package private) voidfireTabWindowMouseButtonEvent(DockingWindow window, java.awt.event.MouseEvent event)protected voidfireTitleChanged()protected voidfireViewFocusChanged(View previouslyFocusedView, View focusedView)private voidfireWindowAdded(DockingWindow addedToWindow, DockingWindow addedWindow)private voidfireWindowClosed(DockingWindow window)private voidfireWindowClosing(DockingWindow window)(package private) voidfireWindowDocked(java.util.ArrayList dockedViews)(package private) voidfireWindowDocked(DockingWindow window, DockingWindow[] oldAncestors)(package private) voidfireWindowDocking(DockingWindow window)protected voidfireWindowHidden(DockingWindow window)(package private) voidfireWindowMaximized(DockingWindow window)(package private) voidfireWindowMaximizing(DockingWindow window)(package private) voidfireWindowMinimized(DockingWindow window, DockingWindow[] oldAncestors)(package private) voidfireWindowMinimizing(DockingWindow window)private voidfireWindowRemoved(DockingWindow removedFromWindow, DockingWindow removedWindow)(package private) voidfireWindowRestored(DockingWindow window)(package private) voidfireWindowRestoring(DockingWindow window)protected voidfireWindowShown(DockingWindow window)(package private) voidfireWindowUndocked(DockingWindow window, DockingWindow[] oldAncestors)(package private) voidfireWindowUndocking(DockingWindow window)protected DockingWindow[]getAncestors()protected DockingWindowgetBestFittedWindow(DockingWindow parentWindow)(package private) DropFiltergetChildDropFilter()protected intgetChildEdgeDepth(DockingWindow window, Direction dir)abstract DockingWindowgetChildWindow(int index)Returns the child window with index index.abstract intgetChildWindowCount()Returns the number of child windows.intgetChildWindowIndex(DockingWindow window)Returns the index of a child windows.private DockingWindowgetContainer(WindowItem topItem, WindowItem item)protected DockingWindowgetContentWindow(DockingWindow parent)(package private) DropActiongetDefaultDropAction()protected intgetEdgeDepth(Direction dir)private intgetEdgeDistance(java.awt.Point p, Direction dir)abstract javax.swing.IcongetIcon()Returns the icon for this window.(package private) DropFiltergetInsertTabDropFilter()(package private) DropFiltergetInteriorDropFilter()DockingWindowgetLastFocusedChildWindow()Returns the child window that last contained focus.private java.util.ArrayListgetListeners()protected DockingWindowgetLocationWindow()private java.util.ArrayListgetMouseButtonListeners()protected DockingWindowgetOptimizedWindow()Returns the result after removing unnecessary tab windows which contains only one tab.WindowPopupMenuFactorygetPopupMenuFactory()Returns the popup menu factory for this window.protected DockingWindowgetPreferredFocusChild()DirectiongetPreferredMinimizeDirection()Gets the preferred minimize direction of this window.protected abstract PropertyMapgetPropertyObject()RootWindowgetRootWindow()Returns theRootWindowwhich contains this window, null if there is none.private DirectiongetSplitDirection(java.awt.Point p)(package private) DropFiltergetSplitDropFilter()(package private) WindowTabgetTab()java.lang.StringgetTitle()Returns the title of this window.protected booleangetUpdateModel()protected WindowItemgetWindowItem()DockingWindowgetWindowParent()Returns the window parent of this window.DockingWindowPropertiesgetWindowProperties()Returns the properties for this window.protected booleanhasParent(DockingWindow w)protected voidinit()private static voidinsertTab(TabWindow tabWindow, DockingWindow window)protected booleaninsideTab()protected voidinternalClose()protected DockingWindowinternalReplaceChildWindow(DockingWindow oldWindow, DockingWindow newWindow)protected booleanisChildShowingInRootWindow(DockingWindow child)booleanisClosable()Returns true if this window can be closed by the user.booleanisDockable()Returns true if this window can be docked to the root window from a floating window.booleanisMaximizable()Returns true if this window can be maximized by the user.booleanisMaximized()Returns true if this window has a root window and is maximized in that root window or in a floating window.booleanisMinimizable()Returns true if this window can be minimized by the user.booleanisMinimized()Returns true if this window is minimized, ie located in aWindowBar.booleanisRestorable()Returns true if this window can be restored by the user.protected booleanisShowingInRootWindow()booleanisUndockable()Returns true if this window can be undocked to a floating window.booleanisUndocked()voidmakeVisible()Makes this window visible.voidmaximize()Maximizes this window in its root window or in its floating window.voidmaximizeWithAbort()Same asmaximize(), but theDockingWindowListener.windowMaximized(DockingWindow)method of the window listeners will be called before maximizing the window, giving them the possibility to abort the maximize operation.voidminimize()Minimizes this window.voidminimize(Direction direction)Minimizes this window to aWindowBarlocated in direction.voidminimizeWithAbort()Same asminimize(), but theDockingWindowListener.windowMinimizing(DockingWindow)method of the window listeners will be called before minimizing the window, giving them the possibility to abort the minimize operation.voidminimizeWithAbort(Direction direction)Same asminimize(Direction), but theDockingWindowListener.windowMinimizing(DockingWindow)method of the window listeners will be called before minimizing the window, giving them the possibility to abort the minimize operation.protected booleanneedsTitleWindow()protected voidnotifyListeners(WindowAncestors ancestors)protected DockingWindowoldRead(java.io.ObjectInputStream in, ReadContext context)protected static voidoptimizeAfter(DockingWindow window, java.lang.Runnable runnable)protected voidoptimizeWindowLayout()protected voidreadLocations(java.io.ObjectInputStream in, RootWindow rootWindow, int version)protected voidremoveChildWindow(DockingWindow window)voidremoveListener(DockingWindowListener listener)Removes a previously added listener.voidremoveTabMouseButtonListener(MouseButtonListener listenerDocking)Removes a mouse button listener that has been previously added using theaddTabMouseButtonListener(MouseButtonListener).protected voidremoveWindow(DockingWindow window)(package private) abstract voidremoveWindowComponent(DockingWindow window)voidreplaceChildWindow(DockingWindow oldWindow, DockingWindow newWindow)Replaces a child window with another window.voidrestore()Restores this window to the location before it was minimized, maximized or closed.voidrestoreFocus()Requests that the last focused child window becomes visible and that focus is restored to the last focused component in that window.private voidrestoreItem()private voidrestoreViews(java.util.ArrayList views)(package private) abstract voidrestoreWindowComponent(DockingWindow window)voidrestoreWithAbort()Same asrestore(), but theDockingWindowListener.windowRestoring(DockingWindow)method of the window listeners will be called before restoring the window, giving them the possibility to abort the restore operation.protected voidrootChanged(RootWindow oldRoot, RootWindow newRoot)protected voidsetFocused(boolean focused)protected voidsetLastMinimizedDirection(Direction direction)private voidsetListeners(java.util.ArrayList listeners)private voidsetMouseButtonListeners(java.util.ArrayList listeners)voidsetPopupMenuFactory(WindowPopupMenuFactory popupMenuFactory)Sets the popup menu factory for this window.voidsetPreferredMinimizeDirection(Direction direction)Sets the preferred minimize direction of this window.private voidsetWindowItem(WindowItem windowItem)private voidsetWindowParent(DockingWindow window)protected voidshowChildWindow(DockingWindow window)(package private) voidshowPopupMenu(java.awt.event.MouseEvent event)protected booleanshowsWindowTitle()protected DropActionsplit(DockingWindow window, Direction splitDir)SplitWindowsplit(DockingWindow splitWithWindow, Direction direction, float dividerLocation)Splits this window in the given direction.DockingWindowDraggerstartDrag(RootWindow dropTarget)Starts a drag and drop operation for this window.protected WindowAncestorsstoreAncestors()java.lang.StringtoString()FloatingWindowundock(java.awt.Point location)Undocks this window from it's window parent i.e.FloatingWindowundockWithAbort(java.awt.Point location)Same asundock(Point), but theDockingWindowListener.windowUndocking(DockingWindow)method of the window listeners will be called before undocking the window, giving them the possibility to abort the undock operation.protected abstract voidupdate()protected voidupdateButtonVisibility()protected voidupdateWindowItem(DockingWindow w)protected voidupdateWindowItem(RootWindow rootWindow)protected voidupdateWindowItems()protected voidwrite(java.io.ObjectOutputStream out, WriteContext context, ViewWriter viewWriter)protected voidwriteLocations(java.io.ObjectOutputStream out)-
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
-
-
-
-
Field Detail
-
DROP_FLOATING_YOFFSET
private static int DROP_FLOATING_YOFFSET
-
windowParent
private DockingWindow windowParent
-
tab
private WindowTab tab
-
lastFocusedChildWindow
private DockingWindow lastFocusedChildWindow
-
popupMenuFactory
private WindowPopupMenuFactory popupMenuFactory
-
mouseButtonListeners
private java.util.ArrayList mouseButtonListeners
-
listeners
private java.util.ArrayList listeners
-
propertiesListener
private PropertyMapListener propertiesListener
-
propertyObjectTreeListener
private PropertyMapTreeListener propertyObjectTreeListener
-
optimizeWindows
private static java.util.HashSet optimizeWindows
-
optimizeDepth
private static int optimizeDepth
-
windowItem
private WindowItem windowItem
-
lastRootWindow
private java.lang.ref.WeakReference lastRootWindow
-
updateModelDepth
private static int updateModelDepth
-
-
Constructor Detail
-
DockingWindow
protected DockingWindow(WindowItem windowItem)
-
-
Method Detail
-
getIcon
public abstract javax.swing.Icon getIcon()
Returns the icon for this window.- Returns:
- the icon
-
getChildWindow
public abstract DockingWindow getChildWindow(int index)
Returns the child window with index index.- Parameters:
index- the child window index- Returns:
- the child window
-
getChildWindowCount
public abstract int getChildWindowCount()
Returns the number of child windows.- Returns:
- the number of child windows
-
doReplace
protected abstract void doReplace(DockingWindow oldWindow, DockingWindow newWindow)
-
doRemoveWindow
protected abstract void doRemoveWindow(DockingWindow window)
-
update
protected abstract void update()
-
removeWindowComponent
abstract void removeWindowComponent(DockingWindow window)
-
restoreWindowComponent
abstract void restoreWindowComponent(DockingWindow window)
-
init
protected void init()
-
doUpdate
private void doUpdate()
-
addWindowItem
protected void addWindowItem(DockingWindow w, int index)
-
updateWindowItem
protected void updateWindowItem(DockingWindow w)
-
updateWindowItems
protected final void updateWindowItems()
-
setPreferredMinimizeDirection
public void setPreferredMinimizeDirection(Direction direction)
Sets the preferred minimize direction of this window. If the
WindowBarin this direction is enabled this window will be placed on that bar whenminimize()is called.Note that a window will "remember" the last
WindowBarit was added to so the preferred minimize direction is changed when the window is added to anotherWindowBar.- Parameters:
direction- the preferred minimize direction of this window, null (which is default value) means use the closest, enabledWindowBar- Since:
- IDW 1.3.0
-
getPreferredMinimizeDirection
public Direction getPreferredMinimizeDirection()
Gets the preferred minimize direction of this window. See
setPreferredMinimizeDirection(net.infonode.util.Direction)for more information.- Returns:
- the preferred minimize direction of this window, null if the closest
WindowBaris used - Since:
- IDW 1.3.0
-
getMouseButtonListeners
private java.util.ArrayList getMouseButtonListeners()
-
setMouseButtonListeners
private void setMouseButtonListeners(java.util.ArrayList listeners)
-
getListeners
private java.util.ArrayList getListeners()
-
setListeners
private void setListeners(java.util.ArrayList listeners)
-
isUndocked
public boolean isUndocked()
-
addTabMouseButtonListener
public void addTabMouseButtonListener(MouseButtonListener listenerDocking)
Adds a listener that receives mouse button events for window tabs. The listener will be called when a mouse button is pressed, clicked or released on a window tab of this window or a descendant of this window.
The listeners are called in the reverse order they were added, so the last added listener will be called first. When all the listeners of this window has been called, the event is propagated up to the window parent of this window, if there is one.
The
MouseEventsource is the docking window connected to the tab in which the mouse event occured. The event point is the mouse coordinate where the event occured relative to the window.- Parameters:
listenerDocking- the listener- Since:
- IDW 1.3.0
-
removeTabMouseButtonListener
public void removeTabMouseButtonListener(MouseButtonListener listenerDocking)
Removes a mouse button listener that has been previously added using theaddTabMouseButtonListener(MouseButtonListener).- Parameters:
listenerDocking- the listener- Since:
- IDW 1.3.0
-
fireTabWindowMouseButtonEvent
void fireTabWindowMouseButtonEvent(java.awt.event.MouseEvent event)
-
fireTabWindowMouseButtonEvent
void fireTabWindowMouseButtonEvent(DockingWindow window, java.awt.event.MouseEvent event)
-
addListener
public void addListener(DockingWindowListener listener)
Adds a listener which will reveive events for this window and all child windows.- Parameters:
listener- the listener- Since:
- IDW 1.1.0
-
removeListener
public void removeListener(DockingWindowListener listener)
Removes a previously added listener.- Parameters:
listener- the listener- Since:
- IDW 1.1.0
-
getWindowParent
public DockingWindow getWindowParent()
Returns the window parent of this window.- Returns:
- the window parent of this window
-
split
public SplitWindow split(DockingWindow splitWithWindow, Direction direction, float dividerLocation)
Splits this window in the given direction. If this window is a View which is contained in a TabWindow with a single tab, the TabWindow will splitted instead of this View.- Parameters:
splitWithWindow- the splitWithWindow which to split withdirection- the split directiondividerLocation- the relative split divider location (0 - 1)- Returns:
- the resulting split window
-
startDrag
public DockingWindowDragger startDrag(RootWindow dropTarget)
Starts a drag and drop operation for this window.- Parameters:
dropTarget- theRootWindowin which the window can be dropped- Returns:
- an
DockingWindowDraggerobject which controls the drag and drop operation - Since:
- IDW 1.3.0
-
getWindowProperties
public DockingWindowProperties getWindowProperties()
Returns the properties for this window.- Returns:
- the properties for this window
-
getRootWindow
public RootWindow getRootWindow()
Returns theRootWindowwhich contains this window, null if there is none.- Returns:
- the
RootWindow, null if there is none
-
restoreWithAbort
public void restoreWithAbort() throws OperationAbortedExceptionSame asrestore(), but theDockingWindowListener.windowRestoring(DockingWindow)method of the window listeners will be called before restoring the window, giving them the possibility to abort the restore operation.- Throws:
OperationAbortedException- if the restore operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
restore(),DockingWindowListener.windowMinimizing(DockingWindow)
-
restore
public void restore()
Restores this window to the location before it was minimized, maximized or closed. If the window can't be restored to the exact same location, a good approximation is performed. It's not guaranteed that the window is shown anywhere after this method has returned.
-
doRestoreFromMaximize
private DockingWindow doRestoreFromMaximize()
-
doRestore
private java.util.ArrayList doRestore()
-
close
public void close()
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
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.
-
closeWithAbort
public void closeWithAbort() throws OperationAbortedExceptionSame asclose(), but theDockingWindowListener.windowClosing(DockingWindow)method of the window listeners will be called before closing the window, giving them the possibility to abort the close operation.- Throws:
OperationAbortedException- if the close operation was aborted by a window listener- Since:
- IDW 1.1.0
- See Also:
close(),DockingWindowListener.windowClosing(DockingWindow)
-
undock
public FloatingWindow undock(java.awt.Point location)
Undocks this window from it's window parent i.e. creates a
FloatingWindowcontaining this window.The window can be docked again by calling
dock().This method will call the
DockingWindowListener.windowUndocked(DockingWindow)method of all the listeners of this window and all window ancestors. The listeners of child windows will not be notified, for example undocking a tab window containing views will not notify the listeners of views in that tab window.- Parameters:
location- floating window location in screen coordinates- Returns:
- the floating window containing the undocked window
- Since:
- IDW 1.4.0
-
undockWithAbort
public FloatingWindow undockWithAbort(java.awt.Point location) throws OperationAbortedException
Same asundock(Point), but theDockingWindowListener.windowUndocking(DockingWindow)method of the window listeners will be called before undocking the window, giving them the possibility to abort the undock operation.- Parameters:
location- floating window location in screen coordinates- Returns:
- the floating window containing the undocked window
- Throws:
OperationAbortedException- if the undock operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
undock(Point),DockingWindowListener.windowClosing(DockingWindow)
-
dock
public void dock()
Docks the window to the RootWindow to the location it had before it was undocked.
If the window can't be docked to the exact same location, a good approximation is performed. It's not guaranteed that the window is shown anywhere after this method has returned.
This method will call the
DockingWindowListener.windowDocked(DockingWindow)method of all the listeners of this window and all window ancestors. The listeners of child windows will not be notified, for example docking a tab window containing views will not notify the listeners of views in that tab window.- Since:
- IDW 1.4.0
-
dockWithAbort
public void dockWithAbort() throws OperationAbortedExceptionSame asdock(), but theDockingWindowListener.windowDocking(DockingWindow)method of the window listeners will be called before docking the window, giving them the possibility to abort the dock operation.- Throws:
OperationAbortedException- if the dock operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
dock(),DockingWindowListener.windowDocking(DockingWindow)
-
getChildWindowIndex
public int getChildWindowIndex(DockingWindow window)
Returns the index of a child windows.- Parameters:
window- the child window- Returns:
- the index of the child window, -1 if the window is not a child of this window
-
getPopupMenuFactory
public WindowPopupMenuFactory getPopupMenuFactory()
Returns the popup menu factory for this window. If it's null the window parent popup menu factory will be used when the mouse popup trigger is activated on this window.- Returns:
- the popup menu factory for this window, null if there is none
-
setPopupMenuFactory
public void setPopupMenuFactory(WindowPopupMenuFactory popupMenuFactory)
Sets the popup menu factory for this window. If it's not null a popup menu will be created and shown when the mouse popup trigger is activated on this window.- Parameters:
popupMenuFactory- the popup menu factory, null if no popup menu should be shown
-
isMinimized
public boolean isMinimized()
Returns true if this window is minimized, ie located in aWindowBar.- Returns:
- true if this window is minimized
-
getLastFocusedChildWindow
public DockingWindow getLastFocusedChildWindow()
Returns the child window that last contained focus.- Returns:
- the child window that last contained focus, null if no child window has contained focus or the child has been removed from this window
-
maximize
public final void maximize()
Maximizes this window in its root window or in its floating window. If this window has no root window nothing happens. This method takes the window component and displays it at the top in the root window or in the floating window. It does NOT modify the window tree structure, ie the window parent remains the unchanged.The location of this window is saved and the window can be restored to that location using the
restore()method.- Since:
- IDW 1.1.0
-
maximizeWithAbort
public void maximizeWithAbort() throws OperationAbortedExceptionSame asmaximize(), but theDockingWindowListener.windowMaximized(DockingWindow)method of the window listeners will be called before maximizing the window, giving them the possibility to abort the maximize operation.- Throws:
OperationAbortedException- if the maximize operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
maximize(),DockingWindowListener.windowMinimizing(DockingWindow)
-
isMaximized
public boolean isMaximized()
Returns true if this window has a root window and is maximized in that root window or in a floating window.- Returns:
- true if this window has a root window and is maximized in that root window or in a floating window
- Since:
- IDW 1.1.0
-
minimize
public void minimize()
Minimizes this window. The window is minimized to theWindowBarin the preferred minimize direction, seesetPreferredMinimizeDirection(net.infonode.util.Direction)andgetPreferredMinimizeDirection(). If theWindowBarin that direction is not enabled, or the direction is null, thiw window is placed on the closest enabledWindowBar. If no suitableWindowBarwas found or this window already is minimized, no action is performed.The location of this window is saved and the window can be restored to that location using the
restore()method.
-
minimize
public void minimize(Direction direction)
Minimizes this window to aWindowBarlocated in direction. If no suitableWindowBarwas found or this window already is minimized, no action is performed.The location of this window is saved and the window can be restored to that location using the
restore()method.- Parameters:
direction- the direction in which the window bar to be minimized to is located
-
minimizeWithAbort
public void minimizeWithAbort() throws OperationAbortedExceptionSame asminimize(), but theDockingWindowListener.windowMinimizing(DockingWindow)method of the window listeners will be called before minimizing the window, giving them the possibility to abort the minimize operation.- Throws:
OperationAbortedException- if the minimize operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
minimize(),DockingWindowListener.windowMinimizing(DockingWindow)
-
minimizeWithAbort
public void minimizeWithAbort(Direction direction) throws OperationAbortedException
Same asminimize(Direction), but theDockingWindowListener.windowMinimizing(DockingWindow)method of the window listeners will be called before minimizing the window, giving them the possibility to abort the minimize operation.- Throws:
OperationAbortedException- if the minimize operation was aborted by a window listener- Since:
- IDW 1.4.0
- See Also:
minimize(Direction),DockingWindowListener.windowMinimizing(DockingWindow)
-
doMinimize
private void doMinimize()
-
doMinimize
private void doMinimize(Direction direction)
-
isMinimizable
public boolean isMinimizable()
Returns true if this window can be minimized by the user.- Returns:
- true if this window can be minimized
- See Also:
minimize()
-
isMaximizable
public boolean isMaximizable()
Returns true if this window can be maximized by the user.- Returns:
- true if this window can be maximized
- Since:
- IDW 1.2.0
- See Also:
maximize()
-
isClosable
public boolean isClosable()
Returns true if this window can be closed by the user.- Returns:
- true if this window can be closed
- Since:
- IDW 1.2.0
- See Also:
close(),closeWithAbort()
-
isRestorable
public boolean isRestorable()
Returns true if this window can be restored by the user.- Returns:
- true if this window can be restored
- Since:
- IDW 1.2.0
- See Also:
restore()
-
isUndockable
public boolean isUndockable()
Returns true if this window can be undocked to a floating window.- Returns:
- true if this window can be undocked
- Since:
- IDW 1.4.0
- See Also:
undock(Point)
-
isDockable
public boolean isDockable()
Returns true if this window can be docked to the root window from a floating window.- Returns:
- true if this window can be docked
- Since:
- IDW 1.4.0
- See Also:
dock()
-
replaceChildWindow
public void replaceChildWindow(DockingWindow oldWindow, DockingWindow newWindow)
Replaces a child window with another window.- Parameters:
oldWindow- the child window to replaceChildWindownewWindow- the window to replaceChildWindow it with
-
internalReplaceChildWindow
protected DockingWindow internalReplaceChildWindow(DockingWindow oldWindow, DockingWindow newWindow)
-
getTitle
public java.lang.String getTitle()
Returns the title of this window.- Returns:
- the window title
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.awt.Component
-
storeAncestors
protected WindowAncestors storeAncestors()
-
notifyListeners
protected void notifyListeners(WindowAncestors ancestors)
-
isShowingInRootWindow
protected boolean isShowingInRootWindow()
-
isChildShowingInRootWindow
protected boolean isChildShowingInRootWindow(DockingWindow child)
-
makeVisible
public void makeVisible()
Makes this window visible. This causes the tabs of allTabWindowparents containing this window to be selected.- Since:
- IDW 1.1.0
-
restoreFocus
public void restoreFocus()
Requests that the last focused child window becomes visible and that focus is restored to the last focused component in that window. If no child window has had focus or the child window has been removed from this window, focus is transferred to a child component of this window.- Since:
- IDW 1.1.0
-
getPreferredFocusChild
protected DockingWindow getPreferredFocusChild()
-
getOptimizedWindow
protected DockingWindow getOptimizedWindow()
Returns the result after removing unnecessary tab windows which contains only one tab.- Returns:
- the result after removing unnecessary tab windows which contains only one tab
-
getBestFittedWindow
protected DockingWindow getBestFittedWindow(DockingWindow parentWindow)
-
internalClose
protected void internalClose()
-
showChildWindow
protected void showChildWindow(DockingWindow window)
-
insideTab
protected boolean insideTab()
- Returns:
- true if this window is inside a tab __exclude__
-
childInsideTab
protected boolean childInsideTab()
- Returns:
- true if the child windows are inside tabs __exclude__
-
getAncestors
protected DockingWindow[] getAncestors()
-
fireWindowRemoved
private void fireWindowRemoved(DockingWindow removedFromWindow, DockingWindow removedWindow)
-
fireWindowShown
protected void fireWindowShown(DockingWindow window)
-
fireViewFocusChanged
protected void fireViewFocusChanged(View previouslyFocusedView, View focusedView)
-
fireWindowHidden
protected void fireWindowHidden(DockingWindow window)
-
fireWindowAdded
private void fireWindowAdded(DockingWindow addedToWindow, DockingWindow addedWindow)
-
fireWindowClosing
private void fireWindowClosing(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowClosed
private void fireWindowClosed(DockingWindow window)
-
fireWindowUndocking
void fireWindowUndocking(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowUndocked
void fireWindowUndocked(DockingWindow window, DockingWindow[] oldAncestors)
-
doFireWindowUndocked
private void doFireWindowUndocked(DockingWindow window)
-
fireWindowMinimizing
void fireWindowMinimizing(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowMaximizing
void fireWindowMaximizing(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowRestoring
void fireWindowRestoring(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowDocking
void fireWindowDocking(DockingWindow window) throws OperationAbortedException
- Throws:
OperationAbortedException
-
fireWindowDocked
void fireWindowDocked(DockingWindow window, DockingWindow[] oldAncestors)
-
fireWindowDocked
void fireWindowDocked(java.util.ArrayList dockedViews)
-
doFireWindowDocked
private void doFireWindowDocked(DockingWindow window)
-
doFireWindowRestored
private void doFireWindowRestored(DockingWindow window)
-
fireWindowMaximized
void fireWindowMaximized(DockingWindow window)
-
fireWindowMinimized
void fireWindowMinimized(DockingWindow window, DockingWindow[] oldAncestors)
-
doFireWindowMinimized
private void doFireWindowMinimized(DockingWindow window)
-
fireWindowRestored
void fireWindowRestored(DockingWindow window)
-
setLastMinimizedDirection
protected void setLastMinimizedDirection(Direction direction)
-
clearChildrenFocus
protected void clearChildrenFocus(DockingWindow child, View view)
-
childGainedFocus
void childGainedFocus(DockingWindow child, View view)
-
getTab
WindowTab getTab()
-
childRemoved
protected void childRemoved(DockingWindow child)
-
updateButtonVisibility
protected void updateButtonVisibility()
-
readLocations
protected final void readLocations(java.io.ObjectInputStream in, RootWindow rootWindow, int version) throws java.io.IOException- Throws:
java.io.IOException
-
writeLocations
protected void writeLocations(java.io.ObjectOutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
beginOptimize
protected static void beginOptimize(DockingWindow window)
-
endOptimize
protected static void endOptimize()
-
optimizeAfter
protected static void optimizeAfter(DockingWindow window, java.lang.Runnable runnable)
-
needsTitleWindow
protected boolean needsTitleWindow()
-
showsWindowTitle
protected boolean showsWindowTitle()
-
optimizeWindowLayout
protected void optimizeWindowLayout()
-
getLocationWindow
protected DockingWindow getLocationWindow()
-
fireTitleChanged
protected void fireTitleChanged()
-
getContentWindow
protected DockingWindow getContentWindow(DockingWindow parent)
-
removeChildWindow
protected final void removeChildWindow(DockingWindow window)
-
removeWindow
protected final void removeWindow(DockingWindow window)
-
detach
protected final void detach()
-
addWindow
protected final DockingWindow addWindow(DockingWindow window)
-
rootChanged
protected void rootChanged(RootWindow oldRoot, RootWindow newRoot)
-
clearFocus
protected void clearFocus(View view)
-
setWindowParent
private void setWindowParent(DockingWindow window)
-
getSplitDirection
private Direction getSplitDirection(java.awt.Point p)
-
getEdgeDistance
private int getEdgeDistance(java.awt.Point p, Direction dir)
-
acceptDrop
DropAction acceptDrop(java.awt.Point p, DockingWindow window)
-
getDefaultDropAction
DropAction getDefaultDropAction()
-
acceptsSplitWith
protected boolean acceptsSplitWith(DockingWindow window)
-
doAcceptDrop
protected DropAction doAcceptDrop(java.awt.Point p, DockingWindow window)
-
acceptSplitDrop
protected DropAction acceptSplitDrop(java.awt.Point p, DockingWindow window, int splitDistance)
-
split
protected DropAction split(DockingWindow window, Direction splitDir)
-
beforeDrop
protected void beforeDrop(DockingWindow target) throws OperationAbortedException
- Throws:
OperationAbortedException
-
createTabWindow
protected DropAction createTabWindow(DockingWindow window)
-
acceptInteriorDrop
protected DropAction acceptInteriorDrop(java.awt.Point p, DockingWindow window)
-
hasParent
protected boolean hasParent(DockingWindow w)
-
oldRead
protected DockingWindow oldRead(java.io.ObjectInputStream in, ReadContext context) throws java.io.IOException
- Throws:
java.io.IOException
-
getPropertyObject
protected abstract PropertyMap getPropertyObject()
-
createPropertyObject
protected abstract PropertyMap createPropertyObject()
-
showPopupMenu
void showPopupMenu(java.awt.event.MouseEvent event)
-
setFocused
protected void setFocused(boolean focused)
-
getEdgeDepth
protected int getEdgeDepth(Direction dir)
-
getChildEdgeDepth
protected int getChildEdgeDepth(DockingWindow window, Direction dir)
-
acceptChildDrop
protected DropAction acceptChildDrop(java.awt.Point p, DockingWindow window)
-
getWindowItem
protected WindowItem getWindowItem()
-
getUpdateModel
protected boolean getUpdateModel()
-
findViews
private void findViews(java.util.ArrayList views)
-
restoreViews
private void restoreViews(java.util.ArrayList views)
-
beginUpdateModel
protected static void beginUpdateModel()
-
endUpdateModel
protected static void endUpdateModel()
-
restoreItem
private void restoreItem()
-
insertTab
private static void insertTab(TabWindow tabWindow, DockingWindow window)
-
getContainer
private DockingWindow getContainer(WindowItem topItem, WindowItem item)
-
setWindowItem
private void setWindowItem(WindowItem windowItem)
-
updateWindowItem
protected void updateWindowItem(RootWindow rootWindow)
-
afterWindowRemoved
protected void afterWindowRemoved(DockingWindow window)
-
write
protected void write(java.io.ObjectOutputStream out, WriteContext context, ViewWriter viewWriter) throws java.io.IOException- Throws:
java.io.IOException
-
cleanUpModel
protected void cleanUpModel()
-
getSplitDropFilter
DropFilter getSplitDropFilter()
-
getChildDropFilter
DropFilter getChildDropFilter()
-
getInteriorDropFilter
DropFilter getInteriorDropFilter()
-
getInsertTabDropFilter
DropFilter getInsertTabDropFilter()
-
createTopLevelComponent
protected java.awt.Window createTopLevelComponent()
-
-