Crossfire JXClient, Trunk
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager Class Reference
Collaboration diagram for com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager:
Collaboration graph

Public Member Functions

boolean createKeyBinding (final boolean perCharacter, @NotNull final CommandList cmdList)
 
boolean escPressed ()
 
Map< KeyBinding, String > getBindings (@NotNull final Predicate< KeyBinding > predicate)
 
boolean handleKeyPress (@NotNull final KeyEvent2 e)
 
 KeybindingsManager (@NotNull final Path keybindingsFileVersion2, @NotNull final Path keybindingsFileVersion1, @NotNull final GUICommandFactory guiCommandFactory)
 
boolean keyPressed (@NotNull final KeyEvent2 keyEvent)
 
boolean keyReleased ()
 
void loadGlobalKeybindings ()
 
void loadPerCharacterBindings (@NotNull final CharSequence hostname, @NotNull final CharSequence character)
 
boolean removeKeyBinding (final boolean perCharacter)
 
void saveGlobalKeybindings ()
 
void setDefaultKeyBindings (@NotNull final KeyBindings defaultKeyBindings)
 
void unloadPerCharacterBindings ()
 
boolean windowClosing ()
 

Static Public Attributes

static final String CHARACTER = "c"
 
static final String DEFAULT = "d"
 
static final String GLOBAL = "g"
 

Private Member Functions

KeyBindings getKeyBindings (final boolean perCharacter)
 

Private Attributes

KeyBindings characterKeyBindings
 
KeyBindings defaultKeyBindings
 
final KeyBindings globalKeyBindings
 
final GUICommandFactory guiCommandFactory
 
KeyBindingState keyBindingState
 

Detailed Description

Manages key bindings.

Author
Andreas Kirschbaum

Definition at line 40 of file KeybindingsManager.java.

Constructor & Destructor Documentation

◆ KeybindingsManager()

com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.KeybindingsManager ( @NotNull final Path  keybindingsFileVersion2,
@NotNull final Path  keybindingsFileVersion1,
@NotNull final GUICommandFactory  guiCommandFactory 
)

Creates a new instance.

Parameters
keybindingsFileVersion2the global keybindings file
keybindingsFileVersion1the global fallback keybindings file
guiCommandFactorythe gui command factory for creating commands

Definition at line 99 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.guiCommandFactory.

Member Function Documentation

◆ createKeyBinding()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.createKeyBinding ( final boolean  perCharacter,
@NotNull final CommandList  cmdList 
)

Starts creating a new key binding.

Parameters
perCharacterwhether a per-character key bindings should be created
cmdListthe commands for the key binding
Returns
whether the key bindings dialog should be opened

Definition at line 147 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.getKeyBindings(), and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.createKeyBinding().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ escPressed()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.escPressed ( )

Processes a pressed ESC key.

Returns
whether the event has been consumed and the key bindings dialog should be closed

Definition at line 248 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.escPressed().

Here is the caller graph for this function:

◆ getBindings()

Map<KeyBinding, String> com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.getBindings ( @NotNull final Predicate< KeyBinding predicate)

◆ getKeyBindings()

KeyBindings com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.getKeyBindings ( final boolean  perCharacter)
private

Returns the active key bindings.

Parameters
perCharacterif set, return the per-character key bindings; else return the global bindings
Returns
the key bindings or
null
if no per-character bindings exist because no character is logged in

Definition at line 165 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.characterKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings.

Referenced by com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.createKeyBinding().

Here is the caller graph for this function:

◆ handleKeyPress()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.handleKeyPress ( @NotNull final KeyEvent2  e)

◆ keyPressed()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyPressed ( @NotNull final KeyEvent2  keyEvent)

Processes a key pressed event.

Parameters
keyEventthe key event
Returns
whether the event has been consumed

Definition at line 234 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState, and com.realtime.crossfire.jxclient.gui.keybindings.KeyBindingState.keyPressed().

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyPress().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ keyReleased()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyReleased ( )

Processes a key released event.

Returns
whether the event has been consumed

Definition at line 216 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState, and com.realtime.crossfire.jxclient.gui.keybindings.KeyBindingState.keyReleased().

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.handleKeyRelease().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadGlobalKeybindings()

void com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.loadGlobalKeybindings ( )

Loads the global key bindings from the backing file.

Definition at line 208 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings.loadKeyBindings().

Referenced by com.realtime.crossfire.jxclient.main.JXClient.JXClient().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadPerCharacterBindings()

void com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.loadPerCharacterBindings ( @NotNull final CharSequence  hostname,
@NotNull final CharSequence  character 
)

◆ removeKeyBinding()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.removeKeyBinding ( final boolean  perCharacter)

Starts to remove a key binding.

Parameters
perCharacterwhether a per-character key binding should be removed
Returns
whether the key bindings dialog should be opened

Definition at line 118 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.characterKeyBindings, com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.removeKeyBinding().

Here is the caller graph for this function:

◆ saveGlobalKeybindings()

void com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.saveGlobalKeybindings ( )

Saves the global key bindings to the backing file.

Definition at line 201 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings.saveKeyBindings().

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.term().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDefaultKeyBindings()

void com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.setDefaultKeyBindings ( @NotNull final KeyBindings  defaultKeyBindings)

Sets the default KeyBindings of the currently active skin.

Parameters
defaultKeyBindingsthe default key bindings

Definition at line 108 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.defaultKeyBindings.

Referenced by com.realtime.crossfire.jxclient.window.KeyHandler.setDefaultKeyBindings().

Here is the caller graph for this function:

◆ unloadPerCharacterBindings()

void com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.unloadPerCharacterBindings ( )

Unloads (clears and saves) the per-character key bindings. This function should be called when a character logs out.

Definition at line 191 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.characterKeyBindings, and com.realtime.crossfire.jxclient.gui.keybindings.KeyBindings.saveKeyBindings().

Referenced by com.realtime.crossfire.jxclient.window.JXCConnection.setCharacter().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ windowClosing()

boolean com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.windowClosing ( )

Should be called when the main window is closing.

Returns
whether the key bindings dialog should be closed

Definition at line 131 of file KeybindingsManager.java.

References com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState.

Referenced by com.realtime.crossfire.jxclient.window.GuiManager.openQuitDialog().

Here is the caller graph for this function:

Member Data Documentation

◆ CHARACTER

final String com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.CHARACTER = "c"
static

The source identification string for per-character key bindings.

Definition at line 58 of file KeybindingsManager.java.

Referenced by com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.getBindings(), and com.realtime.crossfire.jxclient.commands.BindingsCommand.getHelp().

◆ characterKeyBindings

KeyBindings com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.characterKeyBindings
private

◆ DEFAULT

final String com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.DEFAULT = "d"
static

◆ defaultKeyBindings

KeyBindings com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.defaultKeyBindings
private

◆ GLOBAL

final String com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.GLOBAL = "g"
static

◆ globalKeyBindings

final KeyBindings com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.globalKeyBindings
private

◆ guiCommandFactory

final GUICommandFactory com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.guiCommandFactory
private

◆ keyBindingState

KeyBindingState com.realtime.crossfire.jxclient.gui.keybindings.KeybindingsManager.keyBindingState
private

The documentation for this class was generated from the following file: