package trafficlight;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2002</p>
 * <p>Company: </p>
 * @author unascribed
 * @version 1.0
 */

import java.awt.* ;
import javax.swing.* ;
import java.awt.event.* ;

public class ButtonView
extends JPanel implements TheController {

  JButton jb ;
  TrafficLightModel tlm ;
  private final static String BUTTON_TITLE = "Walk" ;

  public ButtonView(TrafficLightModel tlm) {
     this.tlm = tlm ;
     jb = new JButton(BUTTON_TITLE) ;
     add( jb ) ;
     jb.addActionListener(this);
  }

  // implement TheController

  public
  void actionPerformed( ActionEvent ae ) {
     tlm.walk() ;
  }

}