org.assertj.swing.util
Class Modifiers

java.lang.Object
  extended by org.assertj.swing.util.Modifiers

public final class Modifiers
extends Object

Utility methods related to input modifiers. This class also maps modifier masks to key codes for the following modifiers:

Author:
Yvonne Wang, Alex Ruiz

Method Summary
static boolean isModifier(int keyCode)
          Indicates whether the given key code is a modifier.
static int[] keysFor(int modifierMask)
          Returns the key codes for the given modifier mask.
static int maskFor(int keyCode)
          Returns the modifier mask for the given key code.
static int updateModifierWithKeyCode(int keyCode, int modifierMask)
          Updates the given modifier mask with the given key code, only if the given key code belongs to a modifier key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

keysFor

@Nonnull
public static int[] keysFor(int modifierMask)
Returns the key codes for the given modifier mask.

Parameters:
modifierMask - the given modifier mask.
Returns:
the key codes for the given modifier mask.

isModifier

public static boolean isModifier(int keyCode)
Indicates whether the given key code is a modifier.

Parameters:
keyCode - the given key code.
Returns:
true if the given key code is a modifier, false otherwise.

maskFor

public static int maskFor(int keyCode)
Returns the modifier mask for the given key code.

Parameters:
keyCode - the given key code.
Returns:
the modifier mask for the given key code.
Throws:
IllegalArgumentException - if the given key code is not a modifier.

updateModifierWithKeyCode

public static int updateModifierWithKeyCode(int keyCode,
                                            int modifierMask)
Updates the given modifier mask with the given key code, only if the given key code belongs to a modifier key.

Parameters:
keyCode - the given key code.
modifierMask - the given modifier mask.
Returns:
the updated modifier mask.


Copyright © 2014–2015 AssertJ. All rights reserved.