org.fest.swing.keystroke
Class KeyStrokeMapping

java.lang.Object
  extended by org.fest.swing.keystroke.KeyStrokeMapping

public class KeyStrokeMapping
extends Object

Understands a mapping between a character and a KeyStroke.

Author:
Yvonne Wang

Constructor Summary
KeyStrokeMapping(char character, int keyCode, int modifiers)
          Creates a new KeyStrokeMapping.
KeyStrokeMapping(char character, KeyStroke keyStroke)
          Creates a new KeyStrokeMapping.
 
Method Summary
 char character()
          Returns the character corresponding to this mapping's keyStroke().
 boolean equals(Object o)
           
 int hashCode()
           
 KeyStroke keyStroke()
          Returns the KeyStroke corresponding to this mapping's character().
static KeyStrokeMapping mapping(char character, int keyCode, int modifiers)
          Creates a new KeyStrokeMapping.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyStrokeMapping

public KeyStrokeMapping(char character,
                        int keyCode,
                        int modifiers)
Creates a new KeyStrokeMapping.

Parameters:
character - the character corresponding to the intended KeyStroke.
keyCode - the numeric key code for the intended KeyStroke.
modifiers - the set of modifiers for the intended KeyStroke.

KeyStrokeMapping

public KeyStrokeMapping(char character,
                        KeyStroke keyStroke)
Creates a new KeyStrokeMapping.

Parameters:
character - the character corresponding to the given KeyStroke.
keyStroke - the KeyStroke corresponding to the given character.
Method Detail

mapping

public static KeyStrokeMapping mapping(char character,
                                       int keyCode,
                                       int modifiers)
Creates a new KeyStrokeMapping.

Parameters:
character - the character corresponding to the intended KeyStroke.
keyCode - the numeric key code for the intended KeyStroke.
modifiers - the set of modifiers for the intended KeyStroke.
Returns:
the created KeyStrokeMapping.

character

public char character()
Returns the character corresponding to this mapping's keyStroke().

Returns:
the character corresponding to this mapping's KeyStroke.

keyStroke

public KeyStroke keyStroke()
Returns the KeyStroke corresponding to this mapping's character().

Returns:
the KeyStroke corresponding to this mapping's character.

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(Object)

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2007-2011 FEST (Fixtures for Easy Software Testing). All Rights Reserved.