avrora.gui
Class VisualRegMonitor.VisualMonitor

java.lang.Object
  extended byavrora.gui.VisualRegMonitor.VisualMonitor
All Implemented Interfaces:
Monitor, Simulator.Probe, VisualMonitor
Enclosing class:
VisualRegMonitor

public class VisualRegMonitor.VisualMonitor
extends java.lang.Object
implements VisualMonitor, Simulator.Probe

The Monitor class implements a monitor for the stack height that inserts a probe after every instruction in the program and checks the stack height after each instruction is executed.


Nested Class Summary
 
Nested classes inherited from class avrora.sim.Simulator.Probe
Simulator.Probe.Empty
 
Field Summary
 ProgramProfiler profile
           
 Program program
           
 Simulator simulator
           
 GraphNumbers theGraph
           
 javax.swing.JPanel visualOptionsPanel
           
 javax.swing.JPanel visualPanel
           
 
Method Summary
 void fireAfter(State s, int address)
          The fireAfter() method is called after the probed instruction executes.
 void fireBefore(State s, int address)
          The fireBefore() method is called before the probed instruction executes.
 GraphEvents getGraph()
          This is a temporary hack...once Global Monitors is rewritten to be more robust, this will be deleted
 void report()
          The report() method generates a textual report after the simulation is complete.
 void setVisualPanel(javax.swing.JPanel thePanel, javax.swing.JPanel theOptionsPanel)
          This is called right after a monitor is actually init (when the sim is just beginning It physically let's the new monitor "know" about it's painting surfaces Note that it's possible with the new implementation that this function will be unnecessary
 void updateDataAndPaint()
          This function should be called by the thread that periodically repaints the monitors chalkaboard.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

simulator

public final Simulator simulator

program

public final Program program

profile

public final ProgramProfiler profile

visualPanel

public javax.swing.JPanel visualPanel

visualOptionsPanel

public javax.swing.JPanel visualOptionsPanel

theGraph

public GraphNumbers theGraph
Method Detail

getGraph

public GraphEvents getGraph()
Description copied from interface: VisualMonitor
This is a temporary hack...once Global Monitors is rewritten to be more robust, this will be deleted

Specified by:
getGraph in interface VisualMonitor

updateDataAndPaint

public void updateDataAndPaint()
Description copied from interface: VisualMonitor
This function should be called by the thread that periodically repaints the monitors chalkaboard. It is assumed that this function will also handle any internal data maniuplations that are necessary

Specified by:
updateDataAndPaint in interface VisualMonitor

setVisualPanel

public void setVisualPanel(javax.swing.JPanel thePanel,
                           javax.swing.JPanel theOptionsPanel)
Description copied from interface: VisualMonitor
This is called right after a monitor is actually init (when the sim is just beginning It physically let's the new monitor "know" about it's painting surfaces

Note that it's possible with the new implementation that this function will be unnecessary

Specified by:
setVisualPanel in interface VisualMonitor
Parameters:
thePanel - The main display panel for the monitor
theOptionsPanel - The panel that the monitor can display options to

fireBefore

public void fireBefore(State s,
                       int address)
Description copied from interface: Simulator.Probe
The fireBefore() method is called before the probed instruction executes.

Specified by:
fireBefore in interface Simulator.Probe
Parameters:
s - the state of the simulation
address - the address at which this instruction resides

fireAfter

public void fireAfter(State s,
                      int address)
Description copied from interface: Simulator.Probe
The fireAfter() method is called after the probed instruction executes.

Specified by:
fireAfter in interface Simulator.Probe
Parameters:
s - the state of the simulation
address - the address at which this instruction resides

report

public void report()
The report() method generates a textual report after the simulation is complete. The report does nothing in this case, because this is a visual monitor

Specified by:
report in interface VisualMonitor