/**
   * 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++;
  }