edu.washington.NVisF.animator
Class MovieMaker
java.lang.Object
|
+--edu.washington.NVisF.animator.MovieMaker
- public class MovieMaker
- extends java.lang.Object
The MovieMaker class provides a simple algorithm for constructing a
set of 3D scenes from a set of data sources, each of which contains
the data for one scene. The movie frames (that is, an
ObjectGroup[]
) are constructed through sequential
calls to a PlotCommand
initialized with one of the data sources.
These frames are then used by one of the Movie classes to construct
a movie.
Method Summary |
static ObjectGroup[] |
makeMovieFrames(PlotCommand command,
java.lang.String sourceFileName)
Constructs a set of movie frames from the supplied PlotCommand and
a file which contains the names of the data sources. |
static ObjectGroup[] |
makeMovieFrames(PlotCommand command,
java.lang.String[] dataSources)
Constructs a set of movie frames from the supplied PlotCommand
and the String array, dataSources, containing the names of data sources as
appropriate arguments to the DataReader.initConnection(String)
method. |
static java.lang.String[] |
readLines(java.lang.String sourceFileName,
java.lang.String commentString)
Utility method for parsing a text file into a String[] with each line
of the file stored in one String, ignoring lines that start with the
supplied commentString. |
static ObjectGroup[] |
readMovieFrames(java.lang.String inputFileName)
Reads movie frames from the file with the supplied name by
forwarding the request to the installed MovieIO object. |
static ObjectGroup[] |
writeMovieFrames(PlotCommand command,
java.lang.String[] dataSources,
java.lang.String outputFileName)
Constructs a set of movie frames from the supplied PlotCommand
and the String array, dataSources, containing the names of data sources as
appropriate arguments to the DataReader.initConnection(String)
method, and writes them to file using a compressed file format. |
static ObjectGroup[] |
writeMovieFrames(PlotCommand command,
java.lang.String sourceFileName,
java.lang.String outputFileName)
Constructs a set of movie frames from the supplied PlotCommand and
a file which contains the names of the data sources, and writes them
to file using a compressed file format. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MovieMaker
public MovieMaker()
makeMovieFrames
public static ObjectGroup[] makeMovieFrames(PlotCommand command,
java.lang.String sourceFileName)
- Constructs a set of movie frames from the supplied PlotCommand and
a file which contains the names of the data sources.
- Returns:
- ObjectGroup[] the movie frames as an array of ObjectGroups
makeMovieFrames
public static ObjectGroup[] makeMovieFrames(PlotCommand command,
java.lang.String[] dataSources)
- Constructs a set of movie frames from the supplied
PlotCommand
and the String array, dataSources, containing the names of data sources as
appropriate arguments to the DataReader.initConnection(String)
method.
- Returns:
- ObjectGroup[] the movie frames as an array of ObjectGroups
- See Also:
DataReader
writeMovieFrames
public static ObjectGroup[] writeMovieFrames(PlotCommand command,
java.lang.String sourceFileName,
java.lang.String outputFileName)
- Constructs a set of movie frames from the supplied PlotCommand and
a file which contains the names of the data sources, and writes them
to file using a compressed file format. The outputFileName is used as
a pattern for the output files by stripping any extension and passing
it to the writer, which adds its own extensions. If the output filename
is null, the source filename is used instead. The constructed frames
are also returned.
- Returns:
- ObjectGroup[] the movie frames as an array of ObjectGroups
writeMovieFrames
public static ObjectGroup[] writeMovieFrames(PlotCommand command,
java.lang.String[] dataSources,
java.lang.String outputFileName)
- Constructs a set of movie frames from the supplied
PlotCommand
and the String array, dataSources, containing the names of data sources as
appropriate arguments to the DataReader.initConnection(String)
method, and writes them to file using a compressed file format. The
outputFileName parameter is used as a pattern to construct the output
file names. The constructed frames are also returned.
- Returns:
- ObjectGroup[] the movie frames as an array of ObjectGroups
- Throws:
NullPointerException
- if the output file name is null- See Also:
DataReader
readMovieFrames
public static ObjectGroup[] readMovieFrames(java.lang.String inputFileName)
throws java.io.IOException,
java.lang.IllegalArgumentException
- Reads movie frames from the file with the supplied name by
forwarding the request to the installed MovieIO object.
readLines
public static java.lang.String[] readLines(java.lang.String sourceFileName,
java.lang.String commentString)
throws java.io.FileNotFoundException
- Utility method for parsing a text file into a String[] with each line
of the file stored in one String, ignoring lines that start with the
supplied commentString.
IOExceptions
, other than
errors when opening the file, are quietly ignored.
- Parameters:
sourceFileName
- the name of the file to readcommentString
- lines beginning with this String are ignored- Returns:
- String[] containing the lines of the file
- Throws:
java.io.FileNotFoundException
- if the specified file does not exist or
cannot be opened