java.lang.Object
com.realtime.crossfire.jxclient.shortcuts.Shortcut

public class Shortcut extends Object
Abstract base class for shortcut commands.
  • Constructor Details

    • Shortcut

      public Shortcut(@NotNull @NotNull String command, @Nullable @Nullable Spell spell)
      Creates a new instance.
      Parameters:
      command - the command to execute
      spell - the spell associated with the command or null is the command is not a spell related command or if the spell is unknown
  • Method Details

    • getCommand

      @NotNull public @NotNull String getCommand()
      Returns the command to execute.
      Returns:
      the command
    • getSpell

      @Nullable public @Nullable Spell 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
    • dispose

      public void dispose()
      Releases all allocated resources.
    • addShortcutListener

      public void addShortcutListener(@NotNull @NotNull ShortcutListener listener)
      Registers a shortcut listener.
      Parameters:
      listener - the listener to register
    • removeShortcutListener

      public void removeShortcutListener(@NotNull @NotNull ShortcutListener listener)
      Unregisters a shortcut listener.
      Parameters:
      listener - the listener to unregister
    • getTooltipText

      @NotNull public @NotNull String getTooltipText()
      Returns the current tooltip text.
      Returns:
      the tooltip text
    • displaysFace

      public boolean displaysFace(@NotNull @NotNull Face face)
      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:
      true to execute immediately or false to only activate
    • toggleImmediate

      public void toggleImmediate()
      Toggles between immediate execution and activation only. Does nothing for other commands.