bibliothek.gui.dock.control
Class SimpleModifierMask

java.lang.Object
  extended by bibliothek.gui.dock.control.SimpleModifierMask
All Implemented Interfaces:
ModifierMask

public class SimpleModifierMask
extends Object
implements ModifierMask

This mask uses two integers on and off to check a modifier. A modifier is accepted if (modifier & (on | off))== on is true.

Author:
Benjamin Sigg

Constructor Summary
SimpleModifierMask(int on, int off)
          Creates a new mask.
 
Method Summary
 boolean matches(int modifiers)
          Tells whether this ModifierMask relates to modifiers or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleModifierMask

public SimpleModifierMask(int on,
                          int off)
Creates a new mask.

Parameters:
on - the keys that must be pressed
off - the keys that must not be pressed
Method Detail

matches

public boolean matches(int modifiers)
Description copied from interface: ModifierMask
Tells whether this ModifierMask relates to modifiers or not. The modifiers have the same form as InputEvent.getModifiersEx() would have.

Specified by:
matches in interface ModifierMask
Parameters:
modifiers - the modifiers from an InputEvent
Returns:
true if this mask matches the modifiers