Package mars.venus

Class Coprocessor0Window

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

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

    • Coprocessor0Window

      public Coprocessor0Window()
      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()
      Reset and redisplay registers
    • clearHighlighting

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

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

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

      public void updateRegisters(int base)
      Update register display using specified display base
      Parameters:
      base - number base for display (10 or 16)
    • 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.