public class ScrollCommand extends java.lang.Object implements GUICommand
GUICommand
which scrolls a GUIScrollable
gui element by a
given distance.Modifier and Type | Field and Description |
---|---|
private int |
distance
The distance to scroll.
|
private GUIScrollable |
scrollable
The scrollable element.
|
Constructor and Description |
---|
ScrollCommand(int distance,
GUIScrollable scrollable)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canExecute()
Returns whether this command may be executed.
|
void |
execute()
Executes the command.
|
private final int distance
@NotNull private final GUIScrollable scrollable
public ScrollCommand(int distance, @NotNull GUIScrollable scrollable)
distance
- the distance to scrollscrollable
- the scrollable elementpublic boolean canExecute()
canExecute
in interface GUICommand
public void execute()
GUICommand.canExecute()
returns false
.execute
in interface GUICommand