com.vlsolutions.swing.docking

Class DockViewTitleBar

public class DockViewTitleBar extends JPanel implements DockableDragSource

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.1Version 2.0
maximize
restore
hide
dock
close
float (detach)n/a
attachn/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

Field Summary
static StringPROPERTY_AUTOHIDE
Property name designating the autohide button selection
static StringPROPERTY_CLOSED
Property name designating the close button selection
static StringPROPERTY_DRAGGED
Property name designating a drag gesture beginning
static StringPROPERTY_FLOAT
Property name designating the float button selection
static StringPROPERTY_MAXIMIZED
Property name designating the maximized button selection
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
voidclosePopUp()
This method is invoked to hide the pop-up that could still be visible (To avoid a visible pop-up for an invisible component)
JButtongetCloseButton()
DockablegetDockable()
ContainergetDockableContainer()
JButtongetFloatButton()
returns the button used for floating (detach) the view.
JButtongetHideOrDockButton()
returns the button used for hiding or docking the view.
JButtongetMaximizeOrRestoreButton()
returns the button used for maximizing or restoring the view.
JLabelgetTitleLabel()
Returns the label used to display the dockkey name.
StringgetUIClassID()
protected voidinitAutoHidePopUp(JPopupMenu popup)
protected voidinitDockedPopUp(JPopupMenu popup)
protected voidinitFloatingPopUp(JPopupMenu popup)
Init the popup displayed as the title bar contextual menu
protected voidinitMaximizedPopUp(JPopupMenu popup)
Init the popup displayed as the title bar contextual menu
booleanisActive()
Returns true if the dockable is the currently active one.
protected voidlayoutTitleBar()
called to build the title bar
voidremoveNotify()
Overriden as a means to unregister internal listeners, do not call directly
voidsetActive(boolean active)
Updates the active property.
voidsetDockable(Dockable dockable)
Changes the dockable this title bar is for
booleanstartDragComponent(Point p)
StringtoString()
Returns a readeable String representing this title bar

Field Detail

PROPERTY_AUTOHIDE

public static final String PROPERTY_AUTOHIDE
Property name designating the autohide button selection

PROPERTY_CLOSED

public static final String PROPERTY_CLOSED
Property name designating the close button selection

PROPERTY_DRAGGED

public static final String PROPERTY_DRAGGED
Property name designating a drag gesture beginning

PROPERTY_FLOAT

public static final String PROPERTY_FLOAT
Property name designating the float button selection

PROPERTY_MAXIMIZED

public static final String PROPERTY_MAXIMIZED
Property name designating the maximized button selection

Constructor Detail

DockViewTitleBar

public DockViewTitleBar()
Constructs an empty title bar (no dockable yet associated)

DockViewTitleBar

public DockViewTitleBar(Dockable dockable)
Constructs a title bar for the specified dockable

Method Detail

closePopUp

public 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)

getCloseButton

public JButton getCloseButton()

getDockable

public Dockable getDockable()
{@inheritDoc }

getDockableContainer

public Container getDockableContainer()

getFloatButton

public JButton getFloatButton()
returns the button used for floating (detach) the view.

getHideOrDockButton

public JButton getHideOrDockButton()
returns the button used for hiding or docking the view.

As hiding and docking are mutually exclusive, the same button is used for both purposes

getMaximizeOrRestoreButton

public JButton getMaximizeOrRestoreButton()
returns the button used for maximizing or restoring the view.

As those operations are mutually exclusive, the same button is used for both purposes

getTitleLabel

public JLabel getTitleLabel()
Returns the label used to display the dockkey name.

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).

Since: 2.0

getUIClassID

public String getUIClassID()
{@inheritDoc }

Since: 2.0

initAutoHidePopUp

protected void initAutoHidePopUp(JPopupMenu popup)

initDockedPopUp

protected void initDockedPopUp(JPopupMenu popup)

initFloatingPopUp

protected void initFloatingPopUp(JPopupMenu popup)
Init the popup displayed as the title bar contextual menu

initMaximizedPopUp

protected void initMaximizedPopUp(JPopupMenu popup)
Init the popup displayed as the title bar contextual menu

isActive

public boolean isActive()
Returns true if the dockable is the currently active one.

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.

layoutTitleBar

protected void layoutTitleBar()
called to build the title bar

removeNotify

public void removeNotify()
Overriden as a means to unregister internal listeners, do not call directly

setActive

public void setActive(boolean active)
Updates the active property. A title bar is active when the dockable it is for is ancestor of the keybord focused component.

setDockable

public void setDockable(Dockable dockable)
Changes the dockable this title bar is for

startDragComponent

public boolean startDragComponent(Point p)
{@inheritDoc }

toString

public String toString()
Returns a readeable String representing this title bar
© Copyright 2004-2005 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications