Package org.apache.flex.swf

Examples of org.apache.flex.swf.ISWF


        SWFReader swfReader = getSWFReader(problems);
        if (swfReader == null)
            return false;

        ISWF swf = swfReader.getSWF();
        if (swf == null)
            return false;

        if (symbol == null)
        {
            baseClassQName = CORE_PACKAGE + ".MovieClipLoaderAsset";

            if (scaling)
            {
                problems.add(new EmbedMovieScalingNoSymbolProblem(location));
            }
        }
        else
        {
            symbolTag = getSWFTag(swfReader, symbol, problems);
            if (symbolTag == null)
            {
                problems.add(new EmbedMissingSymbolProblem(location, source, symbol));
                return false;
            }

            if (scaling)
            {
                if (!(symbolTag instanceof DefineSpriteTag))
                {
                    problems.add(new EmbedBadScalingGridTargetProblem(location, symbol));
                    return false;
                }
            }

            if (swf.getFrameCount() > 1)
                baseClassQName = CORE_PACKAGE + ".MovieClipLoaderAsset";
            else
                baseClassQName = getAssociatedClass(symbolTag);

            if (symbolTag instanceof DefineFont2Tag)
            {
                flexFontInfo = new FlexFontInfo(((DefineFont2Tag)symbolTag).isFontFlagsBold(), ((DefineFont2Tag)symbolTag).isFontFlagsItalic());
            }
            else if (symbolTag instanceof DefineFont4Tag)
            {
                flexFontInfo = new FlexFontInfo(((DefineFont4Tag)symbolTag).isFontFlagsBold(), ((DefineFont4Tag)symbolTag).isFontFlagsItalic());               
            }
        }

        Rect swfSize = swf.getFrameSize();
        if (swfSize != null)
        {
            swfWidth =  swfSize.getWidth() / ISWFConstants.TWIPS_PER_PIXEL;
            swfHeight = swfSize.getHeight() / ISWFConstants.TWIPS_PER_PIXEL;
        }
View Full Code Here


                    // Read in the SWF
                    in = new BufferedInputStream(new FileInputStream(inputFile));
                    SWFReader reader = new SWFReader();
                    try
                    {
                        ISWF swf = reader.readFrom(in, getInputFilePath());
                        // record any problems encountered reading the swf
                        problems.addAll(reader.getProblems());

                        List<ICompilerProblem> linkProblems = new ArrayList<ICompilerProblem>();
   
                        // do the optimization
                        OptimizerSWFTarget target = new OptimizerSWFTarget(swf, project, targetSettings, null);
                        ISWF optimizedSWF = target.build(linkProblems);

                        // record any problems found
                        problems.addAll(linkProblems);

                        if( !problems.hasErrors() )
View Full Code Here

    {
        boolean success = true;
        final ArrayList<ICompilerProblem> problemsBuildingSWF = new ArrayList<ICompilerProblem>();
        final ISWFTarget target = new AppSWFTarget(applicationProject, new ASCTargetSettings(sourceFilename), null,
                compilationUnits);
        final ISWF swf = target.build(problemsBuildingSWF);

        if (swf != null)
        {
            swf.setTopLevelClass(getSymbolClass());

            final ISWFWriter writer = new SWFWriter(swf, Header.Compression.NONE);
            final String outputFileNameWithExt = outputBaseName + ".swf";
            final File outputFile = new File(outputDirectoryName + outputFileNameWithExt);
            try
View Full Code Here

    }

    @Override
    void writeLibrary(ISWCLibrary library) throws IOException
    {
        final ISWF swf = library.getSWF();
        final String path = library.getPath();
        assert swf != null : "Expect SWF model";
        assert path != null : "Expect SWF path";

        final OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(new File(directory, path)));
View Full Code Here

     */
    private ISWF buildSWFModel() throws InterruptedException
    {
        final List<ICompilerProblem> problemsBuildingSWF =
                new ArrayList<ICompilerProblem>();
        final ISWF swf = target.build(problemsBuildingSWF);
        problems.addAll(problemsBuildingSWF);
        if (swf == null)
        {
            ICompilerProblem problem = new UnableToBuildSWFProblem(getOutputFilePath());
            problems.add(problem);
View Full Code Here

       
        final LinkageChecker externalLinkageChecker = new LinkageChecker(
                flexProject, targetSettings);
        ((Target)librarySWFTarget).setLinkageChecker(externalLinkageChecker);
        setLinkageChecker(externalLinkageChecker);
        final ISWF defaultLibrarySWF = librarySWFTarget.build(problems);
       
        // make default library model
        final ISWCLibrary defaultLibrary = new SWCLibrary(LIBRARY_SWF, defaultLibrarySWF);
        swc.addLibrary(defaultLibrary);
   
View Full Code Here

    }
   
    @Override
    protected ISWF initializeSWF(List<ICompilationUnit> reachableCompilationUnits) throws InterruptedException
    {
        ISWF swf = super.initializeSWF(reachableCompilationUnits);
        delegate.addProductInfoToSWF(swf);
       
        return swf;
    }
View Full Code Here

    }
   
    @Override
    protected ISWF initializeSWF(List<ICompilationUnit> reachableCompilationUnits) throws InterruptedException
    {
        ISWF swf = super.initializeSWF(reachableCompilationUnits);
        delegate.addProductInfoToSWF(swf);
       
        return swf;
    }
View Full Code Here

    }

    @Override
    void writeLibrary(final ISWCLibrary library) throws IOException
    {
        final ISWF swf = library.getSWF();
        final String path = library.getPath();
        assert swf != null : "Expect SWF model";
        assert path != null : "Expect SWF path";

        zipOutputStream.putNextEntry(new ZipEntry(path));
View Full Code Here

                    }
                }
            }
           
        }
        ISWF swf = mxmlc.getSWFTarget();
        movie = new SimpleMovie(null);
        org.apache.flex.swf.types.Rect r = swf.getFrameSize();
        flash.swf.types.Rect fr = new flash.swf.types.Rect();
        fr.xMin = r.xMin();
        fr.yMin = r.yMin();
        fr.xMax = r.xMax();
        fr.yMax = r.yMax();
        movie.size = fr;
        RGB bg = swf.getBackgroundColor();
        int red = bg.getRed();
        red = red << 16;
        int green = bg.getGreen();
        green = green << 8;
        int blue = bg.getBlue();
        movie.bgcolor = new SetBackgroundColor(red + green + blue);
        movie.topLevelClass = swf.getTopLevelClass();
       
    }
View Full Code Here

TOP

Related Classes of org.apache.flex.swf.ISWF

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.