public class DockViewTitleBar extends javax.swing.JPanel implements DockableDragSource
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
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
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
|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
DockViewTitleBar()
Constructs an empty title bar (no dockable yet associated).
|
DockViewTitleBar(Dockable dockable)
Constructs a title bar for the specified dockable.
|
Modifier and Type | Method and Description |
---|---|
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)
|
void |
finishLayout()
Notification of completion of layout.
|
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 |
getHelpButton()
MM added
|
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.JToggleButton |
getSortButton()
MM added
|
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 |
initCmdButton(javax.swing.AbstractButton btn,
java.lang.String s) |
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.
|
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) |
getAccessibleContext, getUI, paramString, setUI, updateUI
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, isPaintingOrigin, 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
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
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
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
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).
protected void initCmdButton(javax.swing.AbstractButton btn, java.lang.String s)
public void finishLayout()
This hook can be used to insert customized buttons without otherwise having to fully replace the UI delegate
public DockingDesktop getDesktop()
public void removeNotify()
removeNotify
in class javax.swing.JComponent
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 getHelpButton()
public javax.swing.JToggleButton getSortButton()
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 forgetDockable
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
Copyright © 2010-2014 Pacific Biosciences. All Rights Reserved.