Package mars.venus

Class Coprocessor1Window

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

public class Coprocessor1Window extends JPanel implements ActionListener, Observer
Sets up a window to display Coprocessor 1 registers in the Registers pane of the UI.
Author:
Pete Sanderson 2005
See Also:
Serialized Form
  • Constructor Details

    • Coprocessor1Window

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

    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Called when user clicks on a condition flag checkbox. Updates both the display and the underlying Coprocessor 1 flag.
      Specified by:
      actionPerformed in interface ActionListener
      Parameters:
      e - component that triggered this call
    • 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()
      Redisplay registers using current display number base (10 or 16)
    • updateRegisters

      public void updateRegisters(int base)
      Redisplay registers using specified display number base (10 or 16)
      Parameters:
      base - number base for display (10 or 16)
    • updateFloatRegisterValue

      public void updateFloatRegisterValue(int number, int val, int base)
      This method handles the updating of the GUI. Does not affect actual register.
      Parameters:
      number - The number of the float register whose display to update.
      val - New value.
      base - the number base for display (e.g. 10, 16)
    • updateDoubleRegisterValue

      public void updateDoubleRegisterValue(int number, int base)
      This method handles the updating of the GUI. Does not affect actual register.
      Parameters:
      number - The number of the double register to update.
      base - the number base for display (e.g. 10, 16)
    • 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.