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

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

public class ScrollNextCommand
extends java.lang.Object
implements GUICommand

A GUICommand which transfers the focus between two gui elements.


Field Summary
private  boolean apply
          Whether nextElement should be applied.
private  ActivatableGUIElement nextElement
          The element to activate.
private  ActivatableGUIElement prevElement
          The element to deactivate.
 
Constructor Summary
ScrollNextCommand(ActivatableGUIElement nextElement, ActivatableGUIElement prevElement, boolean apply)
          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

apply

private final boolean apply
Whether nextElement should be applied.


nextElement

@NotNull
private final ActivatableGUIElement nextElement
The element to activate.


prevElement

@NotNull
private final ActivatableGUIElement prevElement
The element to deactivate.

Constructor Detail

ScrollNextCommand

public ScrollNextCommand(@NotNull
                         ActivatableGUIElement nextElement,
                         @NotNull
                         ActivatableGUIElement prevElement,
                         boolean apply)
Creates a new instance.

Parameters:
nextElement - the element to activate
prevElement - the element to deactivate
apply - whether nextElement should be applied
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