Class DialogueMessage

java.lang.Object
edu.tufts.hrilab.ava.display.DialogueMessage

public class DialogueMessage extends Object
represents a char message within the Ava Display Component. Each message is associated with a specific speaker and has a timeout after which it is automatically removed from the display.
  • Constructor Details

    • DialogueMessage

      public DialogueMessage(String text, String speaker)
      Constructs a new ChatMessage
      Parameters:
      text - The text of the chat message.
      speaker - The speaker of the chat message.
    • DialogueMessage

      public DialogueMessage(String text, String speaker, int messageTimeout)
      Constructs a new ChatMessage with a custom message timeout
      Parameters:
      text - The text of the chat message.
      speaker - The speaker of the chat message.
      messageTimeout - The time until the message is timed out in milliseconds.
  • Method Details

    • getText

      public String getText()
      Gets the text of the chat message.
      Returns:
      The text of the chat message.
    • getSpeaker

      public String getSpeaker()
      Gets the speaker of the chat message.
      Returns:
      the speaker of the chat message.
    • isRobotMessage

      public boolean isRobotMessage()
      Checks if the message is from the robot
      Returns:
      true if message is from the robot, false otherwise
    • isRemoved

      public boolean isRemoved()
      Checks if the message has been removed.
      Returns:
      true if the message has been removed, false otherwise.
    • cancel

      public void cancel()
      Cancels the timer and removed the message. This is useful when removing messages before timeout.