Package mars.venus

Class MessagesPane

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

public class MessagesPane extends JTabbedPane
Creates the message window at the bottom of the UI.
Author:
Team JSpim
See Also:
Serialized Form
  • Field Details

    • MAXIMUM_SCROLLED_CHARACTERS

      public static final int MAXIMUM_SCROLLED_CHARACTERS
    • NUMBER_OF_CHARACTERS_TO_CUT

      public static final int NUMBER_OF_CHARACTERS_TO_CUT
  • Constructor Details

    • MessagesPane

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

    • selectErrorMessage

      public void selectErrorMessage(String fileName, int line, int column)
      Will select the Mars Messages tab error message that matches the given specifications, if it is found. Matching is done by constructing a string using the parameter values and searching the text area for the last occurrence of that string.
      Parameters:
      fileName - A String containing the file path name.
      line - Line number for error message
      column - Column number for error message
    • selectEditorTextLine

      public void selectEditorTextLine(String fileName, int line, int column)
      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:
      fileName - A String containing the file path name.
      line - Line number for error message
      column - Column number for error message
    • getAssembleTextArea

      public JTextArea getAssembleTextArea()
      Returns component used to display assembler messages
      Returns:
      assembler message text component
    • getRunTextArea

      public JTextArea getRunTextArea()
      Returns component used to display runtime messages
      Returns:
      runtime message text component
    • postMarsMessage

      public void postMarsMessage(String message)
      Post a message to the assembler display
      Parameters:
      message - String to append to assembler display text
    • postRunMessage

      public void postRunMessage(String message)
      Post a message to the runtime display
      Parameters:
      message - String to append to runtime display text
    • selectMarsMessageTab

      public void selectMarsMessageTab()
      Make the assembler message tab current (up front)
    • selectRunMessageTab

      public void selectRunMessageTab()
      Make the runtime message tab current (up front)
    • 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.
    • getInputString

      public String getInputString(int maxLen)
      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 int parameter, is used to get input from the MARS Run I/O window.
      Parameters:
      maxLen - : maximum length of input. This method returns when maxLen characters have been read. Use -1 for no length restrictions.
      Returns:
      User input.