java.lang.Object com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
public abstract class KeyBinding
Abstract base class for key bindings. A key binding consists of information
about the bound key and an associated CommandList
.
Field Summary | |
---|---|
private CommandList |
commands
The associated CommandList . |
private boolean |
isDefault
Whether the key binding is a "default" binding which should not be saved. |
Constructor Summary | |
---|---|
protected |
KeyBinding(CommandList commands,
boolean isDefault)
Creates a new instance. |
Method Summary | |
---|---|
abstract boolean |
equals(java.lang.Object obj)
|
CommandList |
getCommands()
Returns the associated CommandList . |
java.lang.String |
getCommandString()
Returns the commands as a string. |
abstract int |
hashCode()
|
boolean |
isDefault()
Returns whether the key binding is a "default" binding which should not be saved. |
abstract boolean |
matchesKeyChar(char keyChar)
Check whether this key binding matches a key character. |
abstract boolean |
matchesKeyCode(int keyCode,
int modifiers)
Checks whether this key binding matches a key code/modifiers pair. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final CommandList commands
CommandList
.
private final boolean isDefault
Constructor Detail |
---|
protected KeyBinding(@NotNull CommandList commands, boolean isDefault)
commands
- the commands to executeisDefault
- whether the key binding is a "default" binding which
should not be savedMethod Detail |
---|
public abstract boolean equals(@Nullable java.lang.Object obj)
equals
in class java.lang.Object
@NotNull public CommandList getCommands()
CommandList
.
@NotNull public java.lang.String getCommandString()
public abstract int hashCode()
hashCode
in class java.lang.Object
public boolean isDefault()
true
=do not savepublic abstract boolean matchesKeyChar(char keyChar)
keyChar
- the key character to check
public abstract boolean matchesKeyCode(int keyCode, int modifiers)
keyCode
- the key code to checkmodifiers
- the modifiers to check