|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.flagstone.transform.Movie
public final class Movie
Movie is a container class for the objects that represents the data structures in a Flash file.
Movie is the core class of the Transform package. It is used to parse and generate Flash files, translating the binary format of the Flash file into an list objects that can be inspected and updated.
A Movie object also contains the attributes that make up the header information of the Flash file, identifying the version support, size of the Flash Player screen, etc.
Movie is also used to generate the unique identifiers that are used to reference objects. Each call to newIdentifier() returns a unique number for the current. The identifiers are generated using a simple counter. When a movie is decoded this counter is updated each time an object definition is decoded. This allows new objects to be added and ensures that the identifier does not conflict with an existing object.
| Field Summary | |
|---|---|
static byte[] |
CWS
Signature identifying Compressed Flash (SWF) files. |
static byte[] |
FWS
Signature identifying Flash (SWF) files. |
static int |
VERSION
The version of Flash supported. |
| Constructor Summary | |
|---|---|
Movie()
Creates a new Movie. |
|
Movie(Movie movie)
Creates a complete copy of this movie. |
|
| Method Summary | |
|---|---|
Movie |
add(MovieTag anObject)
Adds the object to the Movie. |
Movie |
copy()
Creates a complete copy of this object. |
void |
decodeFromFile(File file)
Decodes the contents of the specified file. |
void |
decodeFromStream(InputStream stream)
Decodes the binary Flash data from an input stream. |
void |
decodeFromUrl(URL url)
Decodes a Flash file referenced by a URL. |
void |
encodeToFile(File file)
Encodes the list of objects and writes the data to the specified file. |
void |
encodeToStream(OutputStream stream)
Returns the encoded representation of the list of objects that this Movie contains. |
List<MovieTag> |
getObjects()
Get the list of objects contained in the Movie. |
void |
setEncoding(CharacterEncoding enc)
Sets the encoding scheme for strings encoded and decoded from Flash files. |
void |
setObjects(List<MovieTag> list)
Sets the list of objects contained in the Movie. |
void |
setRegistry(DecoderRegistry decoderRegistry)
Sets the registry containing the object used to decode the different types of object found in a movie. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int VERSION
public static final byte[] FWS
public static final byte[] CWS
| Constructor Detail |
|---|
public Movie()
public Movie(Movie movie)
movie - the Movie to copy.| Method Detail |
|---|
public void setRegistry(DecoderRegistry decoderRegistry)
decoderRegistry - a central registry to decoders of different types
of object.public void setEncoding(CharacterEncoding enc)
enc - the character encoding used for strings.public List<MovieTag> getObjects()
public void setObjects(List<MovieTag> list)
list - the list of objects that describe a coder. Must not be null.public Movie add(MovieTag anObject)
anObject - the object to be added to the movie. Must not be null.
public Movie copy()
copy in interface Copyable<Movie>public String toString()
toString in class Object
public void decodeFromFile(File file)
throws DataFormatException,
IOException
file - the Flash file that will be parsed.
DataFormatException - - if the file does not contain Flash data.
IOException - - if an I/O error occurs while reading the file.
public void decodeFromUrl(URL url)
throws DataFormatException,
IOException
url - the Uniform Resource Locator referencing the file.
IOException - if there is an error reading the file.
DataFormatException - if there is a problem decoding the font, either it is in an
unsupported format or an error occurred while decoding the
font data.
public void decodeFromStream(InputStream stream)
throws DataFormatException,
IOException
stream - an InputStream from which the objects will be decoded.
DataFormatException - if the file does not contain Flash data.
IOException - if an I/O error occurs while reading the file.
public void encodeToFile(File file)
throws IOException,
DataFormatException
file - the Flash file that the movie will be encoded to.
IOException - - if an I/O error occurs while writing the file.
DataFormatException - if an error occurs when compressing the flash file.
public void encodeToStream(OutputStream stream)
throws DataFormatException,
IOException
stream - the output stream that the video will be encoded to.
IOException - - if an I/O error occurs while encoding the file.
DataFormatException - if an error occurs when compressing the flash file.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||