예제 #1
0
  protected void showLSConsole(boolean b) {
    if (!b) {
      showBottomPane(false);
      if (lsConsoleDlg != null) lsConsoleDlg.setVisible(false);
      lsConsolePane.hideAutoCompleteWindow();
      return;
    }

    setLSConsolePopOut0(isLSConsolePopOut());
  }
예제 #2
0
 /**
  * Sets the warning messages' color of the LS Console.
  *
  * @param c The warning messages' color of the LS Console.
  */
 protected void setLSConsoleWarningColor(Color c) {
   lsConsolePane.setWarningColor(c);
 }
예제 #3
0
 /**
  * Sets the error messages' color of the LS Console.
  *
  * @param c The error messages' color of the LS Console.
  */
 protected void setLSConsoleErrorColor(Color c) {
   lsConsolePane.setErrorColor(c);
 }
예제 #4
0
 /**
  * Sets the notification messages' color of the LS Console.
  *
  * @param c The notification messages' color of the LS Console.
  */
 protected void setLSConsoleNotifyColor(Color c) {
   lsConsolePane.setNotifyColor(c);
 }
예제 #5
0
 /**
  * Sets the background color of the LS Console.
  *
  * @param c The background color of the LS Console.
  */
 protected void setLSConsoleBackgroundColor(Color c) {
   lsConsolePane.setBackgroundColor(c);
 }
예제 #6
0
 /**
  * Sets the text color of the LS Console.
  *
  * @param c The text color of the LS Console.
  */
 protected void setLSConsoleTextColor(Color c) {
   lsConsolePane.setTextColor(c);
 }
예제 #7
0
 protected LSConsoleModel getLSConsoleModel() {
   return lsConsolePane.getModel();
 }
예제 #8
0
  private void addMenu() {
    JMenu m;
    JMenuItem mi;

    setJMenuBar(menuBar);

    // Actions
    m = new JMenu(i18n.getMenuLabel("actions"));
    menuBar.add(m);

    mi = new JMenuItem(A4n.connect);
    mi.setIcon(null);
    // mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.refresh);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
    m.add(mi);

    mi = new JMenuItem(A4n.resetSampler);
    mi.setIcon(null);
    m.add(mi);

    mi = new JMenuItem(A4n.samplerInfo);
    mi.setIcon(null);
    m.add(mi);

    m.addSeparator();

    mi = new JMenuItem(i18n.getMenuLabel("actions.runScript"));
    m.add(mi);
    mi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            runScript();
          }
        });

    String s = ClassicPrefs.getRecentScripts();
    BufferedReader br = new BufferedReader(new StringReader(s));

    try {
      s = br.readLine();
      while (s != null) {
        recentScripts.add(s);
        s = br.readLine();
      }
    } catch (Exception x) {
      CC.getLogger().log(Level.INFO, HF.getErrorMessage(x), x);
    }

    updateRecentScriptsMenu();

    m.add(recentScriptsMenu);

    m.addSeparator();

    mi = new JMenuItem(i18n.getMenuLabel("actions.exit"));
    m.add(mi);
    mi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            CC.cleanExit();
          }
        });

    // Edit
    m = new JMenu(i18n.getMenuLabel("edit"));
    menuBar.add(m);

    mi = new JMenuItem(i18n.getMenuLabel("edit.audioDevices"));
    m.add(mi);
    mi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (!isLeftPaneVisible()) cbmiLeftPaneVisible.doClick(0);
            LeftPane.getLeftPane().showAudioDevicesPage();
          }
        });

    mi = new JMenuItem(i18n.getMenuLabel("edit.midiDevices"));
    m.add(mi);
    mi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (!isLeftPaneVisible()) cbmiLeftPaneVisible.doClick(0);
            LeftPane.getLeftPane().showMidiDevicesPage();
          }
        });

    mi = new JMenuItem(i18n.getMenuLabel("edit.orchestras"));
    m.add(mi);
    mi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            if (!isLeftPaneVisible()) cbmiLeftPaneVisible.doClick(0);
            LeftPane.getLeftPane().showManageOrchestrasPage();
          }
        });

    m.addSeparator();

    mi = new JMenuItem(A4n.preferences);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    // View
    m = new JMenu(i18n.getMenuLabel("view"));
    menuBar.add(m);

    final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(i18n.getMenuLabel("view.toolbar"));

    m.add(cbmi);
    cbmi.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            showToolbar(cbmi.getState());
          }
        });

    boolean b = ClassicPrefs.shouldShowToolbar();
    cbmi.setSelected(b);
    showToolbar(b);

    m.add(cbmiLeftPaneVisible);
    cbmiLeftPaneVisible.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            showLeftPane(cbmiLeftPaneVisible.getState());
          }
        });

    b = ClassicPrefs.shouldShowLeftPane();
    cbmiLeftPaneVisible.setSelected(b);
    showLeftPane(b);

    final JCheckBoxMenuItem cbmi2 = new JCheckBoxMenuItem(i18n.getMenuLabel("view.statusbar"));

    m.add(cbmi2);
    cbmi2.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            showStatusbar(cbmi2.getState());
          }
        });
    b = ClassicPrefs.shouldShowStatusbar();
    cbmi2.setSelected(b);
    showStatusbar(b);

    m.addSeparator();

    setLSConsolePopOut(ClassicPrefs.isLSConsolePopOut());
    cbmiLSConsoleShown.setSelected(ClassicPrefs.shouldShowLSConsole());
    showLSConsole(ClassicPrefs.shouldShowLSConsole());

    cbmiLSConsoleShown.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            showLSConsole(cbmiLSConsoleShown.isSelected());
          }
        });
    m.add(cbmiLSConsoleShown);

    lsConsolePane.updateLSConsoleViewMode();

    // Channels
    m = new JMenu(i18n.getMenuLabel("channels"));
    menuBar.add(m);

    mi = new JMenuItem(A4n.newChannel);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.newChannelWizard);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.duplicateChannels);
    mi.setIcon(null);
    m.add(mi);

    m.addSeparator();

    mi = new JMenuItem(A4n.moveChannelsOnTop);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveChannelsUp);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.ALT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveChannelsDown);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveChannelsAtBottom);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    tabsMenu.setEnabled(false);
    m.add(tabsMenu);

    m.addSeparator();

    mi = new JMenuItem(A4n.selectAllChannels);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.deselectChannels);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    m.addSeparator();

    mi = new JMenuItem(A4n.removeChannels);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, KeyEvent.SHIFT_MASK));
    m.add(mi);

    // Tabs
    m = new JMenu(i18n.getMenuLabel("tabs"));
    menuBar.add(m);

    mi = new JMenuItem(A4n.newChannelsTab);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.editTabTitle);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
    m.add(mi);

    m.addSeparator();

    mi = new JMenuItem(A4n.moveTab2Beginning);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveTab2Left);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.ALT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveTab2Right);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK));
    m.add(mi);

    mi = new JMenuItem(A4n.moveTab2End);
    mi.setIcon(null);
    mi.setAccelerator(
        KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.ALT_MASK | KeyEvent.SHIFT_MASK));
    m.add(mi);

    m.addSeparator();

    mi = new JMenuItem(A4n.closeChannelsTab);
    mi.setIcon(null);
    mi.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK));
    m.add(mi);

    // Help
    m = new JMenu(i18n.getMenuLabel("help"));
    menuBar.add(m);

    mi = new JMenuItem(A4n.helpAbout);
    mi.setIcon(null);
    m.add(mi);
  }