/**
  * Method to replay the frames (pictures) added so far
  *
  * @param sleepTime the amount to sleep in milliseconds between frames
  */
 public void replay(int sleepTime) {
   Picture picture = null;
   Iterator iterator = pictureList.iterator();
   while (iterator.hasNext()) {
     picture = (Picture) iterator.next();
     pictureFrame.setPicture(picture);
     try {
       Thread.sleep(sleepTime);
     } catch (Exception ex) {
     }
   }
 }
  /**
   * Method to add a picture to the frame sequence
   *
   * @param picture the picture to add
   */
  public void addFrame(Picture picture) {

    // add this picture to the list
    pictureList.add(picture);

    // write out this frame
    picture.write(directory + baseName + numberFormat.format(frameNumber) + ".jpg");

    // if this sequence is being shown update the frame
    if (shown) {
      if (pictureFrame != null) pictureFrame.setPicture(picture);
      else pictureFrame = new PictureFrame(picture);
    }

    // increment the frame number
    frameNumber++;
  }