Beispiel #1
0
  @Override
  public void createPartControl(Composite container) {

    Platform.setImplicitExit(false); // Keep the JavaFX thread running

    // Creating a JavaFX Browser, so create an FXCanvas to contain it
    FXCanvas canvas = new FXCanvas(container, SWT.NONE);
    BorderPane borderPane = new BorderPane();
    Scene scene = new Scene(borderPane);

    WebView browser = new WebView();
    webEngine = browser.getEngine();
    webEngine.load(homeLocation);

    borderPane.setCenter(browser);

    canvas.setScene(scene);

    IActionBars actionBars = getIntroSite().getActionBars();
    IToolBarManager toolBar = actionBars.getToolBarManager();

    setupToolbarButtons(toolBar);
    lockUrl();
    addJSBridges();
  }
  private Scene initImpuestosCRUD() throws IOException {
    Platform.setImplicitExit(false);
    ApplicationContext context = Principal.applicationContext;

    Scene scene = (Scene) context.getBean("impuestosCRUDView");

    return scene;
  }
Beispiel #3
0
  @Before
  public void setUpJavaFX() {
    Platform.setImplicitExit(false);
    startup(
        new Runnable() {

          @Override
          public void run() {}
        });
  }
  public void init() {
    this.tcRef.add(this, BorderLayout.CENTER);

    Platform.setImplicitExit(false);
    Platform.runLater(
        new Runnable() {
          @Override
          public void run() {
            createScene();
          }
        });
  }
 @BeforeClass
 public static void setUpClass() throws Exception {
   Platform.setImplicitExit(false);
   try {
     Platform.runLater(() -> {});
   } catch (IllegalStateException e) {
     startPlatform();
   } catch (Exception e) {
     e.printStackTrace();
     startPlatform();
   }
 }
Beispiel #6
0
  @Override
  public void start(Stage primaryStage) throws Exception {
    appContext = new AnnotationConfigApplicationContext(SmartCSV.class);
    String name = appContext.getEnvironment().getProperty("application.name");
    String version = appContext.getEnvironment().getProperty("application.version");

    Platform.setImplicitExit(false);

    AboutController aboutController = appContext.getBean(AboutController.class);
    aboutController.setHostServices(getHostServices());

    try {
      showUI(primaryStage, name, version);
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
  public MainWindow2TopComponent() {
    initComponents();
    setName(Bundle.CTL_MainWindow2TopComponent());
    setToolTipText(Bundle.HINT_MainWindow2TopComponent());
    putClientProperty(TopComponent.PROP_MAXIMIZATION_DISABLED, Boolean.TRUE);
    putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE);

    setLayout(new BorderLayout());
    fxPanel = new JFXPanel();
    add(fxPanel, BorderLayout.CENTER);
    Platform.setImplicitExit(false);
    Platform.runLater(
        new Runnable() {
          @Override
          public void run() {
            init(fxPanel);
          }
        });
  }
Beispiel #8
0
 @Override
 public void start(Stage stage) throws Exception {
   if (headless) {
     System.setProperty("headless.geometry", width + "x" + height);
     NativePlatform platform = NativePlatformFactory.getNativePlatform();
     Field field = NativePlatform.class.getDeclaredField("screen");
     field.setAccessible(true);
     field.set(platform, null);
     Screen.notifySettingsChanged();
   }
   if (stage == null) {
     stage = new Stage();
   }
   Platform.setImplicitExit(false);
   WebView view = new WebView();
   view.setCache(false);
   StackPane root = new StackPane();
   root.setCache(false);
   if (headless) {
     stage.initStyle(StageStyle.UNDECORATED);
   }
   WebEngine engine = view.getEngine();
   engine.getHistory().setMaxSize(HISTORY_SIZE);
   engine.setUserAgent(Long.toString(settingsId));
   Accessor.getPageFor(engine).setDeveloperExtrasEnabled(false);
   Accessor.getPageFor(engine).setUsePageCache(false);
   root.getChildren().add(view);
   stage.setScene(new Scene(root, width, height));
   stage.sizeToScene();
   engine.titleProperty().addListener(new TitleListener(stage));
   stage.show();
   synchronized (lock) {
     myStage = stage;
     myView = view;
     lock.notifyAll();
   }
 }
 @Override
 public void start(Stage primaryStage) throws Exception {
   Platform.setImplicitExit(false);
   launchLatch.countDown();
 }
 public void init() {
   chartFxPanel = new JFXPanel();
   add(chartFxPanel, BorderLayout.CENTER);
   Platform.setImplicitExit(false);
   Platform.runLater(() -> createScene());
 }
Beispiel #11
0
  @Override
  public void restored() {
    Locale.setDefault(Locale.Category.FORMAT, Locale.ENGLISH);
    System.setProperty("jffi.unsafe.disabled", "true");

    //        System.setProperty("netbeans.winsys.no_toolbars", "true");
    //
    //        SwingUtilities.invokeLater(new Runnable() {
    //
    //            @Override
    //            public void run() {
    //                //Get the main window of the NetBeans Platform:
    //                JFrame frame = (JFrame) WindowManager.getDefault().getMainWindow();
    //                //Get our custom main toolbar:
    //                JPanel panel = new JPanel();
    //                panel.setLayout(new FlowLayout(FlowLayout.CENTER));
    //                panel.add(new blue.ui.core.toolbar.MainToolBar(), BorderLayout.CENTER);
    //                panel.setPreferredSize(new Dimension(100, 70));
    //
    //                //Set the new layout of our root pane:
    //                frame.getRootPane().setLayout(new MyRootPaneLayout(panel));
    //                //Install a new toolbar component into the layered pane
    //                //of the main frame on layer 0:
    //                panel.putClientProperty(JLayeredPane.LAYER_PROPERTY, 0);
    //                frame.getRootPane().getLayeredPane().add(panel, 0);
    //            }
    //        });
    ParameterTimeManagerFactory.setInstance(new ParameterTimeManagerImpl());

    windowTitlePropertyChangeListener =
        (PropertyChangeEvent evt) -> {
          SwingUtilities.invokeLater(
              () -> {
                if (WindowManager.getDefault().getMainWindow() != null) {
                  setWindowTitle();
                }
              });
        };

    BlueProjectManager.getInstance().addPropertyChangeListener(windowTitlePropertyChangeListener);
    BlueProjectManager.getInstance().addPropertyChangeListener(tempFileCleaner);

    WindowManager.getDefault()
        .invokeWhenUIReady(
            () -> {
              setWindowTitle();
              backupFileSaver = new BackupFileSaver();
              Thread t = new Thread(backupFileSaver);
              t.setPriority(Thread.MIN_PRIORITY);
              t.setDaemon(true);
              t.start();
            });

    PythonProxy.setLibDir(InstalledFileLocator.getDefault().locate("pythonLib", "jython", false));

    //        WindowManager.getDefault().invokeWhenUIReady(new Runnable() {
    //
    //            public void run() {
    //
    //                new Thread() {
    //
    //                    public void run() {
    //
    //                        ProgressHandle handle =
    // ProgressHandleFactory.createHandle("Initializing Python Interpreter...");
    //                        handle.start();
    //                        handle.progress("Initializing...");
    //
    //                        try {
    //                            PythonProxy.reinitialize();
    //                            PythonProxy.processScript("import random");
    //                        } catch (Exception e) {
    //
    //                        }
    //
    //                        handle.finish();
    //                    }
    //
    //                }.start();
    //            }
    //        });
    SwingUtilities.invokeLater(
        () -> {
          MidiInputManager.getInstance().addReceiver(MidiInputEngine.getInstance());
        });

    OSCManager oscManager = OSCManager.getInstance();
    OSCActions.installActions(oscManager);
    oscManager.start();

    Lookup lkp = Lookups.forPath("blue/score/layers");
    result = lkp.lookupResult(LayerGroupProvider.class);
    result.addLookupListener(lookupListener);

    LayerGroupProviderManager.getInstance().updateProviders(result.allInstances());

    lookupListener =
        (LookupEvent ev) -> {
          LayerGroupProviderManager.getInstance().updateProviders(result.allInstances());
        };

    //        for(LayerGroupPanelProvider provider : lkp.lookupAll(
    //                LayerGroupPanelProvider.class)) {
    //            JComponent comp = provider.getLayerGroupPanel(layerGroup, timeState, data);
    //
    //            if(comp != null) {
    //                return comp;
    //            }
    //        }

    Platform.setImplicitExit(false);
    // Initialize JavaFX by using this call
    new JFXPanel();
    //        Platform.runLater(()
    //                -> jfxPanel.setScene(new Scene(new Group())));

    //        FileChooserManager.getDefault().setJFXPanel(jfxPanel);
    //        WindowManager.getDefault().invokeWhenUIReady(()
    //                -> WindowManager.getDefault().getMainWindow().add(jfxPanel));
  }
  @Override
  public void start(Stage stage) throws Exception {
    primaryStage = stage;
    setUserAgentStylesheet(STYLESHEET_MODENA);

    config = initDiContainer();

    SceneAntialiasing aa = SceneAntialiasing.BALANCED;
    primaryStage
        .getIcons()
        .setAll(
            new javafx.scene.image.Image(getClass().getResourceAsStream("/logo-invert_small.png")));
    Scene scene;

    Platform.setImplicitExit(false);
    primaryStage.setTitle(TITLE);
    scene = new Scene(new LoginView().getView(), 370, 550, true, aa);
    primaryStage.setScene(scene);

    config.addObserver(
        (o, arg) -> {
          Platform.runLater(
              () -> {
                if (arg instanceof Account) {
                  try {
                    ClientConfiguration configuration =
                        (ClientConfiguration) customProperties.get("clientConfiguration");
                    Account acc = (Account) arg;
                    AccountingServer server =
                        new AccountingServer(
                            new URI(acc.getProvider()), acc.getUser(), acc.getAuth());
                    AccountingHTTP accountingHTTP =
                        new AccountingHTTP(server, new AccountingProfile());

                    BoxVolumeFactory factory =
                        new BlockBoxVolumeFactory(
                            configuration.getDeviceId().getBytes(),
                            accountingHTTP,
                            identityRepository);
                    boxVolumeFactory = new CachedBoxVolumeFactory(factory);
                    customProperties.put("boxVolumeFactory", boxVolumeFactory);
                    sharingService = new BlockSharingService(dropMessageRepository, dropConnector);
                    customProperties.put("sharingService", sharingService);

                    new Thread(getSyncDaemon(config)).start();
                    new Thread(getDropDaemon(config)).start();
                    view = new LayoutView();
                    Parent view = this.view.getView();
                    Scene layoutScene = new Scene(view, 800, 600, true, aa);
                    Platform.runLater(() -> primaryStage.setScene(layoutScene));

                    if (config.getSelectedIdentity() != null) {
                      addShareMessageRenderer(config.getSelectedIdentity());
                    }
                  } catch (Exception e) {
                    logger.error("failed to init background services: " + e.getMessage(), e);
                    // TODO to something with the fault
                  }
                } else if (arg instanceof Identity) {
                  addShareMessageRenderer((Identity) arg);
                }
              });
        });

    dropMessageRepository.addObserver(new ShareNotificationHandler(config));

    setTrayIcon(primaryStage);

    Runtime.getRuntime()
        .addShutdownHook(
            new Thread() {
              public void run() {
                Platform.exit();
              }
            });
    primaryStage.show();
  }
 public static void main(String[] args) throws IOException {
   Client.GUI_MODE = true;
   BasicImplements.setupImplements();
   Platform.setImplicitExit(false);
   launch(args);
 }
Beispiel #14
0
 private void init() {
   Platform.setImplicitExit(false);
   Platform.runLater(this::createScene);
 }