⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 swftagdumper.java

📁 java版本的flash文件(swf)播放器
💻 JAVA
📖 第 1 页 / 共 3 页
字号:
        if( dumpHex )
        {
            Hex.dump( writer, imageData, 0L, indent + "    ", false );
            println( "--- Alpha Channel follows ---" );
            Hex.dump( writer, alphaData, 0L, indent + "    ", false );
            println( dashes );
        }         
    }                
    
    /**
     * SWFTagTypes interface
     */
    public void tagDefineSound( int id, int format, int frequency,
                                boolean bits16, boolean stereo,
                                int sampleCount, byte[] soundData ) throws IOException
    {
        String freq = "5.5";
        if( frequency == SWFConstants.SOUND_FREQ_11KHZ ) freq = "11";
        if( frequency == SWFConstants.SOUND_FREQ_22KHZ ) freq = "22";
        if( frequency == SWFConstants.SOUND_FREQ_44KHZ ) freq = "44";        
        
        String formatS = "RawSamples";
        if( format == SWFConstants.SOUND_FORMAT_ADPCM ) formatS = "ADPCM";
        if( format == SWFConstants.SOUND_FORMAT_MP3   ) formatS = "MP3";        
        
        
        println( "define sound: id=" + id + " format=" + formatS + 
                 " freq=" + freq + "kHz 16bit=" + bits16 +
                 " stereo=" + stereo + " samples=" + sampleCount );
        
        if( dumpHex )
        {
            Hex.dump( writer, soundData, 0L, indent + "    ", false );
            println( dashes );
        }        
    }                
    
    /**
     * SWFTagTypes interface
     */
    public void tagDefineButtonSound( int buttonId,
                    int rollOverSoundId, SoundInfo rollOverSoundInfo,
                    int rollOutSoundId,  SoundInfo rollOutSoundInfo,
                    int pressSoundId,    SoundInfo pressSoundInfo,
                    int releaseSoundId,  SoundInfo releaseSoundInfo )
        throws IOException
    {
        println( "define button sound: id=" + buttonId );
        println( "    roll-over sound=" + rollOverSoundId + " " + rollOverSoundInfo );
        println( "    roll-out  sound=" + rollOutSoundId  + " " + rollOutSoundInfo );
        println( "    press     sound=" + pressSoundId    + " " + pressSoundInfo );
        println( "    release   sound=" + releaseSoundId  + " " + releaseSoundInfo );       
    }                
    
    /**
     * SWFTagTypes interface
     */
    public void tagShowFrame() throws IOException
    {
        println( "---------- frame ----------" );
    }
    
    /**
     * SWFTagTypes interface
     */
    public SWFActions tagDoAction() throws IOException
    {
        println( "actions:" );
        
        ActionTextWriter acts = new ActionTextWriter( writer );
        acts.indent = "    " + indent ;
        return acts;
    }
    
	/**
	 * SWFTagTypes interface
	 */
	public SWFActions tagDoInitAction( int spriteId ) throws IOException
	{
		println( "init actions for sprite " + spriteId + ":" );
        
		ActionTextWriter acts = new ActionTextWriter( writer );
		acts.indent = "    " + indent ;
		return acts;
	}
    
    /**
     * SWFTagTypes interface
     */
    public SWFShape tagDefineShape( int id, Rect outline ) throws IOException
    {
        println( "shape id=" + id + "   " + outline );
        return this;
    }
    
    
    /**
     * SWFTagTypes interface
     */
    public SWFShape tagDefineShape2( int id, Rect outline ) throws IOException
    {
        println( "shape2 id=" + id + "   " + outline );
        return this;
    }
    
    /**
     * SWFTagTypes interface
     */
    public SWFShape tagDefineShape3( int id, Rect outline ) throws IOException
    {
        println( "shape3 id=" + id + "   " + outline );
        return this;

    }    
    
    /**
     * SWFTagTypes interface
     */    
    public void tagFreeCharacter( int charId ) throws IOException 
    {
        println( "free character id=" + charId );
    }
    
    /**
     * SWFTagTypes interface
     */    
    public void tagPlaceObject( int charId, int depth, 
                                Matrix matrix, AlphaTransform cxform ) 
        throws IOException
    {
        println( "place-object id=" + charId + 
                 " depth=" + depth + "  " + matrix + "  " + cxform );
    }
    
    /**
     * SWFTagTypes interface
     */    
    public SWFActions tagPlaceObject2( boolean isMove,
                                       int clipDepth,
                                       int depth,
                                       int charId,
                                       Matrix matrix,
                                       AlphaTransform cxform,
                                       int ratio,
                                       String name,
                                       int clipActionFlags )  
        throws IOException    
    {
        println( "place-object2 move=" + isMove +
                 " id=" + charId +                         
                 " depth=" + depth + 
                 " clip=" + clipDepth +
                 " ratio=" + ratio +
                 " name=" + name +
                 "  " + matrix + "  " + cxform );
        
        if( clipActionFlags != 0 )
        {
            println( "  clip-actions:" );
            
            ActionTextWriter acts = new ActionTextWriter( writer );
            acts.indent = "    " + indent ;
            return acts;
        }
        
        return null;
    }
        
    /**
     * SWFTagTypes interface
     */ 
    public void tagRemoveObject( int charId, int depth ) throws IOException
    {
        println( "remove-object id=" + charId + " depth=" + depth );
    }
        
    /**
     * SWFTagTypes interface
     */ 
    public void tagRemoveObject2(int depth ) throws IOException
    {
        println( "remove-object2 depth=" + depth );
    }

    /**
     * SWFTagTypes interface
     */ 
    public void tagSetBackgroundColor( Color color ) throws IOException
    {
        println( "background-color  " + color );        
    }

    /**
     * SWFTagTypes interface
     */ 
    public void tagFrameLabel( String label ) throws IOException
    {
        println( "frame-label " + label );
    }
    
	/**
	 * SWFTagTypes interface
	 */     
	public void tagFrameLabel( String label, boolean isAnchor ) throws IOException {    
		println( "frame-label " + label + ( isAnchor ? " (anchor)" : "") );
	}     
    
    /**
     * SWFTagTypes interface
     */ 
    public SWFTagTypes tagDefineSprite( int id ) throws IOException
    {
        println( "sprite id=" + id );
        
        SWFTagDumper dumper = new SWFTagDumper( writer, dumpHex, decompileActions );
        dumper.indent = indent + "    ";
        return dumper;
    }
    
    /**
     * SWFTagTypes interface
     */ 
    public void tagProtect( byte[] password ) throws IOException
    {
        println( "protect" );
    }
    
    /**
     * SWFTagTypes interface
     */ 
    public void tagEnableDebug( byte[] password ) throws IOException
    {
        println( "enable-debug" );        
    }
        
	/**
	 * SWFTagTypes interface
	 */ 
	public void tagEnableDebug2( byte[] password ) throws IOException
	{
		println( "enable-debug-2" );        
	}
        
    /**
     * SWFTagTypes interface
     */ 
    public SWFVectors tagDefineFont( int id, int numGlyphs ) throws IOException
    {
        println( "font id=" + id );
        return this;
    }

    /**
     * SWFTagTypes interface
     */ 
    public void tagDefineFontInfo( int fontId, String fontName, int flags, int[] codes )
        throws IOException
    {
        println( "font-info id=" + fontId + " name=" + fontName + 
                 " flags=" + Integer.toBinaryString( flags ) + " codes=" + codes.length );
    }

	/**
	 * SWFTagTypes interface
	 */ 
	public void tagDefineFontInfo2( int fontId, String fontName, int flags, int[] codes, int languageCode )
		throws IOException
	{
		println( "font-info2 id=" + fontId + " name=" + fontName + 
				 " flags=" + Integer.toBinaryString( flags ) + 
                 " codes=" + codes.length + " language=" + languageCode );
	}
    
    /**
     * SWFTagTypes interface
     */ 
    public SWFVectors tagDefineFont2( int id, int flags, String name, int numGlyphs,
                                      int ascent, int descent, int leading,
                                      int[] codes, int[] advances, Rect[] bounds,
                                      int[] kernCodes1, int[] kernCodes2,
                                      int[] kernAdjustments ) throws IOException
    {
        println( "font2 id=" + id + " flags=" + Integer.toBinaryString( flags ) +
                 " name=" + name + " ascent=" + ascent + " descent=" + descent +
                 " leading=" + leading + " has-kerns=" + (kernCodes1 != null));
        
        return this;
    }
    
    /**
     * SWFTagTypes interface
     */ 
    public void tagDefineTextField( int fieldId, String fieldName,
                    String initialText, Rect boundary, int flags,
                    AlphaColor textColor, int alignment, int fontId, int fontSize, 
                    int charLimit, int leftMargin, int rightMargin, int indentation,
                    int lineSpacing ) 
        throws IOException
    {
    	if( initialText != null ) {
    		initialText = initialText.replace( '\r', ' ' );
			initialText = initialText.replace( '\n', ' ' );
			initialText = initialText.replace( '\b', ' ' );
     	}
    	
        println( "edit-field id=" + fieldId + " name=" + fieldName +
                 " text=" + initialText + " font=" + fontId + " size=" + fontSize +
                 " chars=" + charLimit + " left=" + leftMargin +
                 " right=" + rightMargin + " indent=" + indentation +
                 " spacing=" + lineSpacing + " alignment=" + alignment +
                 " flags=" + Integer.toBinaryString( flags ) +
                 " " + textColor );        
    }

    /**
     * SWFTagTypes interface
     */ 
    public SWFText tagDefineText( int id, Rect bounds, Matrix matrix )
        throws IOException
    { 
        println( "text id=" + id + " " + bounds + " " + matrix );
        return this;
    }

    /**
     * SWFTagTypes interface
     */ 
    public SWFText tagDefineText2( int id, Rect bounds, Matrix matrix ) throws IOException
    { 
        println( "text2 id=" + id + " " + bounds + " " + matrix );
        return this;
    }
    
    /**
     * SWFTagTypes interface
     */ 
    public SWFActions tagDefineButton( int id, Vector buttonRecords )
        throws IOException
    {
        println( "button id=" + id );
        
        for( Enumeration enum = buttonRecords.elements(); enum.hasMoreElements(); )
        {
            ButtonRecord rec = (ButtonRecord)enum.nextElement();
            println( "  " + rec );
        }

        println( "  actions:" );
        
        ActionTextWriter acts = new ActionTextWriter( writer );
        acts.indent = "    " + indent ;
        return acts;
    }
    
    /**
     * SWFTagTypes interface
     */ 
    public void tagButtonCXForm( int buttonId, ColorTransform transform ) 
        throws IOException
    {
        println( "button-cxform id=" + buttonId + "  " + transform );
    }
        
    /**
     * SWFTagTypes interface
     */ 
    public SWFActions tagDefineButton2( int id, 
                                        boolean trackAsMenu, 
                                        Vector buttonRecord2s )
        throws IOException
    {
        println( "button2 id=" + id + " track-as-menu=" + trackAsMenu );
        
        for( Enumeration enum = buttonRecord2s.elements(); enum.hasMoreElements(); )
        {
            ButtonRecord2 rec = (ButtonRecord2)enum.nextElement();
            println( "  " + rec );
        }

        println( "  actions:" );
        
        ActionTextWriter acts = new ActionTextWriter( writer );
        acts.indent = "    " + indent ;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -