pt.tumba.parser.swf
Class TagParser

java.lang.Object
  extended by pt.tumba.parser.swf.TagParser
All Implemented Interfaces:
SWFConstants, SWFHeader, SWFTags

public class TagParser
extends java.lang.Object
implements SWFTags, SWFConstants

Parse Tags and drive a SWFTagTypes interface.

Author:
unknown

Field Summary
protected  SWFTagTypes tagtypes
          Description of the Field
 
Fields inherited from interface pt.tumba.parser.swf.SWFConstants
BITMAP_FORMAT_16_BIT, BITMAP_FORMAT_32_BIT, BITMAP_FORMAT_8_BIT, BUTTON2_IDLE2OVERDOWN, BUTTON2_IDLE2OVERUP, BUTTON2_OUTDOWN2IDLE, BUTTON2_OUTDOWN2OVERDOWN, BUTTON2_OVERDOWN2IDLE, BUTTON2_OVERDOWN2OUTDOWN, BUTTON2_OVERDOWN2OVERUP, BUTTON2_OVERUP2IDLE, BUTTON2_OVERUP2OVERDOWN, CLIP_ACTION_DATA, CLIP_ACTION_ENTER_FRAME, CLIP_ACTION_KEY_DOWN, CLIP_ACTION_KEY_UP, CLIP_ACTION_MOUSE_DOWN, CLIP_ACTION_MOUSE_MOVE, CLIP_ACTION_MOUSE_UP, CLIP_ACTION_ON_LOAD, CLIP_ACTION_UNLOAD, FILL_CLIPPED_BITMAP, FILL_LINEAR_GRADIENT, FILL_RADIAL_GRADIENT, FILL_SOLID, FILL_TILED_BITMAP, FONT_ANSI, FONT_BOLD, FONT_ITALIC, FONT_SHIFTJIS, FONT_UNICODE, FONT_WIDECHARS, FONT2_32OFFSETS, FONT2_ANSI, FONT2_BOLD, FONT2_HAS_LAYOUT, FONT2_ITALIC, FONT2_SHIFTJIS, FONT2_UNICODE, FONT2_WIDECHARS, SOUND_FORMAT_ADPCM, SOUND_FORMAT_MP3, SOUND_FORMAT_RAW, SOUND_FREQ_11KHZ, SOUND_FREQ_22KHZ, SOUND_FREQ_44KHZ, SOUND_FREQ_5_5KHZ, TAG_DEFINEBITS, TAG_DEFINEBITSJPEG2, TAG_DEFINEBITSJPEG3, TAG_DEFINEBITSLOSSLESS, TAG_DEFINEBITSLOSSLESS2, TAG_DEFINEBUTTON, TAG_DEFINEBUTTON2, TAG_DEFINEBUTTONCXFORM, TAG_DEFINEBUTTONSOUND, TAG_DEFINEFONT, TAG_DEFINEFONT2, TAG_DEFINEFONTINFO, TAG_DEFINEMORPHSHAPE, TAG_DEFINEQUICKTIMEMOVIE, TAG_DEFINESHAPE, TAG_DEFINESHAPE2, TAG_DEFINESHAPE3, TAG_DEFINESOUND, TAG_DEFINESPRITE, TAG_DEFINETEXT, TAG_DEFINETEXT2, TAG_DEFINETEXTFIELD, TAG_DOACTION, TAG_ENABLEDEBUG, TAG_END, TAG_EXPORT, TAG_FLASHGENERATOR, TAG_FRAMELABEL, TAG_FREECHARACTER, TAG_GEN_EXTERNAL_FONT, TAG_GENERATOR_TEXT, TAG_IMPORT, TAG_JPEGTABLES, TAG_NAMECHARACTER, TAG_PLACEOBJECT, TAG_PLACEOBJECT2, TAG_PROTECT, TAG_REMOVEOBJECT, TAG_REMOVEOBJECT2, TAG_SERIALNUMBER, TAG_SETBACKGROUNDCOLOR, TAG_SHOWFRAME, TAG_SOUNDSTREAMBLOCK, TAG_SOUNDSTREAMHEAD, TAG_SOUNDSTREAMHEAD2, TAG_STARTSOUND, TAG_TEMPLATECOMMAND, TEXT_HAS_COLOR, TEXT_HAS_FONT, TEXT_HAS_XOFFSET, TEXT_HAS_YOFFSET, TEXTFIELD_ALIGN_CENTER, TEXTFIELD_ALIGN_JUSTIFY, TEXTFIELD_ALIGN_LEFT, TEXTFIELD_ALIGN_RIGHT, TEXTFIELD_DISABLE_EDIT, TEXTFIELD_DRAW_BORDER, TEXTFIELD_FONT_GLYPHS, TEXTFIELD_HAS_FONT, TEXTFIELD_HAS_LAYOUT, TEXTFIELD_HAS_TEXT, TEXTFIELD_HAS_TEXT_COLOR, TEXTFIELD_HTML, TEXTFIELD_IS_MULTILINE, TEXTFIELD_IS_PASSWORD, TEXTFIELD_LIMIT_CHARS, TEXTFIELD_NO_SELECTION, TEXTFIELD_WORD_WRAP, TWIPS
 
Constructor Summary
TagParser(SWFTagTypes tagtypes)
          Constructor for the TagParser object
 
Method Summary
 void header(int version, long length, int twipsWidth, int twipsHeight, int frameRate, int frameCount)
          Interface SWFTags
static void main(java.lang.String[] args)
          The main program for the TagParser class
protected  void parseButtonCXForm(InStream in)
          Description of the Method
protected  void parseChangeRecord(InStream in, int flags, SWFVectors vectors, SWFShape shape, boolean hasAlpha, int[] numFillBits2, int[] numLineBits2)
          Description of the Method
protected  void parseDefineBits(InStream in)
          Description of the Method
protected  void parseDefineBitsJPEG3(InStream in)
          Description of the Method
protected  void parseDefineBitsLossless(InStream in, int length, boolean hasAlpha)
          Description of the Method
protected  void parseDefineButton(InStream in)
          Description of the Method
protected  void parseDefineButton2(InStream in)
          Description of the Method
protected  void parseDefineButtonSound(InStream in)
          Description of the Method
protected  void parseDefineFont(InStream in)
          Description of the Method
protected  void parseDefineFont2(InStream in)
          Description of the Method
protected  void parseDefineJPEG2(InStream in, int length)
          Description of the Method
protected  void parseDefineJPEGTables(InStream in)
          Description of the Method
protected  void parseDefineShape(int type, InStream in)
          Description of the Method
protected  void parseDefineSound(InStream in)
          Description of the Method
protected  void parseDefineSprite(InStream in)
          Description of the Method
protected  void parseDefineText(int type, InStream in)
          Description of the Method
protected  void parseDefineTextField(InStream in)
          Description of the Method
protected  void parseDoAction(InStream in)
          Description of the Method
protected  void parseExport(InStream in)
          Description of the Method
 void parseFillStyle(InStream in, SWFShape shape, boolean hasAlpha)
          Description of the Method
protected  void parseFontInfo(InStream in, int length2)
          Description of the Method
protected  void parseImport(InStream in)
          Description of the Method
 void parseLineStyle(InStream in, SWFShape shape, boolean hasAlpha)
          Description of the Method
protected  void parseMorphFillStyle(InStream in, SWFShape shape)
          Description of the Method
protected  void parseMorphLineStyle(InStream in, SWFShape shape)
          Description of the Method
protected  void parseMorphShape(InStream in)
          Description of the Method
protected  void parsePlaceObject(InStream in, int length)
          Description of the Method
protected  void parsePlaceObject2(InStream in)
          Description of the Method
protected  void parseShape(InStream in, SWFVectors vectors, boolean hasStyle, boolean hasAlpha)
          Description of the Method
protected  void parseSoundStreamBlock(InStream in)
          Description of the Method
protected  void parseSoundStreamHead(boolean adpcmOnly, InStream in)
          Description of the Method
protected  void parseStartSound(InStream in)
          Description of the Method
protected  void parseStyles(InStream in, SWFShape shape, boolean hasAlpha)
          Description of the Method
 void tag(int tagType, boolean longTag, byte[] contents)
          Interface SWFTags
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagtypes

protected SWFTagTypes tagtypes
Description of the Field

Constructor Detail

TagParser

public TagParser(SWFTagTypes tagtypes)
Constructor for the TagParser object

Parameters:
tagtypes - Description of the Parameter
Method Detail

header

public void header(int version,
                   long length,
                   int twipsWidth,
                   int twipsHeight,
                   int frameRate,
                   int frameCount)
            throws java.io.IOException
Interface SWFTags

Specified by:
header in interface SWFHeader
Parameters:
version - Description of the Parameter
length - Description of the Parameter
twipsWidth - Description of the Parameter
twipsHeight - Description of the Parameter
frameRate - Description of the Parameter
frameCount - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

tag

public void tag(int tagType,
                boolean longTag,
                byte[] contents)
         throws java.io.IOException
Interface SWFTags

Specified by:
tag in interface SWFTags
Parameters:
tagType - Description of the Parameter
longTag - Description of the Parameter
contents - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineSound

protected void parseDefineSound(InStream in)
                         throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseStartSound

protected void parseStartSound(InStream in)
                        throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineButtonSound

protected void parseDefineButtonSound(InStream in)
                               throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseSoundStreamHead

protected void parseSoundStreamHead(boolean adpcmOnly,
                                    InStream in)
                             throws java.io.IOException
Description of the Method

Parameters:
adpcmOnly - Description of the Parameter
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseSoundStreamBlock

protected void parseSoundStreamBlock(InStream in)
                              throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineBits

protected void parseDefineBits(InStream in)
                        throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineJPEGTables

protected void parseDefineJPEGTables(InStream in)
                              throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineBitsJPEG3

protected void parseDefineBitsJPEG3(InStream in)
                             throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseMorphShape

protected void parseMorphShape(InStream in)
                        throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseMorphLineStyle

protected void parseMorphLineStyle(InStream in,
                                   SWFShape shape)
                            throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
shape - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseMorphFillStyle

protected void parseMorphFillStyle(InStream in,
                                   SWFShape shape)
                            throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
shape - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineJPEG2

protected void parseDefineJPEG2(InStream in,
                                int length)
                         throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
length - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineBitsLossless

protected void parseDefineBitsLossless(InStream in,
                                       int length,
                                       boolean hasAlpha)
                                throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
length - Description of the Parameter
hasAlpha - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseExport

protected void parseExport(InStream in)
                    throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseImport

protected void parseImport(InStream in)
                    throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineButton2

protected void parseDefineButton2(InStream in)
                           throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseButtonCXForm

protected void parseButtonCXForm(InStream in)
                          throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineButton

protected void parseDefineButton(InStream in)
                          throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineText

protected void parseDefineText(int type,
                               InStream in)
                        throws java.io.IOException
Description of the Method

Parameters:
type - Description of the Parameter
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineTextField

protected void parseDefineTextField(InStream in)
                             throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineFont2

protected void parseDefineFont2(InStream in)
                         throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseFontInfo

protected void parseFontInfo(InStream in,
                             int length2)
                      throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
length - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineFont

protected void parseDefineFont(InStream in)
                        throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineSprite

protected void parseDefineSprite(InStream in)
                          throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parsePlaceObject2

protected void parsePlaceObject2(InStream in)
                          throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parsePlaceObject

protected void parsePlaceObject(InStream in,
                                int length)
                         throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
length - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDoAction

protected void parseDoAction(InStream in)
                      throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseDefineShape

protected void parseDefineShape(int type,
                                InStream in)
                         throws java.io.IOException
Description of the Method

Parameters:
type - Description of the Parameter
in - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseShape

protected void parseShape(InStream in,
                          SWFVectors vectors,
                          boolean hasStyle,
                          boolean hasAlpha)
                   throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
vectors - Description of the Parameter
hasStyle - Description of the Parameter
hasAlpha - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseChangeRecord

protected void parseChangeRecord(InStream in,
                                 int flags,
                                 SWFVectors vectors,
                                 SWFShape shape,
                                 boolean hasAlpha,
                                 int[] numFillBits2,
                                 int[] numLineBits2)
                          throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
flags - Description of the Parameter
vectors - Description of the Parameter
shape - Description of the Parameter
hasAlpha - Description of the Parameter
numFillBits - Description of the Parameter
numLineBits - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseStyles

protected void parseStyles(InStream in,
                           SWFShape shape,
                           boolean hasAlpha)
                    throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
shape - Description of the Parameter
hasAlpha - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseLineStyle

public void parseLineStyle(InStream in,
                           SWFShape shape,
                           boolean hasAlpha)
                    throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
shape - Description of the Parameter
hasAlpha - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

parseFillStyle

public void parseFillStyle(InStream in,
                           SWFShape shape,
                           boolean hasAlpha)
                    throws java.io.IOException
Description of the Method

Parameters:
in - Description of the Parameter
shape - Description of the Parameter
hasAlpha - Description of the Parameter
Throws:
java.io.IOException - Description of the Exception

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
The main program for the TagParser class

Parameters:
args - The command line arguments
Throws:
java.io.IOException - Description of the Exception