Package mars.venus

Class DataSegmentWindow

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

public class DataSegmentWindow extends JInternalFrame implements Observer
Represents the Data Segment window, which is a type of JInternalFrame.
Author:
Sanderson and Bumgarner
See Also:
Serialized Form
  • Constructor Details

    • DataSegmentWindow

      public DataSegmentWindow(NumberDisplayBaseChooser[] choosers)
      Constructor for the Data Segment window.
      Parameters:
      choosers - an array of objects used by user to select number display base (10 or 16)
  • Method Details

    • updateBaseAddressComboBox

      public void updateBaseAddressComboBox()
    • setupTable

      public void setupTable()
      Generates and displays fresh table, typically done upon successful assembly.
    • clearWindow

      public void clearWindow()
      Removes the table from its frame, typically done when a file is closed.
    • clearHighlighting

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

      public void updateModelForMemoryRange(int firstAddr)
      Update table model with contents of new memory "chunk". Mars supports megabytes of data segment space so we only plug a "chunk" at a time into the table.
      Parameters:
      firstAddr - the first address in the memory range to be placed in the model.
    • updateCell

      public void updateCell(int address, int value)
      Update data display to show this value (I'm not sure it is being called).
    • updateDataAddresses

      public void updateDataAddresses()
      Redisplay the addresses. This should only be done when address display base is modified (e.g. between base 16, hex, and base 10, dec).
    • updateValues

      public void updateValues()
      Update data display to show all values
    • resetMemoryRange

      public void resetMemoryRange()
      Reset range of memory addresses to base address of currently selected segment and update display.
    • resetValues

      public void resetValues()
      Reset all data display values to 0
    • 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 delegate of the Memory object, which lets us know of memory operations The Simulator keeps us informed of when simulated MIPS execution is active. This is the only time we care about memory operations.
      Specified by:
      update in interface Observer
      Parameters:
      observable - The Observable object who is notifying us
      obj - Auxiliary object with additional information.