Crossfire JXClient, Trunk
Public Member Functions | Private Attributes | List of all members
com.realtime.crossfire.jxclient.shortcuts.Shortcuts Class Reference
Inheritance diagram for com.realtime.crossfire.jxclient.shortcuts.Shortcuts:
Inheritance graph
Collaboration diagram for com.realtime.crossfire.jxclient.shortcuts.Shortcuts:
Collaboration graph

Public Member Functions

void addShortcutsListener (@NotNull final ShortcutsListener listener)
 
void clearShortcuts ()
 
Path getFile ()
 
Shortcut getShortcut (@NotNull final ShortcutSlot shortcutSlot)
 
Iterator< Shortcutiterator ()
 
void removeShortcutsListener (@NotNull final ShortcutsListener listener)
 
void setFile (@Nullable final Path file)
 
void setShortcutString (@NotNull final ShortcutSlot shortcutSlot, @NotNull final String command, final boolean saveChanges)
 
 Shortcuts (@NotNull final SpellsManager spellsManager)
 

Private Attributes

Path file
 
final EventListenerList2< ShortcutsListenerlisteners = new EventListenerList2<>()
 
final Map< ShortcutSlot, Shortcutshortcuts = new EnumMap<>(ShortcutSlot.class)
 
final SpellsManager spellsManager
 
final SpellsManagerListener spellsManagerListener
 

Detailed Description

Manages a list of Shortcuts.

Author
Andreas Kirschbaum

Definition at line 43 of file Shortcuts.java.

Constructor & Destructor Documentation

◆ Shortcuts()

com.realtime.crossfire.jxclient.shortcuts.Shortcuts.Shortcuts ( @NotNull final SpellsManager  spellsManager)

Member Function Documentation

◆ addShortcutsListener()

void com.realtime.crossfire.jxclient.shortcuts.Shortcuts.addShortcutsListener ( @NotNull final ShortcutsListener  listener)

Adds a ShortcutsListener.

Parameters
listenerthe listener to add

Definition at line 180 of file Shortcuts.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcuts.listeners.

◆ clearShortcuts()

void com.realtime.crossfire.jxclient.shortcuts.Shortcuts.clearShortcuts ( )

◆ getFile()

Path com.realtime.crossfire.jxclient.shortcuts.Shortcuts.getFile ( )

Returns the backing file.

Returns
the backing file or
null
if unknown

Definition at line 197 of file Shortcuts.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcuts.file.

◆ getShortcut()

Shortcut com.realtime.crossfire.jxclient.shortcuts.Shortcuts.getShortcut ( @NotNull final ShortcutSlot  shortcutSlot)

Returns a shortcut.

Parameters
shortcutSlotthe shortcut slot
Returns
the shortcut or
null
if the shortcut is unset

Definition at line 133 of file Shortcuts.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcuts.shortcuts.

Referenced by com.realtime.crossfire.jxclient.commands.ShortcutCommand.listSlots().

Here is the caller graph for this function:

◆ iterator()

Iterator<Shortcut> com.realtime.crossfire.jxclient.shortcuts.Shortcuts.iterator ( )

◆ removeShortcutsListener()

void com.realtime.crossfire.jxclient.shortcuts.Shortcuts.removeShortcutsListener ( @NotNull final ShortcutsListener  listener)

Removes a ShortcutsListener.

Parameters
listenerthe listener to remove

Definition at line 188 of file Shortcuts.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcuts.listeners.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.dispose().

Here is the caller graph for this function:

◆ setFile()

void com.realtime.crossfire.jxclient.shortcuts.Shortcuts.setFile ( @Nullable final Path  file)

Sets the backing file.

Parameters
filethe backing file or
null
if unknown

Definition at line 205 of file Shortcuts.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcuts.file.

◆ setShortcutString()

void com.realtime.crossfire.jxclient.shortcuts.Shortcuts.setShortcutString ( @NotNull final ShortcutSlot  shortcutSlot,
@NotNull final String  command,
final boolean  saveChanges 
)

Member Data Documentation

◆ file

Path com.realtime.crossfire.jxclient.shortcuts.Shortcuts.file
private

◆ listeners

final EventListenerList2<ShortcutsListener> com.realtime.crossfire.jxclient.shortcuts.Shortcuts.listeners = new EventListenerList2<>()
private

◆ shortcuts

final Map<ShortcutSlot, Shortcut> com.realtime.crossfire.jxclient.shortcuts.Shortcuts.shortcuts = new EnumMap<>(ShortcutSlot.class)
private

◆ spellsManager

final SpellsManager com.realtime.crossfire.jxclient.shortcuts.Shortcuts.spellsManager
private

◆ spellsManagerListener

final SpellsManagerListener com.realtime.crossfire.jxclient.shortcuts.Shortcuts.spellsManagerListener
private
Initial value:
= new SpellsManagerListener() {
@Override
public void spellAdded(final int index) {
for (final Entry<ShortcutSlot, Shortcut> e : shortcuts.entrySet()) {
final Shortcut shortcut = e.getValue();
if (shortcut != null) {
setShortcutString(e.getKey(), shortcut.getCommand(), false);
}
}
}
@Override
public void spellRemoved(final int index) {
for (final Entry<ShortcutSlot, Shortcut> e : shortcuts.entrySet()) {
final Shortcut shortcut = e.getValue();
if (shortcut != null) {
setShortcutString(e.getKey(), shortcut.getCommand(), false);
}
}
}
}

The SpellsManagerListener used to detect spell changes.

Definition at line 75 of file Shortcuts.java.

Referenced by com.realtime.crossfire.jxclient.shortcuts.Shortcuts.Shortcuts().


The documentation for this class was generated from the following file:
com.realtime.crossfire.jxclient.shortcuts.Shortcuts.shortcuts
final Map< ShortcutSlot, Shortcut > shortcuts
Definition: Shortcuts.java:50
com.realtime.crossfire.jxclient.shortcuts.Shortcuts.setShortcutString
void setShortcutString(@NotNull final ShortcutSlot shortcutSlot, @NotNull final String command, final boolean saveChanges)
Definition: Shortcuts.java:143