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

Public Member Functions

void addShortcutListener (@NotNull final ShortcutListener listener)
 
boolean displaysFace (@NotNull final Face face)
 
void dispose ()
 
String getCommand ()
 
Spell getSpell ()
 
String getTooltipText ()
 
boolean isImmediate ()
 
void removeShortcutListener (@NotNull final ShortcutListener listener)
 
 Shortcut (@NotNull final String command, @Nullable final Spell spell)
 
void toggleImmediate ()
 

Private Member Functions

void fireModifiedEvent ()
 

Private Attributes

String command
 
final EventListenerList2< ShortcutListenerlisteners = new EventListenerList2<>()
 
final Spell spell
 

Detailed Description

Abstract base class for shortcut commands.

Author
Andreas Kirschbaum

Definition at line 35 of file Shortcut.java.

Constructor & Destructor Documentation

◆ Shortcut()

com.realtime.crossfire.jxclient.shortcuts.Shortcut.Shortcut ( @NotNull final String  command,
@Nullable final Spell  spell 
)

Creates a new instance.

Parameters
commandthe command to execute
spellthe spell associated with the command or
null
is the command is not a spell related command or if the spell is unknown

Definition at line 62 of file Shortcut.java.

References com.realtime.crossfire.jxclient.spells.Spell.addSpellListener(), com.realtime.crossfire.jxclient.shortcuts.Shortcut.command, and com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell.

Here is the call graph for this function:

Member Function Documentation

◆ addShortcutListener()

void com.realtime.crossfire.jxclient.shortcuts.Shortcut.addShortcutListener ( @NotNull final ShortcutListener  listener)

Registers a shortcut listener.

Parameters
listenerthe listener to register

Definition at line 103 of file Shortcut.java.

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

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

Here is the caller graph for this function:

◆ displaysFace()

boolean com.realtime.crossfire.jxclient.shortcuts.Shortcut.displaysFace ( @NotNull final Face  face)

Returns whether this shortcut displays the given face.

Parameters
facethe face to check for
Returns
whether the face is displayed

Definition at line 141 of file Shortcut.java.

References com.realtime.crossfire.jxclient.spells.Spell.getFaceNum(), and com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell.

Here is the call graph for this function:

◆ dispose()

void com.realtime.crossfire.jxclient.shortcuts.Shortcut.dispose ( )

Releases all allocated resources.

Definition at line 93 of file Shortcut.java.

References com.realtime.crossfire.jxclient.spells.Spell.removeSpellListener(), and com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell.

Referenced by com.realtime.crossfire.jxclient.shortcuts.Shortcuts.clearShortcuts(), and com.realtime.crossfire.jxclient.shortcuts.Shortcuts.setShortcutString().

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

◆ fireModifiedEvent()

void com.realtime.crossfire.jxclient.shortcuts.Shortcut.fireModifiedEvent ( )
private

Notifies all listeners about a modification.

Definition at line 118 of file Shortcut.java.

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

Referenced by com.realtime.crossfire.jxclient.shortcuts.Shortcut.toggleImmediate().

Here is the caller graph for this function:

◆ getCommand()

String com.realtime.crossfire.jxclient.shortcuts.Shortcut.getCommand ( )

Returns the command to execute.

Returns
the command

Definition at line 76 of file Shortcut.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcut.command.

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button1Clicked(), and com.realtime.crossfire.jxclient.commands.ShortcutCommand.listSlots().

Here is the caller graph for this function:

◆ getSpell()

Spell com.realtime.crossfire.jxclient.shortcuts.Shortcut.getSpell ( )

Returns the associated spell to cast.

Returns
the spell or
null
if the command is not a spell related command or if the spell is unknown

Definition at line 86 of file Shortcut.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell.

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

Here is the caller graph for this function:

◆ getTooltipText()

String com.realtime.crossfire.jxclient.shortcuts.Shortcut.getTooltipText ( )

Returns the current tooltip text.

Returns
the tooltip text

Definition at line 129 of file Shortcut.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcut.command, com.realtime.crossfire.jxclient.spells.Spell.getTooltipText(), and com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell.

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

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

◆ isImmediate()

boolean com.realtime.crossfire.jxclient.shortcuts.Shortcut.isImmediate ( )

Returns whether the command should be executed immediately.

Returns
true
to execute immediately or
false
to only activate

Definition at line 150 of file Shortcut.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcut.command.

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

Here is the caller graph for this function:

◆ removeShortcutListener()

void com.realtime.crossfire.jxclient.shortcuts.Shortcut.removeShortcutListener ( @NotNull final ShortcutListener  listener)

Unregisters a shortcut listener.

Parameters
listenerthe listener to unregister

Definition at line 111 of file Shortcut.java.

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

◆ toggleImmediate()

void com.realtime.crossfire.jxclient.shortcuts.Shortcut.toggleImmediate ( )

Toggles between immediate execution and activation only. Does nothing for other commands.

Definition at line 158 of file Shortcut.java.

References com.realtime.crossfire.jxclient.shortcuts.Shortcut.command, and com.realtime.crossfire.jxclient.shortcuts.Shortcut.fireModifiedEvent().

Referenced by com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button1Clicked(), and com.realtime.crossfire.jxclient.gui.item.GUIItemShortcut.button2Clicked().

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

Member Data Documentation

◆ command

String com.realtime.crossfire.jxclient.shortcuts.Shortcut.command
private

◆ listeners

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

◆ spell

final Spell com.realtime.crossfire.jxclient.shortcuts.Shortcut.spell
private

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