stella.jview
Class DeviceSimulator.SimulationHandler

java.lang.Object
  extended by java.lang.Thread
      extended by stella.jview.DeviceSimulator.SimulationHandler
All Implemented Interfaces:
ActionListener, Runnable, EventListener
Enclosing class:
DeviceSimulator

protected class DeviceSimulator.SimulationHandler
extends Thread
implements ActionListener

A thread that takes over the handling of the incomming command in the device simulator. First, the command received is displayed in the status field. The initial acknowledge event is sent back according to the values found in the appropriate fields. Any further acknowledge, done, or error event is generated and sent back only at user input (pressing of the appropriate button).


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
private  int acktype
           
private  boolean cancel
           
private  CommandEvent last
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
protected DeviceSimulator.SimulationHandler()
          Constructs a new simulator-handler thread.
 
Method Summary
 void actionPerformed(ActionEvent ae)
          Receives button presses.
 void cancel()
          Cancels this thread.
private  void gotCommand(CommandEvent cmd)
          Call this method with a new command received.
 void run()
          The run method.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

last

private CommandEvent last

acktype

private int acktype

cancel

private boolean cancel
Constructor Detail

DeviceSimulator.SimulationHandler

protected DeviceSimulator.SimulationHandler()
Constructs a new simulator-handler thread. Registers itself as an action listener at the acknowledge, done, and error button of the simulator.

Method Detail

run

public void run()
The run method. Loops forever.

Specified by:
run in interface Runnable
Overrides:
run in class Thread

cancel

public void cancel()
Cancels this thread.


gotCommand

private void gotCommand(CommandEvent cmd)
Call this method with a new command received. If the last command has not been completed, a final successful done event is generated and sent back to the listeners before processing the new command.


actionPerformed

public void actionPerformed(ActionEvent ae)
Receives button presses.

Specified by:
actionPerformed in interface ActionListener