Package de.lessvoid.nifty.tools

Examples of de.lessvoid.nifty.tools.StopWatch


    }

    Element rootElement = nifty.getRootLayerFactory().createRootLayer("root", nifty, screen, timeProvider);
    screen.setRootElement(rootElement);

    StopWatch stopWatch = new StopWatch(timeProvider);
    stopWatch.start();
    for (LayerType layerType : layers) {
      layerType.prepare(nifty, screen, rootElement.getElementType());
    }
    Logger.getLogger(NiftyLoader.class.getName()).info("internal prepare screen (" + id + ") [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (LayerType layerType : layers) {
      LayoutPart layerLayout = nifty.getRootLayerFactory().createRootLayerLayoutPart(nifty);
      screen.addLayerElement(
          layerType.create(
              rootElement,
              nifty,
              screen,
              layerLayout));
    }
    Logger.getLogger(NiftyLoader.class.getName()).info("internal create screen (" + id + ") [" + stopWatch.stop() + "]");

    screen.processAddAndRemoveLayerElements();
    nifty.addScreen(id, screen);
  }
View Full Code Here


  public void addScreen(final ScreenType screenType) {
    screens.add(screenType);
  }

  public void create(final Nifty nifty, final TimeProvider timeProvider) {
    StopWatch stopWatch = new StopWatch(timeProvider);
    stopWatch.start();
    log.info("debug out [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (ResourceBundleType resourceBundle : resourceBundles) {
      resourceBundle.translateSpecialValues(nifty, null);
      resourceBundle.materialize(nifty);
    }
    log.info("resourceBundles [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (StyleType style : styles) {
      style.translateSpecialValues(nifty, null);
      nifty.registerStyle(style);
    }
    log.info("registerStyle [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (ControlDefinitionType controlDefintion : controlDefinitions) {
      controlDefintion.translateSpecialValues(nifty, null);
      controlDefintion.makeFlat();
      nifty.registerControlDefintion(controlDefintion);
    }
    log.info("registerControlDefinition [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (RegisterEffectType registerEffectType : registeredEffect) {
      registerEffectType.translateSpecialValues(nifty, null);
      nifty.registerEffect(registerEffectType);
    }
    log.info("registerEffect [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (RegisterSoundType registerSoundType : registeredSounds) {
      registerSoundType.translateSpecialValues(nifty, null);
      registerSoundType.materialize(nifty.getSoundSystem());
    }
    log.info("registerSound [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (RegisterMusicType registerMusicType : registeredMusic) {
      registerMusicType.translateSpecialValues(nifty, null);
      registerMusicType.materialize(nifty.getSoundSystem());
    }
    log.info("registerMusic [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (RegisterMouseCursorType registerMouseCursorType : registeredMouseCursor) {
      registerMouseCursorType.translateSpecialValues(nifty, null);
      registerMouseCursorType.materialize(nifty, log);
    }
    log.info("registerMouseCursor [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (PopupType popup : popups) {
      popup.translateSpecialValues(nifty, null);
      nifty.registerPopup(popup);
    }
    log.info("registerPopup [" + stopWatch.stop() + "]");

    stopWatch.start();
    for (ScreenType screen : screens) {
      screen.translateSpecialValues(nifty, null);
      screen.create(nifty, this, timeProvider);
    }
    log.info("create Screens [" + stopWatch.stop() + "]");
  }
View Full Code Here

TOP

Related Classes of de.lessvoid.nifty.tools.StopWatch

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.