Class FrameSequencer

java.lang.Object
  extended byFrameSequencer

public class FrameSequencer
extends java.lang.Object

Class used to save frames in a movie to a directory and show frames from a movie. This class tracks the directory, base file name, current frame number, and whether this sequence is being shown. Copyright Georgia Institute of Technology 2005

Author:
Barbara Ericson

Constructor Summary
FrameSequencer(java.lang.String directory)
          Constructor that takes a directory name
FrameSequencer(java.lang.String directory, java.lang.String baseName)
          Constructor that takes a directory name and a base file name
 
Method Summary
 void addFrame(Picture picture)
          Method to add a picture to the frame sequence
 java.lang.String getBaseName()
          Method to get the base name
 java.lang.String getDirectory()
          Method to get the directory to write the frames to
 int getFrameNumber()
          Method to get the frame number
 MoviePlayer getMoviePlayer()
          Method to get the movie player to use to show this sequence
 int getNumFrames()
          Method to get the number of frames in this sequence
 boolean isShown()
          Method to check if the frame sequence is being shown
static void main(java.lang.String[] args)
           
 void play(int framesPerSecond)
          Method to play the frames (pictures) added so far
 void setBaseName(java.lang.String name)
          Method to set the base name
 void setDirectory(java.lang.String dir)
          Method to set the directory to write the frames to
 void setShown(boolean value)
          Method to set the shown flag
 void show()
          Method to show the frame sequence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameSequencer

public FrameSequencer(java.lang.String directory)
Constructor that takes a directory name

Parameters:
directory - the directory to save the frames to

FrameSequencer

public FrameSequencer(java.lang.String directory,
                      java.lang.String baseName)
Constructor that takes a directory name and a base file name

Parameters:
directory - the directory to save the frames to
baseName - the base file name to use for the frames
Method Detail

getDirectory

public java.lang.String getDirectory()
Method to get the directory to write the frames to

Returns:
the directory to write the frames to

setDirectory

public void setDirectory(java.lang.String dir)
Method to set the directory to write the frames to

Parameters:
dir - the directory to use

getBaseName

public java.lang.String getBaseName()
Method to get the base name

Returns:
the base file name for the movie frames

setBaseName

public void setBaseName(java.lang.String name)
Method to set the base name

Parameters:
name - the new base name to use

getFrameNumber

public int getFrameNumber()
Method to get the frame number

Returns:
the next frame number for the next picture added

isShown

public boolean isShown()
Method to check if the frame sequence is being shown

Returns:
true if shown and false otherwise

setShown

public void setShown(boolean value)
Method to set the shown flag

Parameters:
value - the value to use

getNumFrames

public int getNumFrames()
Method to get the number of frames in this sequence

Returns:
the number of frames

getMoviePlayer

public MoviePlayer getMoviePlayer()
Method to get the movie player to use to show this sequence

Returns:
the movie player used to show this (may be null)

addFrame

public void addFrame(Picture picture)
Method to add a picture to the frame sequence

Parameters:
picture - the picture to add

show

public void show()
Method to show the frame sequence


play

public void play(int framesPerSecond)
Method to play the frames (pictures) added so far

Parameters:
framesPerSecond - the number of frames to show per second between frames

main

public static void main(java.lang.String[] args)