Package edu.tufts.hrilab.simspeech.gui
Class ChatAdapter
java.lang.Object
edu.tufts.hrilab.gui.GuiAdapter
edu.tufts.hrilab.simspeech.gui.ChatAdapter
A WebSocket adapter for communication between DIARC and the frontend
Chat Viewer GUI.
-
Field Summary
Fields inherited from class edu.tufts.hrilab.gui.GuiAdapter
groups, log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEnforce implementation of path root getter forgetPath().protected voidhandleMessage(com.google.gson.JsonObject message) Handle a message from the client.protected voidinit()Initialization after construction and after TRADE services are registered.voidpopulateDiarcAgents(ai.thinkingrobots.trade.TRADEServiceInfo service) Callback to send names to the frontend when the DIARC agents join.protected booleanForce implementing classes to declare whether they provide TRADE services.voidregisterDialogue(ai.thinkingrobots.trade.TRADEServiceInfo service) Callback to register for dialogue history notifications when Dialogue is up.voidsendUtterance(Utterance utterance) Sends a message to the chat window.Methods inherited from class edu.tufts.hrilab.gui.GuiAdapter
createAndRegisterInstance, getPath, sendMessage
-
Constructor Details
-
ChatAdapter
Constructor.
-
-
Method Details
-
populateDiarcAgents
public void populateDiarcAgents(ai.thinkingrobots.trade.TRADEServiceInfo service) Callback to send names to the frontend when the DIARC agents join. This is a helper method in case we need to register for notifications.- Parameters:
service- thegetDiarcAgents()TRADE service, provided by the notifier.
-
registerDialogue
public void registerDialogue(ai.thinkingrobots.trade.TRADEServiceInfo service) throws ai.thinkingrobots.trade.TRADEException Callback to register for dialogue history notifications when Dialogue is up. This is a helper method in case we need to register for notifications for the Dialogue notifications.- Parameters:
service- requested service- Throws:
ai.thinkingrobots.trade.TRADEException- if the TRADE service call fails.
-
sendUtterance
Sends a message to the chat window.- Parameters:
utterance- what the robot is saying.
-
init
protected void init()Initialization after construction and after TRADE services are registered.- Overrides:
initin classGuiAdapter
-
providesTradeServices
protected boolean providesTradeServices()Force implementing classes to declare whether they provide TRADE services. This is to decide whether or not to register any new instances of that class with TRADE.- Specified by:
providesTradeServicesin classGuiAdapter- Returns:
- true iff the adapter provides TRADE services.
-
getPathRoot
Enforce implementation of path root getter forgetPath(). This is usually based on the component's/adapter's name; e.g., the belief GUI's path root isbelief.- Specified by:
getPathRootin classGuiAdapter- Returns:
- the path root as a
String.
-
handleMessage
protected void handleMessage(com.google.gson.JsonObject message) Handle a message from the client.- Overrides:
handleMessagein classGuiAdapter- Parameters:
message- a JsonObject representing the message.
-