亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? movie.java

?? java版本的flash文件(swf)播放器
?? JAVA
字號:
/****************************************************************
 * Copyright (c) 2001, David N. Main, All rights reserved.
 * 
 * Redistribution and use in source and binary forms, with or
 * without modification, are permitted provided that the 
 * following conditions are met:
 *
 * 1. Redistributions of source code must retain the above 
 * copyright notice, this list of conditions and the following 
 * disclaimer. 
 * 
 * 2. Redistributions in binary form must reproduce the above 
 * copyright notice, this list of conditions and the following 
 * disclaimer in the documentation and/or other materials 
 * provided with the distribution.
 * 
 * 3. The name of the author may not be used to endorse or 
 * promote products derived from this software without specific 
 * prior written permission. 
 * 
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY 
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 
 * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 ****************************************************************/
package com.anotherbigidea.flash.movie;

import java.io.*;
import java.util.*;
import com.anotherbigidea.flash.*;
import com.anotherbigidea.flash.interfaces.*;
import com.anotherbigidea.flash.writers.*;
import com.anotherbigidea.flash.readers.*;
import com.anotherbigidea.flash.structs.*;

/**
 * A Flash Movie
 */
public class Movie implements TimeLine 
{
    protected int width;
    protected int height;
    protected int frameRate;
    protected Color backColor;
    protected int version;
    protected boolean isProtected;
    
    protected Map    importLibraries;
    protected Vector exportedSymbols;
    
    protected SortedMap frames = new TreeMap();
    protected int frameCount = 0;
    
    //--Table of characters defined so far in the movie - while writing out
    protected HashMap definedSymbols = new HashMap();

    protected int depth = 1;  //the next available depth
    protected int maxId = 1;  //the next available symbol id    
    
    /**
     * Create a movie with the default values - 
     * (550x400), 12 frames/sec, white backcolor, Flash version 5.
     */
    public Movie()
    {
        width     = 550;
        height    = 400;
        frameRate = 12;
        version   = 5;
    }
    
    /**
     * Create a movie with the given properties
     */
    public Movie( int width, int height, int frameRate, int version, Color backColor )
    {
        this.width     = width;
        this.height    = height;
        this.frameRate = frameRate;
        this.version   = version;
        this.backColor = backColor;
    }
    
    public int   getWidth    () { return width; }
    public int   getHeight   () { return height; }
    public int   getFrameRate() { return frameRate; }
    public int   getVersion  () { return version; }
    public Color getBackColor() { return backColor; }

    public void setWidth    ( int width   ) { this.width     = width; }    
    public void setHeight   ( int height  ) { this.height    = height; }
    public void setFrameRate( int rate    ) { this.frameRate = rate; }    
    public void setVersion  ( int version ) { this.version   = version; }    
    public void setBackColor( Color color ) { this.backColor = color; }    
     
    /**
     * Return the protection flag.  If true then the movie cannot be imported
     * into the Flash Author.  The existence of tools such as JavaSWF makes
     * this kind of protection almost worthless.
     */
    public boolean isProtected() { return isProtected; }
    
    public void protect( boolean isProtected ) { this.isProtected = isProtected; }
    
    /**
     * Get the current number of frames in the timeline.
     */
    public int getFrameCount()
    {
        return frameCount;
    }

    /** 
     * Get the Frame object for the given frame number - or create one if
     * none exists.  If the frame number is larger than the current frame count
     * then the frame count is increased.
     * 
     * @param frameNumber must be 1 or larger
     */
    public Frame getFrame( int frameNumber )
    {
        if( frameNumber < 1 ) return null;
        
        Integer num = new Integer( frameNumber );
        Frame frame = (Frame)frames.get( num );
        
        if( frame == null )
        {
            frame = new Frame( frameNumber, this );
            frames.put( num, frame );
            if( frameNumber > frameCount ) frameCount = frameNumber;
        }
        
        return frame;
    }

    /**
     * Append a frame to the end of the timeline
     */
    public Frame appendFrame()
    {
        frameCount++;
        Frame frame = new Frame( frameCount, this );
        frames.put( new Integer(frameCount), frame );
        return frame;
    }
    
    /**
     * Get the next available depth in the timeline
     */
    public int getAvailableDepth()
    {
        return depth;
    }
    
    /**
     * Set the next available depth in the timeline
     * @param depth must be >= 1
     */
    public void setAvailableDepth( int depth )
    {
        if( depth < 1 ) return;
        this.depth = depth;
    }
    
    /**
     * Import symbols from another movie (Flash 5 only)
     * @return Symbols representing the imports
     */
    public ImportedSymbol[] importSymbols( String libraryName, String[] symbolNames )
    {
        if( importLibraries == null ) importLibraries = new HashMap();
        
        ArrayList imports = (ArrayList)importLibraries.get( libraryName );
        if( imports == null )
        {
            imports = new ArrayList();
            importLibraries.put( libraryName, imports );
        }
        
        ImportedSymbol[] symbols = new ImportedSymbol[ symbolNames.length ];
        
        for( int i = 0; i < symbolNames.length; i++ )
        {
            ImportedSymbol imp = new ImportedSymbol( 0, symbolNames[i], libraryName );
            symbols[i] = imp;
            imports.add( imp );
        }
        
        return symbols;
    }
    
    /**
     * Clear all the defined library imports
     */
    public void clearImports()
    {
        if( importLibraries != null ) importLibraries.clear();
    }

    /**
     * Access the imported symbols.
     * @return an empty array if there are no imports
     */
    public ImportedSymbol[] getImportedSymbols()
    {
        if( importLibraries == null ) return new ImportedSymbol[0];
        
        Vector imports = new Vector();
        
        for( Iterator iter = importLibraries.values().iterator(); iter.hasNext(); )
        {
            List list = (List)iter.next();
            
            for( Iterator i2 = list.iterator(); i2.hasNext(); )
            {
                imports.add( i2.next() );
            }
        }
        
        ImportedSymbol[] imps = new ImportedSymbol[ imports.size() ];
        imports.copyInto( imps );
        
        return imps;
    }
    
    /**
     * Export a number of symbols with the given names so that other movies
     * can import and use them.  Flash version 5 only.
     */
    public void exportSymbols( String[] exportNames, Symbol[] symbols )
    {
        if( exportedSymbols == null ) exportedSymbols = new Vector();
        
        for( int i = 0; i < exportNames.length && i < symbols.length; i++ )
        {
            exportedSymbols.add( new ExportedSymbol( symbols[i], exportNames[i] ));
        }
    }
    
    /**
     * Get the symbols exported from the movie
     * @return an empty array if there are no exports
     */
    public ExportedSymbol[] getExportedSymbols()
    {
        if( exportedSymbols == null ) return new ExportedSymbol[0];
        
        ExportedSymbol[] exports = new ExportedSymbol[ exportedSymbols.size() ];
        
        exportedSymbols.copyInto( exports );
        
        return exports;
    }
    
    /**
     * Clear all the symbol exports
     */
    public void clearExports()        
    {
        if( exportedSymbols != null ) exportedSymbols.clear();
    }
    
    /**
     * Write the movie in SWF format.
     */
    public void write( SWFTagTypes tagwriter ) throws IOException
    {
        //--Reset state
        definedSymbols.clear();
        maxId = 1;

        tagwriter.header( version, 
                          -1,  //force length calculation
                          width  * SWFConstants.TWIPS,
                          height * SWFConstants.TWIPS,
                          frameRate,
                          -1); //force frame calculation
        
        //default backColor is white
        if( backColor == null ) backColor = new Color(255,255,255);
        
        tagwriter.tagSetBackgroundColor( backColor );

        if( isProtected ) tagwriter.tagProtect( null );
        
        //--Process Imports
        if( importLibraries != null && ! importLibraries.isEmpty() )
        {
            for( Iterator keys = importLibraries.keySet().iterator(); keys.hasNext();)
            {
                String libName = (String)keys.next();
                List   imports = (List)importLibraries.get( libName );
                
                String[] names = new String[imports.size()];
                int[]    ids   = new int[imports.size()];
                
                int i = 0;
                for( Iterator it = imports.iterator(); it.hasNext(); )
                {
                    ImportedSymbol imp = (ImportedSymbol)it.next();
                    
                    names[i] = imp.getName();
                    ids[i]   = imp.define( this, tagwriter, tagwriter );
                    
                    i++;
                }
                
                tagwriter.tagImport( libName, names, ids );
            }
        }
        
        //--Process Exports
        if( exportedSymbols != null && ! exportedSymbols.isEmpty() )
        {
            String[] names = new String[exportedSymbols.size()];
            int[]    ids   = new int[exportedSymbols.size()];

            int i = 0;
            for( Iterator it = exportedSymbols.iterator(); it.hasNext(); )
            {
                ExportedSymbol exp = (ExportedSymbol)it.next();
                    
                names[i] = exp.getExportName();
                ids[i]   = exp.getSymbol().define( this, tagwriter, tagwriter );
                    
                i++;
            }            
            
            tagwriter.tagExport( names, ids );
        }
        
        int lastFrame = 0;
        for( Iterator iter = frames.values().iterator(); iter.hasNext(); )
        {            
            Frame frame = (Frame)iter.next();
            
            int number = frame.getFrameNumber();
            
            //write any intermediate empty frames
            while( number > lastFrame + 1 )
            {
                tagwriter.tagShowFrame();
                lastFrame++;
            }
            
            frame.write( this, tagwriter, tagwriter );
            
            lastFrame = number;
        }
        
        //end of time line
        tagwriter.tagEnd();
    }
    
    /**
     * Write the movie in uncompressed SWF format to the given file.
     */
    public void write( String filename ) throws IOException {
    	write( filename, false );
    }
    
    /**
     * Write the movie in uncompressed SWF format to the given output stream.
     */
    public void write( OutputStream out ) throws IOException {
    	write( out, false );
    }

	/**
	 * Write the movie in SWF format to the given file.
	 * 
	 * @param compressed true for Flash MX+ compression.
	 */
	public void write( String filename, boolean compressed ) throws IOException {
		SWFWriter swfwriter = new SWFWriter( filename );
		TagWriter tagwriter = new TagWriter( swfwriter );
		swfwriter.setCompression( compressed );
		write( tagwriter );
	}
    
	/**
	 * Write the movie in SWF format to the given output stream.
	 * 
	 * @param compressed true for Flash MX+ compression.
	 */
	public void write( OutputStream out, boolean compressed ) throws IOException {
		SWFWriter swfwriter = new SWFWriter( out );
		TagWriter tagwriter = new TagWriter( swfwriter );
		swfwriter.setCompression( compressed );
		write( tagwriter );
	}


}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜三级在线| 欧美精品一二三区| 亚洲欧洲日本在线| 国内精品免费**视频| 日韩精品在线网站| 国产一区二区三区在线观看免费视频| 日韩欧美精品三级| 国产精品一品二品| 亚洲天堂a在线| 色菇凉天天综合网| 五月天亚洲婷婷| 日韩欧美一级片| 丁香啪啪综合成人亚洲小说| 国产精品国产三级国产专播品爱网| 91视频在线看| 肉色丝袜一区二区| 精品成人一区二区三区| 国产成人免费9x9x人网站视频| 国产精品对白交换视频| 欧美午夜精品一区| 国产一区二区影院| 亚洲人精品一区| 欧美一级免费观看| 国产高清精品在线| 亚洲国产精品人人做人人爽| 精品国产一区二区在线观看| 波多野结衣91| 亚洲大片免费看| 欧美国产在线观看| 欧美日韩一区二区电影| 国产一区二区在线影院| 夜夜精品视频一区二区| 欧美电影免费观看高清完整版在 | 99国产麻豆精品| 性做久久久久久久免费看| 精品国产91九色蝌蚪| 91麻豆自制传媒国产之光| 裸体歌舞表演一区二区| 亚洲美女视频在线| 国产性天天综合网| 欧美人与禽zozo性伦| 国产成人在线观看| 日韩在线a电影| 国产精品国产三级国产普通话蜜臀| 欧美日本一区二区三区| 成人午夜视频免费看| 婷婷国产在线综合| 亚洲色图制服丝袜| 久久综合成人精品亚洲另类欧美 | 亚洲天堂中文字幕| 日韩精品一区二区三区老鸭窝| 91美女片黄在线观看| 国产一区二区三区在线看麻豆| 午夜精品久久久久久久| 一区二区三区中文在线| 国产精品毛片久久久久久久| 欧美电影免费观看高清完整版在 | 欧美性xxxxxx少妇| 成人的网站免费观看| 韩国女主播成人在线观看| 日韩制服丝袜先锋影音| 亚洲自拍另类综合| 亚洲人成网站在线| 亚洲欧美综合色| 国产精品女人毛片| 国产日韩在线不卡| 久久久久久久久一| 久久综合色之久久综合| 欧美成人一区二区三区在线观看 | 国产亲近乱来精品视频| 日韩欧美一级二级| 日韩欧美色综合| 91精品国模一区二区三区| 欧美高清视频www夜色资源网| 欧美性受极品xxxx喷水| 日本韩国欧美一区| 色噜噜狠狠成人中文综合| av电影天堂一区二区在线观看| 国产成人久久精品77777最新版本| 久草精品在线观看| 国内成人免费视频| 国产精品香蕉一区二区三区| 国产成人丝袜美腿| 国产成人免费视频一区| 国产成人免费视频网站高清观看视频 | 欧美激情中文字幕| 一区视频在线播放| 亚洲久草在线视频| 亚洲高清免费在线| 日本aⅴ亚洲精品中文乱码| 蜜臀av性久久久久蜜臀aⅴ | 欧美成人一级视频| 欧美精品一区二区三区蜜桃 | 99久久久久免费精品国产 | 欧美日韩成人综合| 欧美乱妇20p| 欧美本精品男人aⅴ天堂| 久久综合国产精品| 国产精品久久久久久久久动漫 | 亚洲三级免费电影| 一区二区三区**美女毛片| 亚洲一区在线观看视频| 日韩高清不卡一区二区| 国产一区二区三区精品视频| www.在线成人| 欧美巨大另类极品videosbest | 欧美性色aⅴ视频一区日韩精品| 欧美一级片免费看| 国产精品污网站| 一区二区三区在线免费播放| 蜜桃视频在线一区| 成人午夜在线播放| 欧美乱妇一区二区三区不卡视频| 久久综合九色综合欧美就去吻| 国产精品久久午夜| 日韩二区在线观看| 国产1区2区3区精品美女| 欧美性猛交一区二区三区精品| 日韩欧美国产一区二区三区| 中文字幕亚洲在| 五月天亚洲精品| 成熟亚洲日本毛茸茸凸凹| 欧美三级电影在线观看| 久久免费国产精品| 午夜伊人狠狠久久| 成人性生交大片免费看视频在线| 欧美日韩综合在线| 国产欧美精品一区aⅴ影院| 夜夜嗨av一区二区三区四季av | 色综合天天综合给合国产| 欧美一区二区三区色| 自拍偷自拍亚洲精品播放| 麻豆精品在线播放| 在线观看亚洲a| 国产日韩欧美电影| 奇米精品一区二区三区在线观看| 99v久久综合狠狠综合久久| 欧美哺乳videos| 日韩国产高清在线| 欧美色图片你懂的| 国产精品视频观看| 激情图片小说一区| 8x8x8国产精品| 一区二区三区欧美久久| 成人丝袜18视频在线观看| 日韩精品一区二区三区在线观看| 一片黄亚洲嫩模| 99riav一区二区三区| 国产欧美日韩精品在线| 精品一区二区在线视频| 欧美一区二区精品| 亚洲高清免费观看| 91久久精品一区二区二区| 国产精品久久午夜| 高清国产一区二区| 久久久美女毛片| 精品一区二区三区久久久| 日韩一级黄色片| 天堂成人免费av电影一区| 欧美亚洲高清一区二区三区不卡| 中文字幕一区二区三区色视频| 国产精品白丝jk白祙喷水网站 | 成人午夜免费视频| 久久久久国产一区二区三区四区 | 777午夜精品视频在线播放| 亚洲成人精品在线观看| 欧美在线观看禁18| 一区二区成人在线| 欧美日韩成人综合天天影院| 日韩影视精彩在线| 欧美一区二区日韩| 久久精品99国产国产精| 欧美tk丨vk视频| 国产自产2019最新不卡| 精品理论电影在线观看| 国产精品一二三四五| 国产日本欧洲亚洲| 处破女av一区二区| 亚洲欧洲综合另类| 在线观看视频一区| 视频在线在亚洲| 日韩欧美国产系列| 国产+成+人+亚洲欧洲自线| √…a在线天堂一区| 在线视频欧美区| 日韩国产成人精品| 久久女同性恋中文字幕| 不卡在线观看av| 一区二区三区在线高清| 91精品国产综合久久久久久漫画| 久久精品理论片| 国产精品免费网站在线观看| 色欧美88888久久久久久影院| 亚洲国产人成综合网站| 欧美成人一区二区| av一区二区不卡| 婷婷一区二区三区| 久久久久久毛片| 色婷婷久久久久swag精品 | 欧美日韩1区2区|