Package ca.nengo.ui.lib.util.menus

Examples of ca.nengo.ui.lib.util.menus.MenuBuilder


  @Override
  protected void constructMenu(PopupMenuBuilder menu) {
    super.constructMenu(menu);

    menu.addSection("Probe");
    MenuBuilder plotMenu = menu.addSubMenu("plot");

    Collection<StandardAction> actions = ProbePlotHelper.getInstance().getPlotActions(getModel().getData(),
        getName());

    for (StandardAction action : actions) {
      plotMenu.addAction(action);
    }

    MenuBuilder exportMenu = menu.addSubMenu("export data");
    exportMenu.addAction(new ExportToMatlabAction());

  }
View Full Code Here


  @Override
  protected void constructMenu(PopupMenuBuilder menu) {
    super.constructMenu(menu);

    menu.addSection("NEFEnsemble");
    MenuBuilder plotMenu = menu.addSubMenu("Plot");

    plotMenu.addAction(new StandardAction("Constant Rate Responses") {
      private static final long serialVersionUID = 1L;

      @Override
      protected void action() {
        Plotter.plot(getModel());
      }

    });
    Origin[] origins = getModel().getOrigins();

    for (Origin element : origins) {
      if (element instanceof DecodedOrigin) {
        if(getModel().getDimension() > 1)
          plotMenu.addAction(new PlotDecodedOriginMSE(element.getName()));
        else
          plotMenu.addAction(new PlotDecodedOriginDistortion(element.getName()));
      }
    }

    // Decoded termination and origins
//    menu.addAction(new AddDecodedTerminationAction());
View Full Code Here

            worldMenu.addAction(new TurnOffGrid(), KeyEvent.VK_G);
        }

        worldMenu.getJMenu().addSeparator();
       
        MenuBuilder qualityMenu = worldMenu.addSubMenu("Rendering Quality");

        qualityMenu.getJMenu().setMnemonic(KeyEvent.VK_Q);

        qualityMenu.addAction(new LowQualityAction(), KeyEvent.VK_L);
        qualityMenu.addAction(new MediumQualityAction(), KeyEvent.VK_M);
        qualityMenu.addAction(new HighQualityAction(), KeyEvent.VK_H);

        MenuBuilder debugMenu = worldMenu.addSubMenu("Debug");
        debugMenu.getJMenu().setMnemonic(KeyEvent.VK_E);

        if (!PDebug.debugPrintUsedMemory) {
            debugMenu.addAction(new ShowDebugMemory(), KeyEvent.VK_S);
        } else {
            debugMenu.addAction(new HideDebugMemory(), KeyEvent.VK_H);
        }
    }
View Full Code Here

    private void initMenu() {
        JMenuBar menuBar = new JMenuBar();
        menuBar.setBorder(null);
        //Style.applyMenuStyle(menuBar, true);

        MenuBuilder fileMenu = new MenuBuilder("File");
        fileMenu.getJMenu().setMnemonic(KeyEvent.VK_F);
        initFileMenu(fileMenu);
        fileMenu.addAction(new ExitAction(this, "Quit"), KeyEvent.VK_P);
        menuBar.add(fileMenu.getJMenu());

        editMenu = new MenuBuilder("Edit");
        editMenu.getJMenu().setMnemonic(KeyEvent.VK_E);

        menuBar.add(editMenu.getJMenu());

        initViewMenu(menuBar);

        runMenu = new MenuBuilder("Run");
        runMenu.getJMenu().setMnemonic(KeyEvent.VK_R);

        menuBar.add(runMenu.getJMenu());

        worldMenu = new MenuBuilder("Misc");
        worldMenu.getJMenu().setMnemonic(KeyEvent.VK_O);
        menuBar.add(worldMenu.getJMenu());

        updateWorldMenu();
        updateEditMenu();
        updateRunMenu();

        MenuBuilder helpMenu = new MenuBuilder("Help");
        helpMenu.getJMenu().setMnemonic(KeyEvent.VK_H);
        menuBar.add(helpMenu.getJMenu());

        helpMenu.addAction(new OpenURLAction("Documentation (opens in browser)",
                "http://www.nengo.ca/documentation"), KeyEvent.VK_F1);
        helpMenu.addAction(new TipsAction("Tips and Commands", false), KeyEvent.VK_T);
        boolean isMacOS = System.getProperty("mrj.version") != null;
        if (!isMacOS) {
            helpMenu.addAction(new AboutAction("About"), KeyEvent.VK_A);
        }

        menuBar.setVisible(true);
        this.setJMenuBar(menuBar);
    }
View Full Code Here

    }

    @Override
    public void initViewMenu(JMenuBar menuBar) {

        MenuBuilder viewMenu = new MenuBuilder("View");
        viewMenu.getJMenu().setMnemonic(KeyEvent.VK_V);
        menuBar.add(viewMenu.getJMenu());

        int count = 1;
        for (AuxillarySplitPane splitPane : splitPanes) {
            byte shortCutChar = splitPane.getAuxTitle().getBytes()[0];

            viewMenu.addAction(new ToggleScriptPane("Toggle " + splitPane.getAuxTitle(), splitPane),
                    shortCutChar,
                    KeyStroke.getKeyStroke(0x30 + count++, MENU_SHORTCUT_KEY_MASK));

        }
        viewMenu.getJMenu().addSeparator();

        viewMenu.addAction(new ZoomToFitAction("Zoom to fit", this.getWorld()),
                KeyEvent.VK_0,
                KeyStroke.getKeyStroke(KeyEvent.VK_0, MENU_SHORTCUT_KEY_MASK));
    }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.lib.util.menus.MenuBuilder

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.