/**
  * Updates the texts that show the current construction step and the number of construction steps.
  */
 public void update() {
   if (prot != null) {
     int currentStep = prot.getCurrentStepNumber();
     int stepNumber = prot.getLastStepNumber();
     lbSteps.setText(currentStep + " / " + stepNumber);
   }
 }
  public void actionPerformed(ActionEvent e) {
    Object source = e.getSource();

    setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));

    if (source == btFirst) {
      prot.firstStep();
    } else if (source == btLast) {
      prot.lastStep();
    } else if (source == btPrev) {
      prot.previousStep();
    } else if (source == btNext) {
      prot.nextStep();
    } else if (source == btPlay) {
      if (isPlaying) {
        player.stopAnimation();
      } else {
        player = new AutomaticPlayer(playDelay);
        player.startAnimation();
      }
    }

    if (prot.isVisible()) prot.scrollToConstructionStep();

    setCursor(Cursor.getDefaultCursor());
  }
 /** Unregisters this navigation bar from its protocol. */
 public void unregister() {
   prot.unregisterNavigationBar(this);
 }