Package flash.localization

Examples of flash.localization.LocalizationManager


        int num = swcGroup.getNumberLoaded();
        loaded += num;
       
        if (ThreadLocalToolkit.getBenchmark() != null)
        {
            LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
            ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Mxmlc.LoadedSWCs(loaded)));
        }

        return num;
    }
View Full Code Here


           Map<String, Long> swcFileChecksums,
           Map<String, Long> archiveFileChecksums) throws IOException
  {
    if (!readVersion())
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      throw new IOException(l10n.getLocalizedTextString(new ObsoleteCacheFileFormat()));
    }

    if (!readChecksum(checksums))
    {
      return -1;
View Full Code Here

  private boolean readFileSpec(Object[] pool, FileSpec fileSpec) throws IOException
  {
    boolean fileSpecDataExists = readU8()==1 ? true : false;
    if (fileSpecDataExists && fileSpec == null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      throw new IOException(l10n.getLocalizedTextString(new NoFileSpec()));
    }
    else if (!fileSpecDataExists)
    {
      return true;
    }
View Full Code Here

  private boolean readSourceList(Object[] pool, SourceList sourceList) throws IOException
  {
    boolean sourceListDataExists = readU8()==1 ? true : false;
    if (sourceListDataExists && sourceList == null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      throw new IOException(l10n.getLocalizedTextString(new NoSourceList()));
    }
    else if (!sourceListDataExists)
    {
      return true;
    }
View Full Code Here

  private boolean readSourcePath(Object[] pool, SourcePath sourcePath) throws IOException
  {
    boolean sourcePathDataExists = readU8()==1 ? true : false;
    if (sourcePathDataExists && sourcePath == null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      throw new IOException(l10n.getLocalizedTextString(new NoSourcePath()));
    }
    else if (!sourcePathDataExists)
    {
      return true;
    }
View Full Code Here

    private boolean readResourceBundlePath(Object[] pool, ResourceBundlePath bundlePath) throws IOException
  {
      boolean resourceBundlePathDataExists = readU8()==1 ? true : false;
    if (resourceBundlePathDataExists && bundlePath == null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      throw new IOException(l10n.getLocalizedTextString(new NoSourcePath()));
    }
    else if (!resourceBundlePathDataExists)
    {
      return true;
    }
View Full Code Here

    }
    else if (owner == 3) // ResourceContainer
    {
      if (resources == null)
      {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
        throw new IOException(l10n.getLocalizedTextString(new NoResourceContainer()));
      }

      s = Source.newSource(abc, name, fileTime, pathRoot, relativePath, shortName, resources, isInternal, isRoot, isDebuggable,
                           includes, includeTimes, logger);
      s = resources.addResource(s);
View Full Code Here

        flex2.compiler.CompilerAPI.useAS3();

        // setup the path resolver
        flex2.compiler.CompilerAPI.usePathResolver();

        LocalizationManager l10n = new LocalizationManager();
        l10n.addLocalizer( new ResourceBundleLocalizer() );
        ThreadLocalToolkit.setLocalizationManager(l10n);
       
    flex2.compiler.CompilerAPI.useConsoleLogger();
    // create of list of options that we want. All the other options that
    // we inherit will be filtered out.
    final String[] configVars = new String[]{"help", "version", "load-config", "input", "output",
                         "compiler.keep-as3-metadata", "compiler.debug"};
    Arrays.sort(configVars);
    ConfigurationBuffer cfgbuf = new ConfigurationBuffer(OptimizerConfiguration.class,
        new HashMap<String, String>(),
        new ConfigurationFilter() {

      public boolean select(String name)
      {
        return Arrays.binarySearch(configVars, name) >= 0;
      }

    });
   
        cfgbuf.setDefaultVar("input");
        try
        {
          DefaultsConfigurator.loadMinimumDefaults(cfgbuf);
          OptimizerConfiguration configuration = (OptimizerConfiguration) Mxmlc.processConfiguration(
                  l10n, "optimizer", args, cfgbuf, OptimizerConfiguration.class, "input", true);

          // user is not allowed to control "debug" and "optimize" settings so
          // set them here.
        configuration.setDebug(configuration.debug());
        configuration.setOptimize(true);
        
          //OptimizerConfiguration configuration = (OptimizerConfiguration) processConfiguration(cfgbuf, args, l10n);
          String input = configuration.getInput(), output = configuration.getOutput();
         
          File inputFile = FileUtil.openFile(input), outputFile = FileUtil.openFile(output);
          if (inputFile.exists())
          {
            InputStream in = new BufferedInputStream(new FileInputStream(inputFile));
            System.out.println(input + " (" + inputFile.length() + " bytes)");
           
            // decoder
            Movie movie = new Movie();
            TagDecoder tagDecoder = new TagDecoder(in);
            MovieDecoder movieDecoder = new MovieDecoder(movie);
            tagDecoder.parse(movieDecoder);

            if (movie.version > 0) {
                // optimize
                flex2.tools.WebTierAPI.optimize(movie, configuration);

                    //TODO PERFORMANCE: A lot of unnecessary recopying and buffering here
                // encode
                TagEncoder handler = new TagEncoder();
                MovieEncoder encoder = new MovieEncoder(handler);
                encoder.export(movie, true);
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                handler.writeTo(out);
               
                FileUtil.writeBinaryFile(output, out.toByteArray());
                System.out.println(output + " (" + outputFile.length() + " bytes)");             
            }
            else
            {
            ThreadLocalToolkit.logError(l10n.getLocalizedTextString(new NotAValidSwfFile(inputFile.getAbsolutePath())));
            }
           
          }
        }
        catch (ConfigurationException ex)
View Full Code Here

      FlexMovie movie = new FlexMovie( configuration );
      movie.topLevelClass = FlexMovie.formatSymbolClassName( configuration.getRootClassName() );
      movie.generate( units );
    if (ThreadLocalToolkit.getBenchmark() != null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Linking()));
    }

    generateReports(configuration, movie);
   
    // perform post-link optimization...
    if (postLink != null)
    {
      postLink.run(movie);
      if (ThreadLocalToolkit.getBenchmark() != null)
      {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
        ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Optimizing()));
      }
    }

    return movie;
  }
View Full Code Here

  {
    ConsoleApplication app = new ConsoleApplication(configuration);
      app.generate( units );
      if (ThreadLocalToolkit.getBenchmark() != null)
    {
      LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
      ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Linking()));
    }

    // perform post-link optimization...
    if (postLink != null)
    {
      postLink.run(app);
      if (ThreadLocalToolkit.getBenchmark() != null)
      {
        LocalizationManager l10n = ThreadLocalToolkit.getLocalizationManager();
        ThreadLocalToolkit.getBenchmark().benchmark(l10n.getLocalizedTextString(new Optimizing()));
      }
    }
 
    return app;
  }
View Full Code Here

TOP

Related Classes of flash.localization.LocalizationManager

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.