com.javadocking
Class DockingManager

java.lang.Object
  extended by com.javadocking.DockingManager

public class DockingManager
extends java.lang.Object

The docking manager contains only static methods that provide general objects that can be used by multiple docking classes, e.g. the cursors for dragging a dockable, the component factory, dragger factories, etc.

It has a DockModel that contains all the docks of the application. By default there is no dock model. The dock model should be set by setDockModel(DockModel).

This manager also provides the DraggerFactory. The default that will be used is StaticDraggerFactory. If you want to use another factory, e.g. DynamicDraggerFactory, you should set this factory before creating any Docks.

Author:
Heidi Rakels.

Constructor Summary
DockingManager()
           
 
Method Summary
static java.awt.Cursor getCanDockCursor()
          Gets the cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock.
static java.awt.Cursor getCanNotDockCursor()
          Gets the cursor that is used for dragging a dockable, when the dockable cannot be docked in an underlying dock.
static SwComponentFactory getComponentFactory()
          Gets the Swing component factory.
static DragListenerFactory getDockableDragListenerFactory()
          Gets the drag listener factory that creates the drag listeners for individual dockables.
static DragListenerFactory getDockDragListenerFactory()
          Gets the drag listener factory.
static DockingExecutor getDockingExecutor()
          Gets the executor of docking actions like: adding dockables to docks.
static DockingPathModel getDockingPathModel()
          Gets the docking path model of the application.
static DockModel getDockModel()
          Gets the dock model that contains all the docks of the application.
static DraggerFactory getDraggerFactory()
          Gets the dockable dragger factory.
static void setCanDockCursor(java.awt.Cursor newCanDockCursor)
          Sets the cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock.
static void setCanNotDockCursor(java.awt.Cursor newCanNotDockCursor)
          Sets the cursor that is used for dragging a dockable, when the dockable cannnot be docked in an underlying dock.
static void setComponentFactory(SwComponentFactory newComponentFactory)
          Sets a new Swing component factory.
static void setDockableDragListenerFactory(DragListenerFactory newDragListenerFactory)
          Sets the drag listener factory that creates the drag listeners for individual dockables.
static void setDockDragListenerFactory(DragListenerFactory newDragListenerFactory)
          Sets the drag listener factory.
static void setDockingExecutor(DockingExecutor newDockingExecutor)
          Sets the executor of docking actions like: adding dockables to docks.
static void setDockingPathModel(DockingPathModel newDockingPathModel)
          Sets the docking path model of the application.
static void setDockModel(DockModel newDockModel)
          Sets the dock model that contains all the docks of the application.
static void setDraggerFactory(DraggerFactory newDraggerFactory)
          Sets the dockable dragger factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DockingManager

public DockingManager()
Method Detail

getComponentFactory

public static SwComponentFactory getComponentFactory()
Gets the Swing component factory. The default is a DefaultSwComponentFactory. This factory will be used to create the Swing components in the docking library.

Returns:
The Swing component factory.

setComponentFactory

public static void setComponentFactory(SwComponentFactory newComponentFactory)
Sets a new Swing component factory.

Parameters:
newComponentFactory - The Swing component factory.

getDockingExecutor

public static DockingExecutor getDockingExecutor()
Gets the executor of docking actions like:

Returns:
The executor of docking actions, like adding, moving and removing dockables.

setDockingExecutor

public static void setDockingExecutor(DockingExecutor newDockingExecutor)
Sets the executor of docking actions like:

Parameters:
newDockingExecutor - The executor of docking actions, like adding, moving and removing dockables.

getDraggerFactory

public static DraggerFactory getDraggerFactory()
Gets the dockable dragger factory. This factory will be used to create a Dragger for every dock in the application. The default is a StaticDraggerFactory.

Returns:
The dockable dragger factory.

setDraggerFactory

public static void setDraggerFactory(DraggerFactory newDraggerFactory)
Sets the dockable dragger factory. This factory will be used to create a Dragger for every dock in the application.

Parameters:
newDraggerFactory - The dockable dragger factory.

getDockDragListenerFactory

public static DragListenerFactory getDockDragListenerFactory()
Gets the drag listener factory. This factory will be used to create a DragListener for every dock in the application. The default is a DefaultDragListenerFactory.

Returns:
The drag listener factory.

setDockDragListenerFactory

public static void setDockDragListenerFactory(DragListenerFactory newDragListenerFactory)
Sets the drag listener factory. This factory will be used to create a DragListener for every dock in the application.
WARNING: This factory should be set before creating any Dock objects!

Parameters:
newDragListenerFactory - The drag listener factory.

getDockableDragListenerFactory

public static DragListenerFactory getDockableDragListenerFactory()
Gets the drag listener factory that creates the drag listeners for individual dockables. This factory will be used to create a DragListener for every dock in the application. The default is a DefaultDragListenerFactory.

Returns:
The dockable dragger factory that creates the drag listeners individual dockables.

setDockableDragListenerFactory

public static void setDockableDragListenerFactory(DragListenerFactory newDragListenerFactory)
Sets the drag listener factory that creates the drag listeners for individual dockables. This factory will be used to create a DragListener for every dock in the application.
WARNING:This factory should be set before creating any Dock objects!

Parameters:
newDragListenerFactory - The drag listener factory.

getDockModel

public static DockModel getDockModel()
Gets the dock model that contains all the docks of the application.

Returns:
The dock model that contains all the docks of the application.

setDockModel

public static void setDockModel(DockModel newDockModel)
Sets the dock model that contains all the docks of the application.
WARNING:The dock model has to be given to the docking manager as soon as possible. Many utility methods are using the dock model of the docking manager.

Parameters:
newDockModel - The dock model that contains all the docks of the application.
Throws:
java.lang.NullPointerException - If the dock model is null.

getDockingPathModel

public static DockingPathModel getDockingPathModel()
Gets the docking path model of the application. The default is a DefaultDockingPathModel.

Returns:
The docking path model of the application.

setDockingPathModel

public static void setDockingPathModel(DockingPathModel newDockingPathModel)
Sets the docking path model of the application.

Parameters:
newDockingPathModel - The docking path model of the application.
Throws:
java.lang.NullPointerException - If the docking path model is null.

getCanDockCursor

public static java.awt.Cursor getCanDockCursor()
Gets the cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock. The default is java.awt.dnd.DragSource.DefaultMoveDrop.

Returns:
The cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock.

setCanDockCursor

public static void setCanDockCursor(java.awt.Cursor newCanDockCursor)
Sets the cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock.

Parameters:
newCanDockCursor - The cursor that is used for dragging a dockable, when the dockable can be docked in an underlying dock.

getCanNotDockCursor

public static java.awt.Cursor getCanNotDockCursor()
Gets the cursor that is used for dragging a dockable, when the dockable cannot be docked in an underlying dock. The default is java.awt.dnd.DragSource.DefaultMoveNoDrop.

Returns:
The cursor that is used for dragging a dockable, when the dockable cannot be docked in an underlying dock.

setCanNotDockCursor

public static void setCanNotDockCursor(java.awt.Cursor newCanNotDockCursor)
Sets the cursor that is used for dragging a dockable, when the dockable cannnot be docked in an underlying dock.

Parameters:
newCanNotDockCursor - The cursor that is used for dragging a dockable, when the dockable cannot be docked in an underlying dock.