Package mars.venus

Class MessagesPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, SwingConstants, SimulatorListener

public class MessagesPane extends JTabbedPane implements SimulatorListener
Creates the message window at the bottom of the UI.
Author:
Team JSpim
See Also:
  • Constructor Details

    • MessagesPane

      public MessagesPane()
      Constructor for the class, sets up two fresh tabbed text areas for program feedback.
  • Method Details

    • highlightMessageSource

      public void highlightMessageSource(LogMessage message)
      Will select the specified line in an editor tab. If the file is open but not current, its tab will be made current. If the file is not open, it will be opened in a new tab and made current, however the line will not be selected (apparent apparent problem with JEditTextArea).
      Parameters:
      message - The message whose source should be highlighted.
    • getMessages

      public ConsoleTextArea getMessages()
      Get the text area used to display application messages to the user.
      Returns:
      The console contained in the Messages tab.
    • getConsole

      public ConsoleTextArea getConsole()
      Get the text area used to display runtime output to the user.
      Returns:
      The console contained in the Console tab.
    • selectMessagesTab

      public void selectMessagesTab()
      Ensure that the Messages tab is visible.

      This method may be called from any thread.

    • selectConsoleTab

      public void selectConsoleTab()
      Ensure that the Console tab is visible.

      This method may be called from any thread.

    • getInputString

      public String getInputString(String prompt)
      Method used by the SystemIO class to get interactive user input requested by a running MIPS program (e.g. syscall #5 to read an integer). SystemIO knows whether simulator is being run at command line by the user, or by the GUI. If run at command line, it gets input from System.in rather than here.

      This is an overloaded method. This version, with the String parameter, is used to get input from a popup dialog.

      Parameters:
      prompt - Prompt to display to the user.
      Returns:
      User input, as a String.
    • simulatorStarted

      public void simulatorStarted(SimulatorStartEvent event)
      Called when the simulator begins execution of a program.
      Specified by:
      simulatorStarted in interface SimulatorListener
      Parameters:
      event - The event which occurred.
    • simulatorPaused

      public void simulatorPaused(SimulatorPauseEvent event)
      Called when the simulator stops execution of a program due to pausing.
      Specified by:
      simulatorPaused in interface SimulatorListener
      Parameters:
      event - The event which occurred.
    • simulatorFinished

      public void simulatorFinished(SimulatorFinishEvent event)
      Called when the simulator stops execution of a program due to termination or finishing.
      Specified by:
      simulatorFinished in interface SimulatorListener
      Parameters:
      event - The event which occurred.