brain.alice
Class AliceBasedInterface

java.lang.Object
  extended by java.lang.Thread
      extended by biocell.BioThread
          extended by nns.BioSensor
              extended by brain.alice.AliceBasedInterface
All Implemented Interfaces:
BioDevice, java.lang.Runnable, java.util.EventListener, MNSListener

public class AliceBasedInterface
extends BioSensor

Author:
martin

Nested Class Summary
 class AliceBasedInterface.ConsoleDisplayStream
          Extends OutputStream to direct all output to the display textarea.
 class AliceBasedInterface.ConsoleInputStream
           
 class AliceBasedInterface.ConsolePromptStream
          Extends OutputStream to direct all output to the prompt field.
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  AliceServer server
          The server associated with this console.
protected  Shell shell
          The Shell used by this console.
 
Fields inherited from class nns.BioSensor
EXTERO_SENSOR, INTERO_SENSOR, PROPRIO_SENSOR
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface biocell.BioDevice
BLOCKED, BUSY, CYCLING, DONE, END, PAUSED, RESUMED, START, WAIT
 
Constructor Summary
AliceBasedInterface(javax.swing.JTextArea display, RobotClientListener listener)
           
AliceBasedInterface(RobotClientListener listener)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent ae)
           
 void addDisplay(javax.swing.JTextArea display)
           
 java.lang.String getMood()
           
 boolean isActive()
           
 void process(MNSEvent cnv)
          loads a CNSEvent into a listener
 void run()
           
 void sensorPercieved(BioSensorEvent event)
           
 void setActive(boolean active)
           
 void setMood(int who, java.lang.String whoo)
           
 void setMood(java.lang.String mood)
           
protected  void shutdown()
           
 
Methods inherited from class nns.BioSensor
addListener, addListener, addSensorListener, geState, getControls, getCurrentPosition, getCurrentState, getListener, getname, getType, load, loadCNTR, seState, setListener, setname, setType
 
Methods inherited from class biocell.BioThread
getCurrentmood, getMoodParam, getstate, stepEnergy
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

server

protected AliceServer server
The server associated with this console.


shell

protected Shell shell
The Shell used by this console.

Constructor Detail

AliceBasedInterface

public AliceBasedInterface(javax.swing.JTextArea display,
                           RobotClientListener listener)

AliceBasedInterface

public AliceBasedInterface(RobotClientListener listener)
Method Detail

sensorPercieved

public void sensorPercieved(BioSensorEvent event)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent ae)

process

public void process(MNSEvent cnv)
Description copied from interface: MNSListener
loads a CNSEvent into a listener

Specified by:
process in interface MNSListener
Overrides:
process in class BioSensor

addDisplay

public void addDisplay(javax.swing.JTextArea display)

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutdown

protected void shutdown()

isActive

public boolean isActive()
Returns:
Returns the active.

setActive

public void setActive(boolean active)
Parameters:
active - The active to set.

getMood

public java.lang.String getMood()
Returns:
Returns the mood.

setMood

public void setMood(java.lang.String mood)
Overrides:
setMood in class BioThread
Parameters:
mood - The mood to set.

setMood

public void setMood(int who,
                    java.lang.String whoo)