Class VroombaRunner

java.lang.Object
  extended by VroombaRunner
All Implemented Interfaces:
ActionListener, EventListener, ChangeListener

public class VroombaRunner
extends Object
implements ActionListener, ChangeListener

Tests Vroomba objects. Can run in GUI or console mode.

Version:
08 Nov 2008
Author:
Zach Tomaszewski

Constructor Summary
VroombaRunner()
          Builds a GUI window with two panes: a Room on the left and controls/output on the right.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Invoked whenever a component is selected that has this registered as its ActionListener.
 void clean()
          Runs the cleaning animation for this Room.
 void loadNewRoom()
          Loads a new Room from a user-selected file into the leftPane of the window.
static void main(String[] args)
          Determines whether to run in text or GUI mode.
protected  void refreshRoom()
          Refreshes the GUI by clearing the output panel and reloading the last file loaded.
 void stateChanged(ChangeEvent e)
          Listens for changes in the GUI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VroombaRunner

public VroombaRunner()
Builds a GUI window with two panes: a Room on the left and controls/output on the right.

Method Detail

main

public static void main(String[] args)
Determines whether to run in text or GUI mode. If in text-mode, loads the command-line specified file and prints output. Otherwise, starts up GUI.


actionPerformed

public void actionPerformed(ActionEvent ae)
Invoked whenever a component is selected that has this registered as its ActionListener.

Specified by:
actionPerformed in interface ActionListener

stateChanged

public void stateChanged(ChangeEvent e)
Listens for changes in the GUI. (Currently, only the animation slider fires such events, as everything else fires ActionEvents instead.)

Specified by:
stateChanged in interface ChangeListener

clean

public void clean()
Runs the cleaning animation for this Room.


loadNewRoom

public void loadNewRoom()
Loads a new Room from a user-selected file into the leftPane of the window.


refreshRoom

protected void refreshRoom()
Refreshes the GUI by clearing the output panel and reloading the last file loaded.