bibliothek.gui.dock.control
Class SimpleModifierMask
java.lang.Object
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
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 |
SimpleModifierMask
public SimpleModifierMask(int on,
int off)
- Creates a new mask.
- Parameters:
on
- the keys that must be pressedoff
- the keys that must not be pressed
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