|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.formaria.swing.docking.DockingPanel
public class DockingPanel
A panel for use in a docking framework. The panel is an area into which various content panels may be docked. These docked panels are displayed with a header containing a title and a dock/minimize button. Clicking on the minimize button caused the panel to hide itself within the MultiSplitPane's layout and add a button to the side bar if one has been specified. Double clicking the header causes the panel to occupy the full area of its parent
An individual DockingPanel can contain multiple child panels, each of which is given a separate header, similar to a tab in a tab pane. The header contains a button, which when clicked docks the panel to a sidebar. The header may also contain a highlight to indicate that it is selected/active
The dockable components are managed via the Dockable object which contains a collection of the participating objects, including the DockingPanel, the DockingSidebar that holds the minimized panel and the DockableHeader that is used within this panel. The value of the dockable object's fields are set as the dockable panel's state is changed.
In docking a panel the panel is hidden and the sidebar is informed that it should assume ownership of the dockable. However the content/panel remains a child of this docking panel unless shown in a preview panel. In the preview the content is 'borrowed' by the preview panel, but when the preview panel is dismissed the content is restored to this instance of the docking panel.
Copyright: (c) Formaria Ltd., 2008
License: see license.txt
| Nested Class Summary | |
|---|---|
class |
DockingPanel.DockableProxy
A proxy for hidden panels. |
| 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 | |
|---|---|
protected DockableHeader |
activeHeader
|
static int |
CLOSED
|
protected javax.swing.JPanel |
contentPane
|
protected java.awt.Dimension |
defSize
|
protected javax.swing.JPanel |
headerPanel
|
protected java.util.ArrayList |
listeners
|
static int |
MAXIMIZED
|
static int |
MINIMIZED
|
static int |
PREVIEW_CLOSED
|
static int |
PREVIEW_OPENED
|
static int |
RESTORED
|
protected JXMultiSplitPane |
splitPane
|
static boolean |
USE_REMOVE_STRATEGY
|
| 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 | |
|---|---|
DockingPanel(java.lang.String constraint)
Creates a new instance of DockingPanel |
|
| Method Summary | |
|---|---|
void |
addDockable(Dockable dockable,
java.awt.Color[] colors,
java.lang.String[] tooltips)
Add a panel to this container. |
void |
addDockingPanelListener(DockingPanelListener l)
Add a listener to this panel |
void |
dock()
Dock this panel |
void |
fireDockingPanelListeners(int state)
Invoke a dockingpanel listener method |
java.lang.String |
getConstraint()
Get the constraint used by this docking panel. |
java.awt.Container |
getContentPane()
Get the container into which the content should be added |
java.awt.Dimension |
getPreferredSize()
Get the preferred size of the component. |
java.lang.String |
getTitle()
Get the window title of teh active header |
void |
removeDockable(Dockable dockable,
boolean addToSidebar)
Remove the content referred to by the dockable from this docking panel |
void |
removeDockable(Dockable dockable,
boolean addToSidebar,
boolean removeDocked)
Remove the content referred to by the dockable from this docking panel |
void |
removeDockingPanelListener(DockingPanelListener l)
Remove a listener from this panel |
void |
restoreContent(Dockable dockable)
Dock the content of the dockable object back into this container. |
void |
setActivateHeader(DockableHeader dh)
Set the active header |
void |
setBorderColor(java.awt.Color c)
Set the border color |
void |
setConstraint(java.lang.String c)
Set the constraint used by this docking panel. |
void |
setTitle(java.lang.String title)
Set the window title of the active header |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, 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, paintComponent, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, 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, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean USE_REMOVE_STRATEGY
public static final int CLOSED
public static final int MAXIMIZED
public static final int MINIMIZED
public static final int PREVIEW_CLOSED
public static final int PREVIEW_OPENED
public static final int RESTORED
protected DockableHeader activeHeader
protected javax.swing.JPanel contentPane
protected javax.swing.JPanel headerPanel
protected java.awt.Dimension defSize
protected JXMultiSplitPane splitPane
protected java.util.ArrayList listeners
| Constructor Detail |
|---|
public DockingPanel(java.lang.String constraint)
constraint - the name/constraint by which this panel is known. Note
that this name is not displayed to the user and is instead used
programatically| Method Detail |
|---|
public void addDockingPanelListener(DockingPanelListener l)
public void removeDockingPanelListener(DockingPanelListener l)
public void fireDockingPanelListeners(int state)
state - a flasg indicating the new state and hence the method to invokepublic java.lang.String getConstraint()
public void setConstraint(java.lang.String c)
c - the new layout constraintpublic java.awt.Container getContentPane()
public void restoreContent(Dockable dockable)
dockable - the object being docked.
public void addDockable(Dockable dockable,
java.awt.Color[] colors,
java.lang.String[] tooltips)
dockable - the object being docked.colors - the header colors: background, text color, active background, active text colortooltips - the tooltip text for the minimize and close buttonspublic void setActivateHeader(DockableHeader dh)
dh - the new active header
public void removeDockable(Dockable dockable,
boolean addToSidebar,
boolean removeDocked)
dockable - the object being docked.addToSideBar - true to add the content to the dockable's sidebarremoveDocked - true to remove a docked component from the sidebar if
the component is already minimized and docked
public void removeDockable(Dockable dockable,
boolean addToSidebar)
dockable - the object being docked.addToSideBar - true to add the content to the dockable's sidebarpublic void dock()
public java.lang.String getTitle()
public void setTitle(java.lang.String title)
title - the new titlepublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic void setBorderColor(java.awt.Color c)
c - the new color
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||