com.flagstone.transform
Class SymbolClass

java.lang.Object
  extended by com.flagstone.transform.SymbolClass
All Implemented Interfaces:
Copyable<MovieTag>, SWFEncodeable, MovieTag

public final class SymbolClass
extends Object
implements MovieTag

SymbolClass is used to export one or more Actionscript 3 classes so they can be used in another Flash file.


Constructor Summary
SymbolClass()
          Creates a SymbolClass object with an empty table.
SymbolClass(Map<Integer,String> map)
          Creates a SymbolClass object with the specified map.
SymbolClass(SWFDecoder coder)
          Creates and initialises a SymbolClass object using values encoded in the Flash binary format.
SymbolClass(SymbolClass object)
          Creates and initialises a SymbolClass object using the table values copied from another SymbolClass object.
 
Method Summary
 SymbolClass add(int uid, String aString)
          Add a mapping for a unique identifier to an actionscript 3 class.
 SymbolClass copy()
          Creates a complete copy of this object.
 void encode(SWFEncoder coder, Context context)
          Encode an object to the Flash binary format.
 Map<Integer,String> getObjects()
          Get the table that maps identifiers to actionscript 3 classes.
 int prepareToEncode(Context context)
          Prepare an object for encoding, returning the expected size of an object when it is encoded.
 void setObjects(Map<Integer,String> aTable)
          Set the table that maps identifiers to actionscript 3 classes.
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SymbolClass

public SymbolClass(SWFDecoder coder)
            throws IOException
Creates and initialises a SymbolClass object using values encoded in the Flash binary format.

Parameters:
coder - an SWFDecoder object that contains the encoded Flash data.
Throws:
IOException - if an error occurs while decoding the data.

SymbolClass

public SymbolClass()
Creates a SymbolClass object with an empty table.


SymbolClass

public SymbolClass(Map<Integer,String> map)
Creates a SymbolClass object with the specified map.

Parameters:
map - the table containing identifier/class name pairs.

SymbolClass

public SymbolClass(SymbolClass object)
Creates and initialises a SymbolClass object using the table values copied from another SymbolClass object.

Parameters:
object - a SymbolClass object from which the table will be copied.
Method Detail

add

public SymbolClass add(int uid,
                       String aString)
Add a mapping for a unique identifier to an actionscript 3 class.

Parameters:
uid - the unique identifier for the object.
aString - the name of the actionscript 3 class that displays the object.
Returns:
this object.

getObjects

public Map<Integer,String> getObjects()
Get the table that maps identifiers to actionscript 3 classes.

Returns:
the table of identifiers and class names.

setObjects

public void setObjects(Map<Integer,String> aTable)
Set the table that maps identifiers to actionscript 3 classes.

Parameters:
aTable - the table of identifiers and class names.

copy

public SymbolClass copy()
Creates a complete copy of this object.

Specified by:
copy in interface Copyable<MovieTag>
Returns:
a deep-copy of this object. New instances of mutable objects are copied and immutable instances are shared.

toString

public String toString()

Overrides:
toString in class Object

prepareToEncode

public int prepareToEncode(Context context)
Prepare an object for encoding, returning the expected size of an object when it is encoded. This method also used to initialise variables, such as offsets and flags that will be used when the object is encoded. Generally the method returns the size in bytes, however when called on objects that use bit fields such as shapes the methods will return the size in bits.

Specified by:
prepareToEncode in interface SWFEncodeable
Parameters:
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Returns:
the size of the object when it is encoded.

encode

public void encode(SWFEncoder coder,
                   Context context)
            throws IOException
Encode an object to the Flash binary format.

Specified by:
encode in interface SWFEncodeable
Parameters:
coder - an SWFEncoder object.
context - an Context that allows information to be passed between objects to control how they are initialised for encoding.
Throws:
IOException - if an error occurs while encoding the object.


Copyright © 2002-2010 Flagstone Software Ltd.. All Rights Reserved.