示例#1
0
  @Override
  public void uninstalled() {
    ParameterTimeManagerFactory.setInstance(null);
    BlueProjectManager.getInstance()
        .removePropertyChangeListener(windowTitlePropertyChangeListener);
    BlueProjectManager.getInstance().removePropertyChangeListener(tempFileCleaner);
    MidiInputManager.getInstance().removeReceiver(MidiInputEngine.getInstance());

    RealtimeRenderManager.getInstance().stopAuditioning();
    RealtimeRenderManager.getInstance().shutdown();

    logger.info("blue-ui-core Installer uninstalled");
  }
示例#2
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));
  }