Package mars.simulator
Interface SimulatorListener
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
Coprocessor0Tab
,Coprocessor1Tab
,DataSegmentWindow
,MessagesPane
,ProcessorTab
,RegistersDisplayTab
,RegistersPane
,TextSegmentWindow
,VenusUI
This interface is used to detect simulator events. It can be implemented and attached to the
Simulator
via Simulator.addGUIListener(SimulatorListener)
or Simulator.addThreadListener(SimulatorListener)
.
Note: which method above is used to add the listener will determine which thread the callbacks run on.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
Called when the simulator stops execution of a program due to termination or finishing.default void
Called when the simulator stops execution of a program due to pausing.default void
Called when the simulator begins execution of a program.default void
Called when the simulator has finished executing an instruction, but only if the run speed is not unlimited.
-
Method Details
-
simulatorStarted
Called when the simulator begins execution of a program.- Parameters:
event
- The event which occurred.
-
simulatorPaused
Called when the simulator stops execution of a program due to pausing.- Parameters:
event
- The event which occurred.
-
simulatorFinished
Called when the simulator stops execution of a program due to termination or finishing.- Parameters:
event
- The event which occurred.
-
simulatorStepped
default void simulatorStepped()Called when the simulator has finished executing an instruction, but only if the run speed is not unlimited.Note: For very fast run speeds, GUI listeners may not receive all step events. This is an intentional feature to prevent overloading of the GUI event queue.
-