com.javadocking.drag
Interface Dragger

All Known Implementing Classes:
DynamicDockableDragger, DynamicDragger, DynamicTabDragger, StaticCompositeTabDragger, StaticDockableDragger, StaticDragger, StaticSingleDragger, StaticTabDragger

public interface Dragger

This is an interface for a class that drags Dockables from a source Dock to a destination dock. It can also move a dockable inside a dock.

Author:
Heidi Rakels.

Method Summary
 void cancelDragging(java.awt.event.MouseEvent mouseEvent)
           Cancels the dragging of a Dockable object from a source Dock to a destination dock.
 void drag(java.awt.event.MouseEvent mouseEvent)
           Continues the dragging of a Dockable object from a source Dock to a destination dock.
 void showPopupMenu(java.awt.event.MouseEvent mouseEvent)
          Shows the popup menu for the selected dockable or the selected composite dockable.
 boolean startDragging(java.awt.event.MouseEvent mouseEvent)
           Tries to start the dragging of a Dockable from a source Dock to a destination dock.
 void stopDragging(java.awt.event.MouseEvent mouseEvent)
           Finishes the dragging of a Dockable object from a source Dock to a destination dock.
 

Method Detail

startDragging

boolean startDragging(java.awt.event.MouseEvent mouseEvent)

Tries to start the dragging of a Dockable from a source Dock to a destination dock.

The dockable that should be dragged is searched for the given mouse position.

Parameters:
mouseEvent - The mouse event that was triggered.
Returns:
True if the dragging of a dockable could be started, false otherwise.

drag

void drag(java.awt.event.MouseEvent mouseEvent)

Continues the dragging of a Dockable object from a source Dock to a destination dock.

Static draggers typically paint a rectangle on the place where the dockable would be docked, if the mouse was released at this position.

Dynamic draggers typically do the docking immediately: the destination dock is searched for the given mouse location. They try to remove the dockable from its current dock and add it to its destination dock. If the destination dock is the same dock as the origin, they can move the dockable to a new position.

Parameters:
mouseEvent - The new mouse event that was triggered.

stopDragging

void stopDragging(java.awt.event.MouseEvent mouseEvent)

Finishes the dragging of a Dockable object from a source Dock to a destination dock.

Static draggers typically do the docking now: the destination dock is searched for the given mouse location. They try to remove the dockable from its current dock and add it to its destination dock. If the destination dock is the same dock as the origin, they can move the dockable to a new position.

Dynamic draggers typically only clean up now.

Parameters:
mouseEvent - The last mouse event that was triggered.

cancelDragging

void cancelDragging(java.awt.event.MouseEvent mouseEvent)

Cancels the dragging of a Dockable object from a source Dock to a destination dock. The dragged dockable remains in its current dock.

For dynamic draggers it is possible that the dock of the dockable has changed already.

Parameters:
mouseEvent - The last mouse event that was triggered.

showPopupMenu

void showPopupMenu(java.awt.event.MouseEvent mouseEvent)
Shows the popup menu for the selected dockable or the selected composite dockable.

Parameters:
mouseEvent - The last mouse event that was triggered.