bibliothek.gui.dock.control
Interface DockRelocatorMode

All Known Implementing Classes:
AcceptanceDockRelocatorMode

public interface DockRelocatorMode

A DockRelocatorMode is used by a DockRelocator to change the behaviour of the drag and drop-operation depending what the user does with the mouse and the keyboard.

Author:
Benjamin Sigg

Field Summary
static DockRelocatorMode NO_COMBINATION
          Ensures that a Dockable can be dragged only if no combination results.
static DockRelocatorMode SCREEN_ONLY
          Ensures that a Dockable can be dragged only onto a ScreenDockStation.
 
Method Summary
 void setActive(DockController controller, boolean active)
          Tells this mode whether it should have an influence of the behaviour or not.
 boolean shouldBeActive(DockController controller, int modifiers)
          Tells whether this mode should be activated because of the state of the controller and the last MouseEvent.
 

Field Detail

SCREEN_ONLY

static final DockRelocatorMode SCREEN_ONLY
Ensures that a Dockable can be dragged only onto a ScreenDockStation. This mode is installed automatically by the DockController.


NO_COMBINATION

static final DockRelocatorMode NO_COMBINATION
Ensures that a Dockable can be dragged only if no combination results. This mode is installed automatically by the DockController.

Method Detail

shouldBeActive

boolean shouldBeActive(DockController controller,
                       int modifiers)
Tells whether this mode should be activated because of the state of the controller and the last MouseEvent.

Parameters:
controller - the controller which might be affected by this mode
modifiers - the state of the mouse, see InputEvent.getModifiersEx()
Returns:
true if this mode should be activated, false otherwise

setActive

void setActive(DockController controller,
               boolean active)
Tells this mode whether it should have an influence of the behaviour or not.

Parameters:
controller - the controller for which this mode is used
active - true if this mode should change the behaviour, false otherwise