Class ScrollCommand

java.lang.Object
com.realtime.crossfire.jxclient.gui.commands.ScrollCommand
All Implemented Interfaces:
GUICommand

public class ScrollCommand extends Object implements GUICommand
A GUICommand which scrolls a GUIScrollable gui element by a given distance.
  • Constructor Details

    • ScrollCommand

      public ScrollCommand(int distance, @NotNull @NotNull GUIScrollable scrollable)
      Creates a new instance.
      Parameters:
      distance - the distance to scroll
      scrollable - the scrollable element
  • Method Details

    • canExecute

      public boolean canExecute()
      Description copied from interface: GUICommand
      Returns whether this command may be executed.
      Specified by:
      canExecute in interface GUICommand
      Returns:
      whether this command may be executed
    • execute

      public void execute()
      Description copied from interface: GUICommand
      Executes the command. Does nothing if called while GUICommand.canExecute() returns false.
      Specified by:
      execute in interface GUICommand