com.vlsolutions.swing.docking

Class DockView

public class DockView extends JPanel implements DockDropReceiver, SingleDockableContainer

DefaultImplementation of the SingleDockableContainer.

A Dockview is the component responsible for displaying a single user component inside a DockingPanel.

The DockView contains a DockViewTitleBar, used as a header to display useful information and optional controls (close/maximize/hide/float)

UI : The user component is displayed with decorations provided by a {@link com.vlsolutions.swing.docking.ui.DockViewUI} delegate.

Here is an example (VLDocking 1.1 "shadow" style) :

Sample DockView

Note : multiple user-components are not displayable by the dockview : the default implementation of TabbedDockableContainer is the {@link DockTabbedPane}.

See Also:

UNKNOWN: 2005/12/09 Lilian Chamontin : added NPE safety check around uninstallDocking as sometimes uninstalling is done twice.

Field Summary
protected DockingDesktopdesktop
the desktop managing this view
protected Dockabledockable
the dockable managed by this view
protected ShapelastDropGeneralPath
remember the last drop position to cache the shape used for showing the drop position
protected ShapelastDropShape
remember the last drop position to cache the shape used for showing the drop position
protected DockViewTitleBartitle
Constructor Summary
DockView()
Constructs an empty DockView.
DockView(Dockable dockable)
Constructs a new DockView for the given dockable.
DockView(Dockable dockable, boolean showTitle)
Constructs a new DockView for the given dockable.
Method Summary
protected GeneralPathbuildPathForTab(Rectangle bounds)
Create a path used to display the drag shape of a tab container
DockablegetDockable()
Returns the contained component {@inheritDoc}
DockViewTitleBargetTitleBar()
Returns the title bar of this dockview
StringgetUIClassID()
{@inheritDoc}
voidinstallDocking(DockingDesktop desktop)
{@inheritDoc}
voidprocessDockableDrag(DockDragEvent event)
{@inheritDoc}.
voidprocessDockableDrop(DockDropEvent event)
{@inheritDoc}

Please note that a drag into a DockView can also lead to create a DockTabbedPane.

protected voidscanDrop(DockEvent event, boolean drop)
voidsetDockable(Dockable dockable)
Adds the dockable's component to this DockView.
StringtoString()
{@inheritDoc}
voiduninstallDocking(DockingDesktop desktop)
{@inheritDoc}

Field Detail

desktop

protected DockingDesktop desktop
the desktop managing this view

dockable

protected Dockable dockable
the dockable managed by this view

lastDropGeneralPath

protected Shape lastDropGeneralPath
remember the last drop position to cache the shape used for showing the drop position

lastDropShape

protected Shape lastDropShape
remember the last drop position to cache the shape used for showing the drop position

title

protected DockViewTitleBar title

Constructor Detail

DockView

public DockView()
Constructs an empty DockView.

A {@link #setDockable(Dockable)} call is requiered for this constructor to be usefull.

DockView

public DockView(Dockable dockable)
Constructs a new DockView for the given dockable.

Parameters: dockable the dockable to show

DockView

public DockView(Dockable dockable, boolean showTitle)
Constructs a new DockView for the given dockable.

Parameters: dockable the dockable to show

Method Detail

buildPathForTab

protected GeneralPath buildPathForTab(Rectangle bounds)
Create a path used to display the drag shape of a tab container

getDockable

public Dockable getDockable()
Returns the contained component {@inheritDoc}

getTitleBar

public DockViewTitleBar getTitleBar()
Returns the title bar of this dockview

getUIClassID

public String getUIClassID()
{@inheritDoc}

Since: 2.0

installDocking

public void installDocking(DockingDesktop desktop)
{@inheritDoc}

processDockableDrag

public void processDockableDrag(DockDragEvent event)
{@inheritDoc}.

processDockableDrop

public void processDockableDrop(DockDropEvent event)
{@inheritDoc}

Please note that a drag into a DockView can also lead to create a DockTabbedPane.

scanDrop

protected void scanDrop(DockEvent event, boolean drop)

setDockable

public void setDockable(Dockable dockable)
Adds the dockable's component to this DockView.

Parameters: dockable the user dockable

toString

public String toString()
{@inheritDoc}

uninstallDocking

public void uninstallDocking(DockingDesktop desktop)
{@inheritDoc}
© Copyright 2004-2005 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications