com.javadocking.drag
Class StaticDraggerFactory

java.lang.Object
  extended by com.javadocking.drag.StaticDraggerFactory
All Implemented Interfaces:
DraggerFactory

public class StaticDraggerFactory
extends java.lang.Object
implements DraggerFactory

This dragger factory creates draggers that show with rectangles during dragging, where the Dockables will be docked, if the mouse button is released in that position.

Author:
Heidi Rakels.

Constructor Summary
StaticDraggerFactory()
          Constructs a dragger factory with a default painter for painting the dragged dockables.
StaticDraggerFactory(DockableDragPainter dockableDragPainter)
          Constructs a dragger factory with the given painter for painting the dragged dockables.
 
Method Summary
 Dragger createDragger(Dockable dockable)
          It creates a StaticDockableDragger with the dockableDragPainter of this class.
 Dragger createDragger(LeafDock dock)
          It creates the following draggers with the dockableDragPainter of this class: For a SingleDock: a StaticSingleDragger.
 DockableDragPainter getDockableDragPainter()
           Gets the painter for painting the dragged dockables.
 void setDockableDragPainter(DockableDragPainter dockableDragPainter)
          Sets the painter for painting the dragged dockables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StaticDraggerFactory

public StaticDraggerFactory()
Constructs a dragger factory with a default painter for painting the dragged dockables.


StaticDraggerFactory

public StaticDraggerFactory(DockableDragPainter dockableDragPainter)
Constructs a dragger factory with the given painter for painting the dragged dockables.

Parameters:
dockableDragPainter - The painter for painting the dragged dockables.
Method Detail

createDragger

public Dragger createDragger(LeafDock dock)
It creates the following draggers with the dockableDragPainter of this class: For other types of docks a StaticDragger is returned.

Specified by:
createDragger in interface DraggerFactory
Parameters:
dock - The dock for which a dragger should be created.
Returns:
The created dragger.

createDragger

public Dragger createDragger(Dockable dockable)
It creates a StaticDockableDragger with the dockableDragPainter of this class.

Specified by:
createDragger in interface DraggerFactory
Parameters:
dockable - The dockable for which a dragger should be created.
Returns:
The created dragger.

getDockableDragPainter

public DockableDragPainter getDockableDragPainter()

Gets the painter for painting the dragged dockables.

The default is a SwDockableDragPainter with a DefaultRectanglePainter.

Returns:
dockableDragPainter The painter for painting the dragged dockables.

setDockableDragPainter

public void setDockableDragPainter(DockableDragPainter dockableDragPainter)
Sets the painter for painting the dragged dockables.

Parameters:
dockableDragPainter - The painter for painting the dragged dockables.