Package mars.venus

Class RegistersWindow

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

public class RegistersWindow extends JPanel implements Observer
Sets up a window to display registers in the UI.
Author:
Sanderson, Bumgarner
See Also:
Serialized Form
  • Constructor Details

    • RegistersWindow

      public RegistersWindow()
      Constructor which sets up a fresh window with a table that contains the register values.
  • Method Details

    • setupWindow

      public Object[][] setupWindow()
      Sets up the data for the window.
      Returns:
      The array object with the data for the window.
    • clearWindow

      public void clearWindow()
      Clear and redisplay registers
    • clearHighlighting

      public void clearHighlighting()
      Clear highlight background color from any cell currently highlighted.
    • refresh

      public void refresh()
      Refresh the table, triggering re-rendering.
    • updateRegisters

      public void updateRegisters()
      update register display using current number base (10 or 16)
    • updateRegisters

      public void updateRegisters(int base)
      update register display using specified number base (10 or 16)
      Parameters:
      base - desired number base
    • updateRegisterValue

      public void updateRegisterValue(int number, int val, int base)
      This method handles the updating of the GUI.
      Parameters:
      number - The number of the register to update.
      val - New value.
    • update

      public void update(Observable observable, Object obj)
      Required by Observer interface. Called when notified by an Observable that we are registered with. Observables include: The Simulator object, which lets us know when it starts and stops running A register object, which lets us know of register operations The Simulator keeps us informed of when simulated MIPS execution is active. This is the only time we care about register operations.
      Specified by:
      update in interface Observer
      Parameters:
      observable - The Observable object who is notifying us
      obj - Auxiliary object with additional information.