Class MapAdapter

java.lang.Object
edu.tufts.hrilab.gui.GuiAdapter
edu.tufts.hrilab.map.gui.MapAdapter

public class MapAdapter extends GuiAdapter
Handles WebSocket messages for MapComponent-related functionalities within the web interface. This class processes and responds to various navigation and location requests, converting them into TRADEService calls and updates within the application.
  • Constructor Details

  • Method Details

    • handleMessage

      protected void handleMessage(com.google.gson.JsonObject message)
      Handles incoming WebSocket messages by identifying the action requested and delegating to the appropriate method.
      Overrides:
      handleMessage in class GuiAdapter
      Parameters:
      message - The text message received from the client.
    • convertPGMtoPNG

      public String convertPGMtoPNG(String pgmPathStr) throws org.apache.commons.imaging.ImageReadException, org.apache.commons.imaging.ImageWriteException, IOException
      Converts a PGM image file to a PNG image file and returns the new filename.
      Parameters:
      pgmPathStr - The path string of the PGM file to convert.
      Returns:
      The filename of the converted PNG image.
      Throws:
      org.apache.commons.imaging.ImageReadException
      org.apache.commons.imaging.ImageWriteException
      IOException
    • 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.
    • 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.