예제 #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");
  }
  @Override
  public void actionPerformed(ActionEvent e) {
    StatusDisplayer.getDefault().setStatusText(BlueSystem.getString("message.generatingCSD"));

    BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();

    try {
      float startTime = data.getRenderStartTime();
      float endTime = data.getRenderEndTime();

      /*
       * try { tempStart = Float.parseFloat(playStartText.getText()); }
       * catch(NumberFormatException nfe) { tempStart = 0.0f;
       * playStartText.setText(Float.toString(tempStart));
       * JOptionPane.showMessageDialog(null, BlueSystem
       * .getString("message.generateScore.startingFromZero")); }
       */

      CsdRenderResult result =
          CSDRenderService.getDefault().generateCSD(data, startTime, endTime, false, false);

      String csd = result.getCsdText();

      InfoDialog.showInformationDialog(
          WindowManager.getDefault().getMainWindow(),
          csd,
          BlueSystem.getString("message.generateScore.csdTest"));
    } catch (Exception ex) {
      ExceptionDialog.showExceptionDialog(WindowManager.getDefault().getMainWindow(), ex);
      throw new RuntimeException("CSDRender Failed");
    }
  }
예제 #3
0
  private void setWindowTitle() {
    BlueProjectManager bpm = BlueProjectManager.getInstance();
    BlueProject proj = bpm.getCurrentProject();

    String title = "blue - " + BlueConstants.getVersion();

    if (proj != null) {
      title += " - ";

      if (proj.getDataFile() == null) {
        title += "New Project";
      } else {
        title += proj.getDataFile().getName();
      }
    }

    final String t = title;

    SwingUtilities.invokeLater(
        () -> {
          WindowManager.getDefault().getMainWindow().setTitle(t);
        });
  }
예제 #4
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));
  }
예제 #5
0
 @Override
 public boolean closing() {
   return BlueProjectManager.getInstance().closeAllFiles();
 }