aima.gui.framework
Class AgentAppController

java.lang.Object
  extended by aima.gui.framework.AgentAppController
All Implemented Interfaces:
AgentAppFrame.Controller
Direct Known Subclasses:
AbstractMapAgentController, VacuumAppDemo.VacuumController

public class AgentAppController
extends java.lang.Object
implements AgentAppFrame.Controller

Simple controller implementation which extends its base class by maintaining references to frame and model, and by simple demo implementations of the required three abstract methods.


Field Summary
protected  AgentAppFrame frame
           
protected  AgentAppModel model
           
 
Constructor Summary
AgentAppController()
           
 
Method Summary
 void clearAgent()
          The associated AgentAppFrame calls this method when the clear button is pressed.
 void prepareAgent()
          The associated AgentAppFrame calls this method when the prepare button is pressed, the selection state of the selectors changes, and also when the run button is pressed without previously performed preparation.
 void runAgent()
          The associated AgentAppFrame calls this method when the run button is activated.
 void setFrame(AgentAppFrame frame)
          Gives the controller access to the frame.
 void setModel(AgentAppModel model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

frame

protected AgentAppFrame frame

model

protected AgentAppModel model
Constructor Detail

AgentAppController

public AgentAppController()
Method Detail

setFrame

public void setFrame(AgentAppFrame frame)
Gives the controller access to the frame. This is useful to display status information.


setModel

public void setModel(AgentAppModel model)

clearAgent

public void clearAgent()
The associated AgentAppFrame calls this method when the clear button is pressed.

Specified by:
clearAgent in interface AgentAppFrame.Controller

prepareAgent

public void prepareAgent()
The associated AgentAppFrame calls this method when the prepare button is pressed, the selection state of the selectors changes, and also when the run button is pressed without previously performed preparation.

Specified by:
prepareAgent in interface AgentAppFrame.Controller

runAgent

public void runAgent()
The associated AgentAppFrame calls this method when the run button is activated. This code runs in a second thread, which can be stopped by the GUI at any time.

Specified by:
runAgent in interface AgentAppFrame.Controller