00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 package com.realtime.crossfire.jxclient.gui.commands;
00023
00024 import com.realtime.crossfire.jxclient.gui.commandlist.GUICommand;
00025 import com.realtime.crossfire.jxclient.gui.scrollable.GUIScrollable;
00026 import org.jetbrains.annotations.NotNull;
00027
00032 public class ScrollListCommand implements GUICommand {
00033
00037 @NotNull
00038 private final GUIScrollable list;
00039
00043 private final int distance;
00044
00050 public ScrollListCommand(@NotNull final GUIScrollable list, final int distance) {
00051 this.list = list;
00052 this.distance = distance;
00053 }
00054
00058 @Override
00059 public boolean canExecute() {
00060 return list.canScroll(distance);
00061 }
00062
00066 @Override
00067 public void execute() {
00068 list.scroll(distance);
00069 }
00070
00071 }