agentland.gui.tools
Class GuiAskerMaker

java.lang.Object
  |
  +--agentland.gui.GuiMaker
        |
        +--agentland.gui.tools.GuiAskerMaker
All Implemented Interfaces:
GuiElement, Serializable

public class GuiAskerMaker
extends GuiMaker

See Also:
Serialized Form

Field Summary
protected  boolean actOnTimeout
           
protected  Font aFont
           
protected  JTextField answer
           
protected static int CHOICE
           
protected  Object defaultAnswer
           
protected static int FREE
           
protected  Vector options
           
protected  Font qFont
           
protected  Question qObject
           
protected  int qType
           
protected  String question
           
protected static int TRUE_FALSE
           
 
Fields inherited from class agentland.gui.GuiMaker
container, family, familyClassName, familyName, host, name, parent, visible
 
Constructor Summary
GuiAskerMaker(AgentID parent, Question q)
           
GuiAskerMaker(AgentID parent, String question, int type)
           
GuiAskerMaker(AgentID parent, String question, Object defaultAnswer, int type)
           
GuiAskerMaker(AgentID parent, String question, Vector options)
           
 
Method Summary
 boolean equals(Object o)
           
 Container getGui()
          Has to be overriden by children; this is where you produce the object to be displayed.
 void init()
          This method gets called when the GuiMaker arrives at the GuiManager and can start connecting itself to the rest of the world.
 void installed()
          Called when the container element is first installed by its owning family (so it can do things like have sub- components request focus.)
protected  void makeChoiceGui(JPanel panel)
          Make a multiple-choice gui
protected  void makeFreeGui(JPanel panel)
          Make a free response gui
protected  void makeTFGui(JPanel panel)
          Make a True/False (Maybe) gui
protected  void sendAnswer(Object answer)
          Process the answer (i.e.
protected  void stopTimer()
           
 void tell(Secret secret)
          Allows the gui to receive secrets from the outside world
protected  void underVerification()
           
protected  void verify(FreeResponseQuestion q)
           
protected  void wait(int seconds)
           
 
Methods inherited from class agentland.gui.GuiMaker
addSpy, getContainer, getFamily, getFamilyObject, getName, getParent, hashCode, hideMe, killMe, log, log, log, notify, reliesOn, reliesOn, setFamily, setFamilyClass, setHost, setName, setParent, showMe, toString, visible
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

question

protected String question

options

protected Vector options

qType

protected int qType

defaultAnswer

protected Object defaultAnswer

qObject

protected Question qObject

actOnTimeout

protected boolean actOnTimeout

TRUE_FALSE

protected static final int TRUE_FALSE

FREE

protected static final int FREE

CHOICE

protected static final int CHOICE

answer

protected JTextField answer

qFont

protected Font qFont

aFont

protected Font aFont
Constructor Detail

GuiAskerMaker

public GuiAskerMaker(AgentID parent,
                     Question q)

GuiAskerMaker

public GuiAskerMaker(AgentID parent,
                     String question,
                     int type)

GuiAskerMaker

public GuiAskerMaker(AgentID parent,
                     String question,
                     Object defaultAnswer,
                     int type)

GuiAskerMaker

public GuiAskerMaker(AgentID parent,
                     String question,
                     Vector options)
Method Detail

init

public void init()
Description copied from class: GuiMaker
This method gets called when the GuiMaker arrives at the GuiManager and can start connecting itself to the rest of the world. You should override this method and do all of your reliesOn and spy adding, etc, in here.
Overrides:
init in class GuiMaker

tell

public void tell(Secret secret)
Description copied from class: GuiMaker
Allows the gui to receive secrets from the outside world
Overrides:
tell in class GuiMaker
Following copied from class: agentland.gui.GuiMaker
Parameters:
secret - a Secret value

getGui

public Container getGui()
Description copied from class: GuiMaker
Has to be overriden by children; this is where you produce the object to be displayed. You produce it in the vm of the GuiManger -- that way we avoid all the serialization issues with graphical elements in Java.
Overrides:
getGui in class GuiMaker
Following copied from class: agentland.gui.GuiMaker
Returns:
something that can be displayed in a frame

installed

public void installed()
Description copied from class: GuiMaker
Called when the container element is first installed by its owning family (so it can do things like have sub- components request focus.)
Overrides:
installed in class GuiMaker

makeChoiceGui

protected void makeChoiceGui(JPanel panel)
Make a multiple-choice gui
Parameters:
panel - the panel gui should be added to

makeFreeGui

protected void makeFreeGui(JPanel panel)
Make a free response gui
Parameters:
panel - the panel gui should be added to

stopTimer

protected void stopTimer()

wait

protected void wait(int seconds)

verify

protected void verify(FreeResponseQuestion q)

underVerification

protected void underVerification()

makeTFGui

protected void makeTFGui(JPanel panel)
Make a True/False (Maybe) gui
Parameters:
panel - the panel gui should be added to

sendAnswer

protected void sendAnswer(Object answer)
Process the answer (i.e. send an appropriate notification)

equals

public boolean equals(Object o)
Overrides:
equals in class GuiMaker