00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.gui.keybindings;
00023
00024 import com.realtime.crossfire.jxclient.gui.commandlist.CommandList;
00025 import org.jetbrains.annotations.NotNull;
00026 import org.jetbrains.annotations.Nullable;
00027
00034 public abstract class KeyBinding {
00035
00039 @NotNull
00040 private final CommandList commands;
00041
00046 private final boolean isDefault;
00047
00052 @NotNull
00053 public CommandList getCommands() {
00054 return commands;
00055 }
00056
00063 protected KeyBinding(@NotNull final CommandList commands, final boolean isDefault) {
00064 this.commands = commands;
00065 this.isDefault = isDefault;
00066 }
00067
00071 @Override
00072 public abstract boolean equals(@Nullable final Object obj);
00073
00077 @Override
00078 public abstract int hashCode();
00079
00086 public abstract boolean matchesKeyCode(final int keyCode, final int modifiers);
00087
00093 public abstract boolean matchesKeyChar(final char keyChar);
00094
00099 public abstract String getBindingDescription();
00100
00105 @NotNull
00106 public String getCommandString() {
00107 return commands.getCommandString();
00108 }
00109
00115 public boolean isDefault() {
00116 return isDefault;
00117 }
00118
00119 }