com.flagstone.transform
Class FSMovieObject

java.lang.Object
  extended by com.flagstone.transform.FSTransformObject
      extended by com.flagstone.transform.FSMovieObject
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
FSButtonColorTransform, FSButtonSound, FSDefineObject, FSDoAction, FSEnableDebugger, FSEnableDebugger2, FSExport, FSFontInfo, FSFontInfo2, FSFrameLabel, FSFree, FSImport, FSInitialize, FSJPEGEncodingTable, FSLimitScript, FSPathsArePostscript, FSPlaceObject, FSPlaceObject2, FSPointer, FSProtect, FSQuicktimeMovie, FSRemoveObject, FSRemoveObject2, FSSerialNumber, FSSetBackgroundColor, FSShowFrame, FSSoundStreamBlock, FSSoundStreamHead, FSSoundStreamHead2, FSStartSound, FSTabOrder, FSUnknownObject, FSVideoFrame

public abstract class FSMovieObject
extends FSTransformObject

The FSMovieObject is the root class for objects that represent each of the tagged data structures that make up the Flash file format specification. Each of the major data structures defined in the Flash file format specification start with a header that contains the type identifying the data structure followed by the number of bytes that the body of the encoded data structure occupies in the file. The FSMovieObject manages the encoding and decoding of this information. This class is primarily used internally in the library however the getType() method is useful when manipulating decoded Flash files. Rather than using the runtime type checking provided in the Java environment the method can be used to identify the class, derived from FSMovieObject, that represents each data structure, improving performance.


Field Summary
static int ButtonColorTransform
           
static int ButtonSound
           
static int DefineBitsPtr
           
static int DefineButton
          Type used to identify DefineButton objects.
static int DefineButton2
           
static int DefineFont
          Type used to identify DefineFont objects.
static int DefineFont2
           
static int DefineImage
           
static int DefineImage2
           
static int DefineJPEGImage
          Type used to identify DefineJPEGImage objects.
static int DefineJPEGImage2
           
static int DefineJPEGImage3
           
static int DefineMorphShape
           
static int DefineMovieClip
           
static int DefineShape
          Type used to identify DefineShape objects.
static int DefineShape2
           
static int DefineShape3
           
static int DefineSound
          Type used to identify DefineSound objects.
static int DefineText
          Type used to identify DefineText objects.
static int DefineText2
           
static int DefineTextField
           
static int DefineVideo
           
static int DoAction
          Type used to identify DoAction objects.
static int EnableDebugger
           
static int EnableDebugger2
           
static int Export
           
protected  boolean extendLength
           
static int FontInfo
          Type used to identify FontInfo objects.
static int FontInfo2
           
static int FrameLabel
           
static int Free
           
static int Import
           
static int Initialize
           
static int JPEGTables
          Type used to identify JPEGTables objects.
protected  int length
           
static int LimitScript
           
static int PathsArePostscript
           
static int PlaceObject
          Type used to identify PlaceObject objects.
static int PlaceObject2
           
static int Protect
           
static int QuicktimeMovie
           
static int RemoveObject
          Type used to identify RemoveObject objects.
static int RemoveObject2
           
static int SerialNumber
           
static int SetBackgroundColor
          Type used to identify SetBackgroundColor objects.
static int ShowFrame
          Type used to identify ShowFrame objects.
static int SoundStreamBlock
          Type used to identify SoundStreamBlock objects.
static int SoundStreamHead
          Type used to identify SoundStreamHead objects.
static int SoundStreamHead2
           
static int StartSound
          Type used to identify StartSound objects.
static int TabOrder
           
protected  int type
           
static int VideoFrame
           
 
Constructor Summary
protected FSMovieObject(FSMovieObject obj)
          Constructs a movie object by copying an existing one.
protected FSMovieObject(int aType)
          Constructs a movie object with the specified type.
 
Method Summary
 void appendDescription(java.lang.StringBuffer buffer, int depth)
          AppendDescription is used to present a string description of the object including all nested objects up to a specified depth.
 void decode(FSCoder coder)
           
 void encode(FSCoder coder)
           
 boolean equals(java.lang.Object anObject)
          Returns true if anObject is equal to this one.
 int getType()
          Gets the code used that identifies the type of the object when it is encoded.
 int length(FSCoder coder)
           
 
Methods inherited from class com.flagstone.transform.FSTransformObject
clone, name, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ShowFrame

public static final int ShowFrame
Type used to identify ShowFrame objects.

See Also:
Constant Field Values

DefineShape

public static final int DefineShape
Type used to identify DefineShape objects.

See Also:
Constant Field Values

PlaceObject

public static final int PlaceObject
Type used to identify PlaceObject objects.

See Also:
Constant Field Values

RemoveObject

public static final int RemoveObject
Type used to identify RemoveObject objects.

See Also:
Constant Field Values

DefineJPEGImage

public static final int DefineJPEGImage
Type used to identify DefineJPEGImage objects.

See Also:
Constant Field Values

DefineButton

public static final int DefineButton
Type used to identify DefineButton objects.

See Also:
Constant Field Values

JPEGTables

public static final int JPEGTables
Type used to identify JPEGTables objects.

See Also:
Constant Field Values

SetBackgroundColor

public static final int SetBackgroundColor
Type used to identify SetBackgroundColor objects.

See Also:
Constant Field Values

DefineFont

public static final int DefineFont
Type used to identify DefineFont objects.

See Also:
Constant Field Values

DefineText

public static final int DefineText
Type used to identify DefineText objects.

See Also:
Constant Field Values

DoAction

public static final int DoAction
Type used to identify DoAction objects.

See Also:
Constant Field Values

FontInfo

public static final int FontInfo
Type used to identify FontInfo objects.

See Also:
Constant Field Values

DefineSound

public static final int DefineSound
Type used to identify DefineSound objects.

See Also:
Constant Field Values

StartSound

public static final int StartSound
Type used to identify StartSound objects.

See Also:
Constant Field Values

SoundStreamHead

public static final int SoundStreamHead
Type used to identify SoundStreamHead objects.

See Also:
Constant Field Values

SoundStreamBlock

public static final int SoundStreamBlock
Type used to identify SoundStreamBlock objects.

See Also:
Constant Field Values

ButtonSound

public static final int ButtonSound
See Also:
Constant Field Values

DefineImage

public static final int DefineImage
See Also:
Constant Field Values

DefineJPEGImage2

public static final int DefineJPEGImage2
See Also:
Constant Field Values

DefineShape2

public static final int DefineShape2
See Also:
Constant Field Values

ButtonColorTransform

public static final int ButtonColorTransform
See Also:
Constant Field Values

Protect

public static final int Protect
See Also:
Constant Field Values

Free

public static final int Free
See Also:
Constant Field Values

PlaceObject2

public static final int PlaceObject2
See Also:
Constant Field Values

RemoveObject2

public static final int RemoveObject2
See Also:
Constant Field Values

DefineShape3

public static final int DefineShape3
See Also:
Constant Field Values

DefineText2

public static final int DefineText2
See Also:
Constant Field Values

DefineButton2

public static final int DefineButton2
See Also:
Constant Field Values

DefineJPEGImage3

public static final int DefineJPEGImage3
See Also:
Constant Field Values

DefineImage2

public static final int DefineImage2
See Also:
Constant Field Values

DefineMovieClip

public static final int DefineMovieClip
See Also:
Constant Field Values

FrameLabel

public static final int FrameLabel
See Also:
Constant Field Values

SoundStreamHead2

public static final int SoundStreamHead2
See Also:
Constant Field Values

DefineMorphShape

public static final int DefineMorphShape
See Also:
Constant Field Values

DefineFont2

public static final int DefineFont2
See Also:
Constant Field Values

PathsArePostscript

public static final int PathsArePostscript
See Also:
Constant Field Values

DefineTextField

public static final int DefineTextField
See Also:
Constant Field Values

QuicktimeMovie

public static final int QuicktimeMovie
See Also:
Constant Field Values

SerialNumber

public static final int SerialNumber
See Also:
Constant Field Values

DefineBitsPtr

public static final int DefineBitsPtr
See Also:
Constant Field Values

Export

public static final int Export
See Also:
Constant Field Values

Import

public static final int Import
See Also:
Constant Field Values

EnableDebugger

public static final int EnableDebugger
See Also:
Constant Field Values

Initialize

public static final int Initialize
See Also:
Constant Field Values

DefineVideo

public static final int DefineVideo
See Also:
Constant Field Values

VideoFrame

public static final int VideoFrame
See Also:
Constant Field Values

FontInfo2

public static final int FontInfo2
See Also:
Constant Field Values

EnableDebugger2

public static final int EnableDebugger2
See Also:
Constant Field Values

LimitScript

public static final int LimitScript
See Also:
Constant Field Values

TabOrder

public static final int TabOrder
See Also:
Constant Field Values

type

protected int type

length

protected int length

extendLength

protected boolean extendLength
Constructor Detail

FSMovieObject

protected FSMovieObject(int aType)
Constructs a movie object with the specified type.

Parameters:
aType - an identifier indicating the type of movie object.

FSMovieObject

protected FSMovieObject(FSMovieObject obj)
Constructs a movie object by copying an existing one.

Parameters:
obj - an FSMovieObject object.
Method Detail

getType

public int getType()
Gets the code used that identifies the type of the object when it is encoded.

Returns:
the code used to denote the type of the object.

equals

public boolean equals(java.lang.Object anObject)
Returns true if anObject is equal to this one. Objects are considered equal if they would generate identical binary data when they are encoded to a Flash file.

Overrides:
equals in class FSTransformObject
Returns:
true if this object would be identical to anObject when encoded.

appendDescription

public void appendDescription(java.lang.StringBuffer buffer,
                              int depth)
Description copied from class: FSTransformObject
AppendDescription is used to present a string description of the object including all nested objects up to a specified depth. This method provide a more controlled way of creating a string representation of an object since large objects such as font or shape definitions can contain dozens of nested objects. The representation of the object is appended to the StringBuffer, showing the name of the class and values of the attributes it contains. If the object contains any attributes that are objects then the object graph will be traversed up to the specified depth. If objects are nested at a level less than specified depth then the full string representation of the object is displayed. For objects at the specified depth only the name of the class is displayed. Any objects below this depth are not displayed.

Specified by:
appendDescription in class FSTransformObject
Parameters:
buffer - a StringBuffer to which the description of each object is appended.
depth - the maximum level of nesting up to which objects will be displayed.

length

public int length(FSCoder coder)
Specified by:
length in class FSTransformObject

encode

public void encode(FSCoder coder)
Specified by:
encode in class FSTransformObject

decode

public void decode(FSCoder coder)
Specified by:
decode in class FSTransformObject