Class GoalManagerAdapter

java.lang.Object
edu.tufts.hrilab.gui.GuiAdapter
edu.tufts.hrilab.action.gui.GoalManagerAdapter

public class GoalManagerAdapter extends GuiAdapter
A WebSocket adapter for communication between the GoalManagerImpl and the frontend Goal Manager GUI.
See Also:
  • Field Details

    • ACTION_SCRIPT_PATH

      public final String ACTION_SCRIPT_PATH
      Path to the folder containing all .asl files. Depending on method of launch, might require prefix .. or might not.
      See Also:
  • Constructor Details

    • GoalManagerAdapter

      public GoalManagerAdapter(Collection<String> groups)
      Constructor.
  • Method Details

    • init

      protected void init()
      Initialization after construction and after TRADE services are registered.
      Overrides:
      init in class GuiAdapter
    • 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:
      providesTradeServices in class GuiAdapter
      Returns:
      true iff the adapter provides TRADE services.
    • handleMessage

      protected void handleMessage(com.google.gson.JsonObject message)
      Handle a message from the client.
      Overrides:
      handleMessage in class GuiAdapter
      Parameters:
      message - a JsonObject representing the message.
    • getPathRoot

      public String getPathRoot()
      Enforce implementation of path root getter for getPath(). This is usually based on the component's/adapter's name; e.g., the belief GUI's path root is belief.
      Specified by:
      getPathRoot in class GuiAdapter
      Returns:
      the path root as a String.
    • actionAdded

      public void actionAdded(ActionDBEntry adb)
      Notifies the frontend of a new action to offer the user. Called when an action is added to the database.
      Parameters:
      adb - the new ActionDBEntry
    • actionRemoved

      public void actionRemoved(ActionDBEntry adb)
      Notifies the frontend to remove an action from display. Called when an action is removed from the database.
      Parameters:
      adb - the removed ActionDBEntry