Class KeyStrokeMapping

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

public class KeyStrokeMapping extends Object
Understands a mapping between a character and a KeyStroke.
  • Field Details

    • character

      private final char character
    • keyStroke

      private final KeyStroke keyStroke
  • Constructor Details

    • 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 Details

    • 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:
    • hashCode

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

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