com.vlsolutions.swing.docking

Class DockView

Implemented Interfaces:
DockableContainer, DockDropReceiver, SingleDockableContainer
Known Direct Subclasses:
DetachedDockView, DockViewAsTab, MaximizedDockView, TabbedDockView

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 DockViewUI delegate.

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

Sample DockView

DockTabbedPane

See Also:
DockViewTitleBar

Field Summary

protected DockingDesktop
desktop
the desktop managing this view
protected Dockable
dockable
the dockable managed by this view
protected Shape
lastDropGeneralPath
remember the last drop position to cache the shape used for showing the drop position
protected Shape
lastDropShape
remember the last drop position to cache the shape used for showing the drop position
protected DockViewTitleBar
title

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 GeneralPath
buildPathForTab(Rectangle bounds)
Create a path used to display the drag shape of a tab container
Dockable
getDockable()
Returns the contained component
DockViewTitleBar
getTitleBar()
Returns (or creates) the title bar of this dockview
String
getUIClassID()
void
installDocking(DockingDesktop desktop)
void
processDockableDrag(DockDragEvent event)
.
void
processDockableDrop(DockDropEvent event)
Please note that a drag into a DockView can also lead to create a DockTabbedPane.
protected void
scanDrop(DockEvent event, boolean drop)
void
setDockable(Dockable dockable)
Adds the dockable's component to this DockView.
String
toString()
void
uninstallDocking(DockingDesktop desktop)

Field Details

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 Details

DockView

public DockView()
Constructs an empty DockView.

A 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 Details

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
Specified by:
getDockable in interface SingleDockableContainer

getTitleBar

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

getUIClassID

public String getUIClassID()
Since:
2.0

installDocking

public void installDocking(DockingDesktop desktop)
Specified by:
installDocking in interface DockableContainer

processDockableDrag

public void processDockableDrag(DockDragEvent event)
.
Specified by:
processDockableDrag in interface DockDropReceiver

processDockableDrop

public void processDockableDrop(DockDropEvent event)
Please note that a drag into a DockView can also lead to create a DockTabbedPane.
Specified by:
processDockableDrop in interface DockDropReceiver

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

uninstallDocking

public void uninstallDocking(DockingDesktop desktop)
Specified by:
uninstallDocking in interface DockableContainer

© Copyright 2004-2006 VLSolutions. All Rights Reserved.
www.vlsolutions.com : Java Components - Smart Client Applications