|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 net.infonode.docking.RootWindow
public class RootWindow
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.
Nested Class Summary | |
---|---|
private class |
RootWindow.SingleComponentLayout
|
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 boolean |
cleanUpModel
|
private javax.swing.JRootPane |
currentDragRootPane
|
private java.awt.Component |
dragRectangle
|
private java.awt.Container |
dragTextContainer
|
private javax.swing.JLabel |
dragTextLabel
|
private DragLabelWindow |
dragTextWindow
|
private javax.swing.JFrame |
dummyFrame
|
private static int |
FLOATING_WINDOW_MIN_HEIGHT
|
private static int |
FLOATING_WINDOW_MIN_WIDTH
|
private java.util.ArrayList |
floatingWindows
|
private View |
focusedView
|
private java.util.ArrayList |
focusedWindows
|
private boolean |
heavyweightSupport
|
private java.util.ArrayList |
lastFocusedWindows
|
private ShapedPanel |
layeredPane
|
private SimplePanel |
mainPanel
|
private DockingWindow |
maximizedWindow
|
private java.lang.Runnable |
modelCleanUpEvent
|
private static int |
SERIALIZE_VERSION
|
private java.util.ArrayList |
views
|
private ViewSerializer |
viewSerializer
|
private DockingWindow |
window
|
private WindowBar[] |
windowBars
|
private ShapedPanel |
windowPanel
|
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 | |
---|---|
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 | |
---|---|
protected DropAction |
acceptInteriorDrop(java.awt.Point p,
DockingWindow window)
|
protected boolean |
acceptsSplitWith(DockingWindow window)
|
(package private) void |
addFocusedWindow(DockingWindow window)
|
(package private) void |
addView(View view)
|
protected void |
cleanUpModel()
|
(package private) FloatingWindow |
createFloatingWindow()
|
(package private) FloatingWindow |
createFloatingWindow(DockingWindow window,
java.awt.Point p)
|
FloatingWindow |
createFloatingWindow(java.awt.Point location,
java.awt.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. |
protected PropertyMap |
createPropertyObject()
|
private void |
createWindowBars()
|
protected DropAction |
doAcceptDrop(java.awt.Point p,
DockingWindow window)
|
protected void |
doRemoveWindow(DockingWindow window)
|
protected void |
doReplace(DockingWindow oldWindow,
DockingWindow newWindow)
|
(package private) boolean |
floatingWindowsContainPoint(java.awt.Point p)
|
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. |
(package private) javax.swing.JRootPane |
getCurrentDragRootPane()
|
View |
getFocusedView()
Returns the view that currently contains the focus. |
javax.swing.Icon |
getIcon()
Returns the icon for this window. |
(package private) javax.swing.JComponent |
getLayeredPane()
|
DockingWindow |
getMaximizedWindow()
Returns the maximized window in this root window, or null if there no maximized window. |
protected PropertyMap |
getPropertyObject()
|
RootWindow |
getRootWindow()
Returns the RootWindow which contains this window, null if there is none. |
RootWindowProperties |
getRootWindowProperties()
Returns the property values for this root window. |
(package private) java.awt.Component |
getTopLevelComponent()
|
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. |
(package private) javax.swing.JComponent |
getWindowPanel()
|
private void |
internalSetMaximizedWindow(DockingWindow window)
|
(package private) void |
internalStartDrag(javax.swing.JComponent component)
|
(package private) boolean |
isHeavyweightSupported()
|
protected boolean |
isShowingInRootWindow()
|
private void |
newInternalRead(java.io.ObjectInputStream in,
ReadContext context)
|
private void |
oldInternalRead(java.io.ObjectInputStream in,
ReadContext context)
|
protected void |
paintComponent(java.awt.Graphics g)
|
void |
read(java.io.ObjectInputStream in)
Reads a previously written window state. |
void |
read(java.io.ObjectInputStream in,
boolean readProperties)
Reads a previously written window state. |
private void |
readMaximized(java.io.ObjectInputStream in)
|
(package private) void |
removeFloatingWindow(FloatingWindow fw)
|
void |
removeView(View view)
Removes all internal references to a view. |
(package private) void |
removeWindowComponent(DockingWindow window)
|
private static boolean |
reparent(java.awt.Container parent,
java.awt.Component c)
|
(package private) void |
restoreWindowComponent(DockingWindow window)
|
(package private) void |
setCurrentDragRootPane(javax.swing.JRootPane rootPane)
|
(package private) void |
setDragCursor(java.awt.Cursor cursor)
|
(package private) void |
setDragRectangle(java.awt.Rectangle rect)
|
(package private) void |
setDragText(java.awt.Point textPoint,
java.lang.String text)
|
(package private) void |
setFocusedView(View 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. |
protected void |
showChildWindow(DockingWindow window)
|
(package private) void |
stopDrag()
|
protected void |
update()
|
void |
updateUI()
|
(package private) boolean |
windowBarEnabled()
|
void |
write(java.io.ObjectOutputStream out)
Writes the state of this root window and all child windows. |
void |
write(java.io.ObjectOutputStream out,
boolean writeProperties)
Writes the state of this root window and all child windows. |
private void |
writeMaximized(DockingWindow window,
java.io.ObjectOutputStream out)
|
private static void |
writeViews(java.util.ArrayList views,
java.io.ObjectOutputStream out,
WriteContext context)
|
private void |
writeWindowItemIndex(WindowItem item,
java.io.ObjectOutputStream out)
|
Methods inherited from class net.infonode.gui.panel.BasePanel |
---|
setComponent, setSouthComponent |
Methods inherited from class net.infonode.gui.panel.BaseContainer |
---|
setBackground, setFont, setForeground, setOpaque, setUI |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString |
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 |
---|
private static final int SERIALIZE_VERSION
private static final int FLOATING_WINDOW_MIN_WIDTH
private static final int FLOATING_WINDOW_MIN_HEIGHT
private boolean heavyweightSupport
private ShapedPanel layeredPane
private ShapedPanel windowPanel
private SimplePanel mainPanel
private javax.swing.JFrame dummyFrame
private ViewSerializer viewSerializer
private DockingWindow window
private WindowBar[] windowBars
private java.util.ArrayList floatingWindows
private DockingWindow maximizedWindow
private View focusedView
private java.util.ArrayList lastFocusedWindows
private java.util.ArrayList focusedWindows
private java.util.ArrayList views
private boolean cleanUpModel
private java.lang.Runnable modelCleanUpEvent
private javax.swing.JLabel dragTextLabel
private java.awt.Container dragTextContainer
private DragLabelWindow dragTextWindow
private java.awt.Component dragRectangle
private javax.swing.JRootPane currentDragRootPane
Constructor Detail |
---|
public RootWindow(ViewSerializer viewSerializer)
viewSerializer
- used when reading and writing viewspublic RootWindow(boolean heavyweightSupport, ViewSerializer viewSerializer)
heavyweightSupport
- true for heavy weight component support, otherwise falseviewSerializer
- used when reading and writing viewspublic RootWindow(ViewSerializer viewSerializer, DockingWindow window)
viewSerializer
- used when reading and writing viewswindow
- the window that is placed inside the root windowpublic RootWindow(boolean heavyweightSupport, ViewSerializer viewSerializer, DockingWindow window)
heavyweightSupport
- true for heavy weight component support, otherwise falseviewSerializer
- used when reading and writing viewswindow
- the window that is placed inside the root windowMethod Detail |
---|
public View getFocusedView()
void addFocusedWindow(DockingWindow window)
void setFocusedView(View view)
public RootWindowProperties getRootWindowProperties()
public Direction getClosestWindowBar(DockingWindow window)
window
- the docking window
public WindowBar getWindowBar(Direction direction)
direction
- the direction
public void setWindow(DockingWindow newWindow)
newWindow
- the top level docking windowpublic DockingWindow getWindow()
public FloatingWindow createFloatingWindow(java.awt.Point location, java.awt.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.
location
- the floating window's location on the screeninnerSize
- the inner dimension of the floating window's top level container i.e.the size of the root panewindow
- 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
FloatingWindow createFloatingWindow()
FloatingWindow createFloatingWindow(DockingWindow window, java.awt.Point p)
void removeFloatingWindow(FloatingWindow fw)
public ViewSerializer getViewSerializer()
public DockingWindow getChildWindow(int index)
DockingWindow
getChildWindow
in class DockingWindow
index
- the child window index
public int getChildWindowCount()
DockingWindow
getChildWindowCount
in class DockingWindow
public javax.swing.Icon getIcon()
DockingWindow
getIcon
in class DockingWindow
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
write
in interface Writable
out
- the stream on which to write the state
java.io.IOException
- if there is a stream errorpublic void write(java.io.ObjectOutputStream out, boolean writeProperties) throws java.io.IOException
out
- the stream on which to write the statewriteProperties
- true if the property values for all docking windows should be written to the stream
java.io.IOException
- if there is a stream errorprivate void writeWindowItemIndex(WindowItem item, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private void writeMaximized(DockingWindow window, java.io.ObjectOutputStream out) throws java.io.IOException
java.io.IOException
private static void writeViews(java.util.ArrayList views, java.io.ObjectOutputStream out, WriteContext context) throws java.io.IOException
java.io.IOException
public void read(java.io.ObjectInputStream in) throws java.io.IOException
read
in interface Readable
in
- the stream from which to read the state
java.io.IOException
- if there is a stream errorprivate void oldInternalRead(java.io.ObjectInputStream in, ReadContext context) throws java.io.IOException
java.io.IOException
private void newInternalRead(java.io.ObjectInputStream in, ReadContext context) throws java.io.IOException
java.io.IOException
public void read(java.io.ObjectInputStream in, boolean readProperties) throws java.io.IOException
in
- the stream from which to read the statereadProperties
- 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.
java.io.IOException
- if there is a stream errorprivate void readMaximized(java.io.ObjectInputStream in) throws java.io.IOException
java.io.IOException
public DockingWindow getMaximizedWindow()
public void setMaximizedWindow(DockingWindow window)
window
- the maximized window in this root window, null means no maximized windowvoid addView(View view)
public void removeView(View view)
view
- all internal references to this view are removedprivate void internalSetMaximizedWindow(DockingWindow window)
private void createWindowBars()
javax.swing.JComponent getLayeredPane()
javax.swing.JComponent getWindowPanel()
protected void showChildWindow(DockingWindow window)
showChildWindow
in class DockingWindow
protected void update()
update
in class DockingWindow
void internalStartDrag(javax.swing.JComponent component)
void stopDrag()
boolean floatingWindowsContainPoint(java.awt.Point p)
void setCurrentDragRootPane(javax.swing.JRootPane rootPane)
javax.swing.JRootPane getCurrentDragRootPane()
java.awt.Component getTopLevelComponent()
boolean isHeavyweightSupported()
private static boolean reparent(java.awt.Container parent, java.awt.Component c)
void setDragCursor(java.awt.Cursor cursor)
void setDragText(java.awt.Point textPoint, java.lang.String text)
void setDragRectangle(java.awt.Rectangle rect)
protected void doReplace(DockingWindow oldWindow, DockingWindow newWindow)
doReplace
in class DockingWindow
protected void doRemoveWindow(DockingWindow window)
doRemoveWindow
in class DockingWindow
public RootWindow getRootWindow()
DockingWindow
RootWindow
which contains this window, null if there is none.
getRootWindow
in class DockingWindow
RootWindow
, null if there is noneprotected boolean acceptsSplitWith(DockingWindow window)
acceptsSplitWith
in class DockingWindow
protected DropAction doAcceptDrop(java.awt.Point p, DockingWindow window)
doAcceptDrop
in class DockingWindow
protected DropAction acceptInteriorDrop(java.awt.Point p, DockingWindow window)
acceptInteriorDrop
in class DockingWindow
protected PropertyMap getPropertyObject()
getPropertyObject
in class DockingWindow
protected PropertyMap createPropertyObject()
createPropertyObject
in class DockingWindow
boolean windowBarEnabled()
void removeWindowComponent(DockingWindow window)
removeWindowComponent
in class DockingWindow
void restoreWindowComponent(DockingWindow window)
restoreWindowComponent
in class DockingWindow
protected void cleanUpModel()
cleanUpModel
in class DockingWindow
protected boolean isShowingInRootWindow()
isShowingInRootWindow
in class DockingWindow
public void updateUI()
updateUI
in class javax.swing.JPanel
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class BaseContainer
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |