com.realtime.crossfire.jxclient.gui.keybindings
Class KeyCharKeyBinding

java.lang.Object
  extended by com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
      extended by com.realtime.crossfire.jxclient.gui.keybindings.KeyCharKeyBinding

public class KeyCharKeyBinding
extends KeyBinding

A KeyBinding that matches by key character.


Field Summary
private  char keyChar
          The key character to match.
 
Constructor Summary
KeyCharKeyBinding(char keyChar, CommandList commands, boolean isDefault)
          Creates a KeyBinding that matches by key character.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 char getKeyChar()
          Returns the key character to match.
 int hashCode()
          
 boolean matchesKeyChar(char keyChar)
          Check whether this key binding matches a key character.
 boolean matchesKeyCode(int keyCode, int modifiers)
          Checks whether this key binding matches a key code/modifiers pair.
 
Methods inherited from class com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
getCommands, getCommandString, isDefault
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

keyChar

private final char keyChar
The key character to match.

Constructor Detail

KeyCharKeyBinding

public KeyCharKeyBinding(char keyChar,
                         @NotNull
                         CommandList commands,
                         boolean isDefault)
Creates a KeyBinding that matches by key character.

Parameters:
keyChar - the key character to match
commands - the commands to associate with this binding
isDefault - whether the key binding is a "default" binding which should not be saved
Method Detail

equals

public boolean equals(@Nullable
                      java.lang.Object obj)

Specified by:
equals in class KeyBinding

getKeyChar

public char getKeyChar()
Returns the key character to match.

Returns:
the key character to match

hashCode

public int hashCode()

Specified by:
hashCode in class KeyBinding

matchesKeyChar

public boolean matchesKeyChar(char keyChar)
Check whether this key binding matches a key character.

Specified by:
matchesKeyChar in class KeyBinding
Parameters:
keyChar - the key character to check
Returns:
whether the key binding matches the parameters

matchesKeyCode

public boolean matchesKeyCode(int keyCode,
                              int modifiers)
Checks whether this key binding matches a key code/modifiers pair.

Specified by:
matchesKeyCode in class KeyBinding
Parameters:
keyCode - the key code to check
modifiers - the modifiers to check
Returns:
whether the key binding matches the parameters