com.realtime.crossfire.jxclient.gui.commands
Class MoveSelectionCommand

java.lang.Object
  extended by com.realtime.crossfire.jxclient.gui.commands.MoveSelectionCommand
All Implemented Interfaces:
GUICommand

public class MoveSelectionCommand
extends java.lang.Object
implements GUICommand

A GUICommand which moves the selected element in a GUIList element.


Field Summary
private  int diffElements
          The distance in elements to scroll.
private  int diffLines
          The distance in lines to scroll.
private  GUIList list
          The list to scroll.
 
Constructor Summary
MoveSelectionCommand(GUIList list, int diffLines, int diffElements)
          Creates a new instance.
 
Method Summary
 boolean canExecute()
          Returns whether this command may be executed.
 void execute()
          Executes the command.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

diffElements

private final int diffElements
The distance in elements to scroll.


diffLines

private final int diffLines
The distance in lines to scroll.


list

@NotNull
private final GUIList list
The list to scroll.

Constructor Detail

MoveSelectionCommand

public MoveSelectionCommand(@NotNull
                            GUIList list,
                            int diffLines,
                            int diffElements)
Creates a new instance.

Parameters:
list - the list to scroll
diffLines - the distance in lines to scroll
diffElements - the distance in elements to scroll
Method Detail

canExecute

public boolean canExecute()
Returns whether this command may be executed.

Specified by:
canExecute in interface GUICommand
Returns:
whether this command may be executed

execute

public void execute()
Executes the command. Does nothing if called while GUICommand.canExecute() returns false.

Specified by:
execute in interface GUICommand