Package mars.tools

Class VisualStack

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, Memory.Listener, Register.Listener, MarsTool

public class VisualStack extends AbstractMarsTool implements Register.Listener
See Also:
  • Constructor Details

    • VisualStack

      public VisualStack()
      Construct an instance of this tool. This will be used by the ToolManager.
  • Method Details

    • getName

      public String getName()
      Description copied from class: AbstractMarsTool
      Required MarsTool method to return Tool name. Must be defined by subclass.
      Specified by:
      getName in interface MarsTool
      Specified by:
      getName in class AbstractMarsTool
      Returns:
      Tool name. MARS will display this in menu item.
    • initializePreGUI

      public void initializePreGUI()
      Description copied from class: AbstractMarsTool
      Method that will be called once just before the GUI is constructed in the go() and action() methods. Use it to initialize any data structures needed for the application whose values will be needed to determine the initial state of GUI components. Does nothing by default.
      Overrides:
      initializePreGUI in class AbstractMarsTool
    • buildMainDisplayArea

      protected JComponent buildMainDisplayArea()
      Description copied from class: AbstractMarsTool
      Abstract method that must be instantiated by subclass to build the main display area of the GUI. It will be placed in the CENTER area of a BorderLayout. The title is in the NORTH area, and the controls are in the SOUTH area.
      Specified by:
      buildMainDisplayArea in class AbstractMarsTool
    • initializePostGUI

      public void initializePostGUI()
      Description copied from class: AbstractMarsTool
      Method that will be called once just after the GUI is constructed in the go() and action() methods. Use it to initialize data structures needed for the application whose values may depend on the initial state of GUI components. Does nothing by default.
      Overrides:
      initializePostGUI in class AbstractMarsTool
    • getHelpComponent

      protected JComponent getHelpComponent()
      Description copied from class: AbstractMarsTool
      Override this method to provide a JComponent (probably a JButton) of your choice to be placed just left of the Close/Exit button. Its anticipated use is for a "help" button that launches a help message or dialog. But it can be any valid JComponent that doesn't mind co-existing among a bunch of JButtons.
      Overrides:
      getHelpComponent in class AbstractMarsTool
    • startObserving

      protected void startObserving()
      Description copied from class: AbstractMarsTool
      Register this tool as a listener of memory and/or registers, if applicable. This method is called when the tool is opened by the user. Does nothing by default.
      Overrides:
      startObserving in class AbstractMarsTool
      See Also:
    • stopObserving

      protected void stopObserving()
      Description copied from class: AbstractMarsTool
      Unregister this tool as a listener of memory and/or registers, if applicable. This method is called when the tool is closed by the user. Does nothing by default.
      Overrides:
      stopObserving in class AbstractMarsTool
      See Also:
    • memoryWritten

      public void memoryWritten(int address, int length, int value, int wordAddress, int wordValue)
      Description copied from interface: Memory.Listener
      Invoked upon any write operation which is relevant to this listener's active range. Does nothing by default.
      Specified by:
      memoryWritten in interface Memory.Listener
      Parameters:
      address - The address which was written to.
      length - The number of bytes written. Will always be 1 (single byte), Memory.BYTES_PER_HALFWORD, or Memory.BYTES_PER_WORD.
      value - The value which was written.
      wordAddress - The address of the word affected by the operation.
      wordValue - The resulting value of the word.
    • registerWritten

      public void registerWritten(Register stackPtr)
      Specified by:
      registerWritten in interface Register.Listener
    • reset

      public void reset()
      Description copied from class: AbstractMarsTool
      Method that will be called each time the default Reset button is clicked. Use it to reset any data structures and/or GUI components. Does nothing by default.
      Overrides:
      reset in class AbstractMarsTool