edu.princeton.toy
Class TStdinPane.Listener

java.lang.Object
  extended by edu.princeton.toy.TStdinPane.Listener
All Implemented Interfaces:
ActionListener, MouseListener, EventListener, ChangeListener
Enclosing class:
TStdinPane

protected class TStdinPane.Listener
extends Object
implements ActionListener, ChangeListener, MouseListener

The Listener of a TStdoutPane pays attention to the changes in the virtualMachine and updates the components, it also stops the stdin text field from blinking if the user clicks on it and listens to action events from JButtons and PTextFields.


Constructor Summary
protected TStdinPane.Listener()
           
 
Method Summary
 void actionPerformed(ActionEvent e)
          Implement ActionListener to pass commands to the doCommand() method.
 void mouseClicked(MouseEvent e)
          Implement MouseListener to stop the runner if the user clicks on the inputField.
 void mouseEntered(MouseEvent e)
          Implement MouseListener to stop the runner if the user clicks on the inputField.
 void mouseExited(MouseEvent e)
          Implement MouseListener to stop the runner if the user clicks on the inputField.
 void mousePressed(MouseEvent e)
          Implement MouseListener to stop the runner if the user clicks on the inputField.
 void mouseReleased(MouseEvent e)
          Implement MouseListener to stop the runner if the user clicks on the inputField.
 void stateChanged(ChangeEvent e)
          Implement ChangeListener to update the list whenever the virtual machine's state changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TStdinPane.Listener

protected TStdinPane.Listener()
Method Detail

actionPerformed

public void actionPerformed(ActionEvent e)
Implement ActionListener to pass commands to the doCommand() method.

Specified by:
actionPerformed in interface ActionListener

stateChanged

public void stateChanged(ChangeEvent e)
Implement ChangeListener to update the list whenever the virtual machine's state changes.

Specified by:
stateChanged in interface ChangeListener

mouseClicked

public void mouseClicked(MouseEvent e)
Implement MouseListener to stop the runner if the user clicks on the inputField.

Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent e)
Implement MouseListener to stop the runner if the user clicks on the inputField.

Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Implement MouseListener to stop the runner if the user clicks on the inputField.

Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Implement MouseListener to stop the runner if the user clicks on the inputField.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Implement MouseListener to stop the runner if the user clicks on the inputField.

Specified by:
mouseExited in interface MouseListener