Class KeyBinding
java.lang.Object
com.realtime.crossfire.jxclient.gui.keybindings.KeyBinding
- All Implemented Interfaces:
Comparable<KeyBinding>
Abstract base class for key bindings. A key binding consists of information
about the bound key and an associated
CommandList.-
Constructor Summary
ConstructorsConstructorDescriptionKeyBinding(@NotNull KeyEvent2 keyEvent, @NotNull CommandList commands, boolean isDefault) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull KeyBinding o) boolean@NotNull StringReturn the binding as a human-readable text.@NotNull CommandListReturns the associatedCommandList.@NotNull StringReturns the commands as a string.@NotNull KeyEvent2Returns the key to match.inthashCode()booleanReturns whether the key binding is a "default" binding which should not be saved.booleanmatchesKeyEvent(@NotNull KeyEvent2 keyEvent) Checks whether this key binding matches a key event.
-
Constructor Details
-
KeyBinding
public KeyBinding(@NotNull @NotNull KeyEvent2 keyEvent, @NotNull @NotNull CommandList commands, boolean isDefault) Creates a new instance.- Parameters:
keyEvent- the key to matchcommands- the commands to executeisDefault- whether the key binding is a "default" binding which should not be saved
-
-
Method Details
-
getKeyEvent2
Returns the key to match.- Returns:
- the key to match
-
getCommands
Returns the associatedCommandList.- Returns:
- the associated command list
-
matchesKeyEvent
Checks whether this key binding matches a key event.- Parameters:
keyEvent- the key to check- Returns:
- whether the key binding matches the parameters
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<KeyBinding>
-
getBindingDescription
Return the binding as a human-readable text.- Returns:
- the human-readable text
-
getCommandString
Returns the commands as a string.- Returns:
- the commands as a string
-
isDefault
public boolean isDefault()Returns whether the key binding is a "default" binding which should not be saved.- Returns:
true=do not save
-