bibliothek.gui.dock.control
Class AcceptanceDockRelocatorMode

java.lang.Object
  extended by bibliothek.gui.dock.control.AcceptanceDockRelocatorMode
All Implemented Interfaces:
DockAcceptance, DockRelocatorMode

public abstract class AcceptanceDockRelocatorMode
extends Object
implements DockRelocatorMode, DockAcceptance

A DockRelocatorMode that adds itself as a DockAcceptance to the DockController when activated.

Author:
Benjamin Sigg

Field Summary
 
Fields inherited from interface bibliothek.gui.dock.control.DockRelocatorMode
NO_COMBINATION, NO_COMBINATION_MASK, SCREEN_MASK, SCREEN_ONLY
 
Constructor Summary
AcceptanceDockRelocatorMode(int onmask, int offmask)
          Creates a new mode.
AcceptanceDockRelocatorMode(ModifierMask mask)
          Creates a new mode.
 
Method Summary
 ModifierMask getMask()
          Gets the mask for this mode.
 void setActive(DockController controller, boolean active)
          Tells this mode whether it should have an influence of the behaviour or not.
 void setMask(ModifierMask mask)
          Sets the keys that must be pressed in order to activate this mode.
 boolean shouldBeActive(DockController controller, int modifiers)
          Tells whether this mode should be activated because of the state of the controller and the last MouseEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bibliothek.gui.dock.accept.DockAcceptance
accept, accept
 

Constructor Detail

AcceptanceDockRelocatorMode

public AcceptanceDockRelocatorMode(int onmask,
                                   int offmask)
Creates a new mode. The masks are created by using the constants "xzy_DOWN_MASK" from InputEvent.

Parameters:
onmask - the keys that must be pressed to activate this mode
offmask - the keys that must not be pressed to activate this mode

AcceptanceDockRelocatorMode

public AcceptanceDockRelocatorMode(ModifierMask mask)
Creates a new mode.

Parameters:
mask - the pattern of keys that must be pressed to activate this mode
Method Detail

setMask

public void setMask(ModifierMask mask)
Sets the keys that must be pressed in order to activate this mode.

Parameters:
mask - the mask

getMask

public ModifierMask getMask()
Gets the mask for this mode.

Returns:
the mask

setActive

public void setActive(DockController controller,
                      boolean active)
Description copied from interface: DockRelocatorMode
Tells this mode whether it should have an influence of the behaviour or not.

Specified by:
setActive in interface DockRelocatorMode
Parameters:
controller - the controller for which this mode is used
active - true if this mode should change the behaviour, false otherwise

shouldBeActive

public boolean shouldBeActive(DockController controller,
                              int modifiers)
Description copied from interface: DockRelocatorMode
Tells whether this mode should be activated because of the state of the controller and the last MouseEvent.

Specified by:
shouldBeActive in interface DockRelocatorMode
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