|
||||||||||
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
com.vlsolutions.swing.docking.DockViewTitleBar
public class DockViewTitleBar
A title bar, associated to a DockView (container of a single user component).
Here is an example of a title bar : .
DockViewTitleBar is able to display the following properties of a DockKey :
This title bar supports buttons used for docking features :
function | Version 1.1 | Version 2.0 |
---|---|---|
maximize | ![]() | ![]() |
restore | ![]() | ![]() |
hide | ![]() | ![]() |
dock | ![]() | ![]() |
close | ![]() | ![]() |
float (detach) | n/a | ![]() |
attach | n/a | ![]() |
The buttons managed have no effect on the state of the dockable : they just fire property change events, and it is the responsibility of the DockableContainer to listen to those events and to relay the operation to the docking desktop.
Note : the UI Delegate of the DockViewTitleBar is the DockViewTitleBarUI
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
static java.lang.String |
PROPERTY_AUTOHIDE
Property name designating the autohide button selection |
static java.lang.String |
PROPERTY_CLOSED
Property name designating the close button selection |
static java.lang.String |
PROPERTY_DRAGGED
Property name designating a drag gesture beginning |
static java.lang.String |
PROPERTY_FLOAT
Property name designating the float button selection |
static java.lang.String |
PROPERTY_MAXIMIZED
Property name designating the maximized button selection |
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 | |
---|---|
DockViewTitleBar()
Constructs an empty title bar (no dockable yet associated). |
|
DockViewTitleBar(Dockable dockable)
Constructs a title bar for the specified dockable. |
Method Summary | |
---|---|
void |
closePopUp()
This method is invoked to hide the pop-up that could still be visible (To avoid a visible pop-up for an invisible component) |
void |
endDragComponent(boolean dropped)
notifies the source when the drag operation has ended (by a drop or cancelled) |
javax.swing.JButton |
getCloseButton()
|
DockingDesktop |
getDesktop()
Returns the desktop associated to this title bar, if one has been registered with #installDocking(DockingDesktop), or null. |
Dockable |
getDockable()
Returns the Dockable component this source is for |
java.awt.Container |
getDockableContainer()
Returns the container of the dockable's component |
javax.swing.JButton |
getFloatButton()
returns the button used for floating (detach) the view. |
javax.swing.JButton |
getHideOrDockButton()
returns the button used for hiding or docking the view. |
javax.swing.JButton |
getMaximizeOrRestoreButton()
returns the button used for maximizing or restoring the view. |
javax.swing.JLabel |
getTitleLabel()
Returns the label used to display the dockkey name. |
java.lang.String |
getUIClassID()
|
protected void |
initAutoHidePopUp(javax.swing.JPopupMenu popup)
|
protected void |
initDockedPopUp(javax.swing.JPopupMenu popup)
|
protected void |
initFloatingPopUp(javax.swing.JPopupMenu popup)
Init the popup displayed as the title bar contextual menu |
protected void |
initMaximizedPopUp(javax.swing.JPopupMenu popup)
Init the popup displayed as the title bar contextual menu |
void |
installDocking(DockingDesktop desktop)
|
boolean |
isActive()
Returns true if the dockable is the currently active one. |
protected void |
layoutTitleBar()
called to build the title bar |
void |
removeNotify()
Overriden as a means to unregister internal listeners, do not call directly |
void |
setActive(boolean active)
Updates the active property. |
void |
setDockable(Dockable dockable)
Changes the dockable this title bar is for |
boolean |
startDragComponent(java.awt.Point p)
Notifies this source that a drag operation has begun. |
java.lang.String |
toString()
Returns a readeable String representing this title bar |
void |
uninstallDocking(DockingDesktop desktop)
|
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, 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, 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, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, 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, transferFocusBackward, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROPERTY_AUTOHIDE
public static final java.lang.String PROPERTY_CLOSED
public static final java.lang.String PROPERTY_DRAGGED
public static final java.lang.String PROPERTY_MAXIMIZED
public static final java.lang.String PROPERTY_FLOAT
Constructor Detail |
---|
public DockViewTitleBar()
public DockViewTitleBar(Dockable dockable)
Warning : a DockViewTitleBar can be used with multiple dockables (this is the case for example in autohide borders, where a single titlebar is shared by all hidden dockables (shown only when one is expanding).
Method Detail |
---|
public DockingDesktop getDesktop()
public void removeNotify()
removeNotify
in class javax.swing.JComponent
protected void layoutTitleBar()
public javax.swing.JLabel getTitleLabel()
Shouldn't be used to update the title : the best way is to update the DockKey (property listener ensure the labels and buttons stay in sync).
public javax.swing.JButton getCloseButton()
public javax.swing.JButton getHideOrDockButton()
As hiding and docking are mutually exclusive, the same button is used for both purposes
public javax.swing.JButton getMaximizeOrRestoreButton()
As those operations are mutually exclusive, the same button is used for both purposes
public javax.swing.JButton getFloatButton()
public void closePopUp()
public java.lang.String getUIClassID()
getUIClassID
in class javax.swing.JPanel
public boolean isActive()
There is at most one active dockable for a dekstop, and it there is one, it is the one which contains the keybord focused component.
public void setActive(boolean active)
public void setDockable(Dockable dockable)
public Dockable getDockable()
Dockable
component this source is for
getDockable
in interface DockableDragSource
public boolean startDragComponent(java.awt.Point p)
The source may reject the drag according to internal conditions (in that case
this method shall return false
) or to wrong mouse position .
startDragComponent
in interface DockableDragSource
p
refers to
a draggable component), false otherwise.public java.lang.String toString()
toString
in class java.awt.Component
protected void initMaximizedPopUp(javax.swing.JPopupMenu popup)
protected void initAutoHidePopUp(javax.swing.JPopupMenu popup)
protected void initDockedPopUp(javax.swing.JPopupMenu popup)
protected void initFloatingPopUp(javax.swing.JPopupMenu popup)
public java.awt.Container getDockableContainer()
getDockableContainer
in interface DockableDragSource
public void installDocking(DockingDesktop desktop)
public void uninstallDocking(DockingDesktop desktop)
public void endDragComponent(boolean dropped)
endDragComponent
in interface DockableDragSource
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |