Package javafx.application.Preloader

Examples of javafx.application.Preloader.ProgressNotification


  /**
   * Constructor
   */
  public UGateGUI() {
    notifyPreloader(new ProgressNotification(0.01d));
    // TextAreaAppender.setTextArea(webSetupView);
    actorPA = new BeanPathAdapter<Actor>(ActorType.newDefaultActor());
    remoteNodePA = new BeanPathAdapter<RemoteNode>(
        RemoteNodeType
            .newDefaultRemoteNode(actorPA.getBean().getHost()));
View Full Code Here


   * {@inheritDoc}
   */
  @Override
  public void init() {
    log.debug("Initializing GUI...");
    notifyPreloader(new ProgressNotification(0.1d));
    logStartStop(true);
  }
View Full Code Here

  @Override
  public void start(final Stage stage) throws Exception {
    try {
      log.debug("Starting GUI...");
      RS.img(stage);
      notifyPreloader(new ProgressNotification(0.1d));

      stage.setTitle(RS.rbLabel(KEY.APP_TITLE));

      log.debug("Iniitializing Services...");
      notifyPreloader(new ProgressNotification(0.2d));
      initServices();

      if (initErrors != null && initErrors.length() > 0) {
        final TextArea errorDetails = TextAreaBuilder.create().text(initErrors.toString()).wrapText(true
            ).focusTraversable(false).editable(false).opacity(0.7d).build();
        if (initErrorHeader == null) {
          initErrorHeader = RS.rbLabel(KEY.APP_TITLE_ERROR);
        }
        final GuiUtil.DialogService dialogService = GuiUtil.dialogService(stage, KEY.APP_TITLE, initErrorHeader,
            KEY.CLOSE, 550d, 300d, new Service<Void>() {
          @Override
          protected Task<Void> createTask() {
            return new Task<Void>() {
              @Override
              protected Void call() throws Exception {
                // if the dialog shouldn't be closed call super.cancel()
                return null;
              }
            };
          }
        }, null, errorDetails);
        dialogService.getStage().addEventHandler(WindowEvent.WINDOW_SHOWN, new EventHandler<WindowEvent>() {
          @Override
          public void handle(final WindowEvent event) {
            notifyPreloader(new ProgressNotification(1d));
            dialogService.getStage().removeEventHandler(WindowEvent.WINDOW_SHOWN, this);
          }
        });
        notifyPreloader(new ProgressNotification(0.5d));
        dialogService.start();
        notifyPreloader(new StateChangeNotification(
            StateChangeNotification.Type.BEFORE_START));
        notifyPreloader(new ProgressNotification(0.75d));
      } else {
        // start the main GUI
        primaryStageStart(stage);
      }
     
View Full Code Here

   */
  protected void primaryStageStart(final Stage stage) {
    Platform.runLater(new Task<Void>() {
      @Override
      protected Void call() throws Exception {
        notifyPreloader(new ProgressNotification(0.5d));
        primaryStageBuild(stage);
        notifyPreloader(new ProgressNotification(0.75d));
        SystemTray.initSystemTray(stage);
        return null;
      }
    });
    UGateStartupDialog.DFLT.start(new UGateStartupDialog.StartupHandler() {
View Full Code Here

   *            the primary {@linkplain Stage}
   * @param authActor
   *            the authorized {@linkplain Actor}
   */
  protected void primaryStageShow(final Stage stage, final Actor authActor) {
    notifyPreloader(new ProgressNotification(0.85d));
    log.info("Showing Main GUI");
    if (authActor == null) {
      throw new IllegalArgumentException(
          "Cannot show application without an authenticated user");
    }
    stage.addEventFilter(WindowEvent.WINDOW_SHOWN, new EventHandler<WindowEvent>() {
      @Override
      public void handle(final WindowEvent event) {
        notifyPreloader(new ProgressNotification(1d));
        Platform.runLater(new Runnable() {
          @Override
          public void run() {
            actorPA.setBean(authActor);
            remoteNodePA.setBean(authActor.getHost().getRemoteNodes()
                .iterator().next());
            UGateKeeper.DEFAULT.notifyListeners(new UGateEvent<>(this,
                Type.APP_DATA_LOADED, false));
          }
        });
        stage.removeEventHandler(WindowEvent.WINDOW_SHOWN, this);
      }
    });
    stage.show();
    notifyPreloader(new ProgressNotification(0.9d));
  }
View Full Code Here

    @Override
    public final void init() throws CoreException {
        try {
            super.init();

            notifyPreloader(new ProgressNotification(0.1));

            notifyPreloader(new ProgressNotification(100));
            preInit(); // 200 , 300
            notifyPreloader(new ProgressNotification(0.3));

            // Load messages Files
            notifyPreloader(new ProgressNotification(400));
            loadMessagesFiles();
            notifyPreloader(new ProgressNotification(0.4));

            // Load configuration Files
            notifyPreloader(new ProgressNotification(500));
            loadConfigurationFiles();
            notifyPreloader(new ProgressNotification(0.5));

            // Build the JRebirth Thread before attaching uncaught Exception Handler
            notifyPreloader(new ProgressNotification(600));
            final JRebirthThread jrt = JRebirthThread.getThread();

            // Attach exception handlers
            initializeExceptionHandler();

            // Start the JRebirthThread, if an error occurred it will be processed by predefined handler
            // It will create all facades and trigger the pre and post boot waves and will alost attach the first model view
            jrt.prepare(this);
            notifyPreloader(new ProgressNotification(0.6));

            // Preload fonts to allow them to be used by CSS
            notifyPreloader(new ProgressNotification(700));
            preloadFonts();
            notifyPreloader(new ProgressNotification(0.7));

            postInit(); // 800 , 900

            notifyPreloader(new ProgressNotification(1000));
            notifyPreloader(new ProgressNotification(1.0));

        } catch (final Exception e) {
            LOGGER.error(ApplicationMessages.INIT_ERROR, e, this.getClass().getSimpleName());
            throw new CoreException(e);
        }
View Full Code Here

TOP

Related Classes of javafx.application.Preloader.ProgressNotification

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.