Class Shortcut
java.lang.Object
com.realtime.crossfire.jxclient.shortcuts.Shortcut
Abstract base class for shortcut commands.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddShortcutListener(@NotNull ShortcutListener listener) Registers a shortcut listener.booleandisplaysFace(@NotNull Face face) Returns whether this shortcut displays the given face.voiddispose()Releases all allocated resources.@NotNull StringReturns the command to execute.@Nullable SpellgetSpell()Returns the associated spell to cast.@NotNull StringReturns the current tooltip text.booleanReturns whether the command should be executed immediately.voidremoveShortcutListener(@NotNull ShortcutListener listener) Unregisters a shortcut listener.voidToggles between immediate execution and activation only.
-
Constructor Details
-
Shortcut
Creates a new instance.- Parameters:
command- the command to executespell- the spell associated with the command ornullis the command is not a spell related command or if the spell is unknown
-
-
Method Details
-
getCommand
Returns the command to execute.- Returns:
- the command
-
getSpell
Returns the associated spell to cast.- Returns:
- the spell or
nullif the command is not a spell related command or if the spell is unknown
-
dispose
public void dispose()Releases all allocated resources. -
addShortcutListener
Registers a shortcut listener.- Parameters:
listener- the listener to register
-
removeShortcutListener
Unregisters a shortcut listener.- Parameters:
listener- the listener to unregister
-
getTooltipText
Returns the current tooltip text.- Returns:
- the tooltip text
-
displaysFace
Returns whether this shortcut displays the given face.- Parameters:
face- the face to check for- Returns:
- whether the face is displayed
-
isImmediate
public boolean isImmediate()Returns whether the command should be executed immediately.- Returns:
trueto execute immediately orfalseto only activate
-
toggleImmediate
public void toggleImmediate()Toggles between immediate execution and activation only. Does nothing for other commands.
-