lij.monitor
Class Monitor

java.lang.Object
  extended by lij.monitor.Monitor

public class Monitor
extends java.lang.Object

A GUI for monitoring the internal state of the interpreter.

Author:
Nikolaos Chatzinikolaou

Field Summary
private  boolean active
           
private  javax.swing.JFrame frame
           
private static int HEIGHT
           
private  Interpreter interpreter
           
private  PanelAgents panelAgents
           
private  PanelLetterBox panelLetterBox
           
private  PanelLog panelLog
           
private static int WIDTH
           
 
Constructor Summary
Monitor(Interpreter _interpreter)
          Constructor.
 
Method Summary
 void letterAdded(Letter letter)
          Notifies that a new Letter has been added in the message queue.
 void letterRemoved(Letter letter)
          Notifies that a Letter has been removed from the message queue.
 void log(java.lang.String source, java.lang.String text)
          Writes a new log message.
 void setActive(boolean _active)
          Activates or deactivates the monitor.
private  void setupFrame()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WIDTH

private static final int WIDTH
See Also:
Constant Field Values

HEIGHT

private static final int HEIGHT
See Also:
Constant Field Values

frame

private javax.swing.JFrame frame

panelAgents

private PanelAgents panelAgents

panelLetterBox

private PanelLetterBox panelLetterBox

panelLog

private PanelLog panelLog

interpreter

private Interpreter interpreter

active

private boolean active
Constructor Detail

Monitor

public Monitor(Interpreter _interpreter)
Constructor.

Parameters:
_interpreter - A pointer to the Interpreter object.
Method Detail

setupFrame

private void setupFrame()

setActive

public void setActive(boolean _active)
Activates or deactivates the monitor.

Parameters:
_active - The new active state.

letterAdded

public void letterAdded(Letter letter)
Notifies that a new Letter has been added in the message queue.

Parameters:
letter - The newly arrived letter.

letterRemoved

public void letterRemoved(Letter letter)
Notifies that a Letter has been removed from the message queue.

Parameters:
letter - The newly removed letter.

log

public void log(java.lang.String source,
                java.lang.String text)
Writes a new log message.

Parameters:
source - The source of the message.
text - The message String.