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

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


  @SuppressWarnings("unchecked")
  protected void constructDataCollectionMenu(AbstractMenuBuilder menu) {
    /*
     * Build the "add probe" menu
     */
    AbstractMenuBuilder probesMenu = menu.addSubMenu("Add probe");
    boolean somethingFound = false;
    if (getModel() instanceof Probeable) {

      Probeable probeable = (Probeable) getModel();
      Properties states = probeable.listStates();

      // Enumeration e = states.elements();
      Iterator<?> it = states.entrySet().iterator();

      while (it.hasNext()) {
        somethingFound = true;
        Entry<String, String> el = (Entry<String, String>) it.next();
        probesMenu.addAction(new AddProbeAction(this, el));

      }
    }

    if (!somethingFound) {
      probesMenu.addLabel("Nothing probeable");
    }

  }
View Full Code Here


    } else if (mode == SimulationMode.DIRECT) {
      selected = 2;
    }
   
    if (selected >= 0) {
      AbstractMenuBuilder modeMenu = menu.addSubMenu("Mode");
      modeMenu.addActionsRadio(new StandardAction[]{
          new DefaultModeAction("Spiking", arrayOfMe),
          new RateModeAction("Rate", arrayOfMe),
          new DirectModeAction("Direct", arrayOfMe)
        }, selected);
    }
View Full Code Here

  }

  protected void constructViewMenu(AbstractMenuBuilder menu) {

    AbstractMenuBuilder originsAndTerminations = menu.addSubMenu("Origins and terminations");

    /*
     * Build the "show origins" menu
     */
    Origin[] origins = getModel().getOrigins();
    if (origins.length > 0) {

      AbstractMenuBuilder originsMenu = originsAndTerminations.addSubMenu("Show origin");

      for (Origin element : origins) {
        originsMenu.addAction(new ShowOriginAction(element.getName()));
      }

    }

    /*
     * Build the "show origins" menu
     */
    Termination[] terminations = getModel().getTerminations();
    if (terminations.length > 0) {

      AbstractMenuBuilder terminationsMenu = originsAndTerminations.addSubMenu("Show termination");

      for (Termination element : terminations) {
        terminationsMenu.addAction(new ShowTerminationAction(element.getName()));
      }

    }
    originsAndTerminations.addAction(new ShowAllOandTAction("Show all"));
    originsAndTerminations.addAction(new HideAllOandTAction("Hide all"));
View Full Code Here

      LinkedList<ModelObject> homogeneousModels = selectionMap.get(type);
      String typeName = homogeneousModels.getFirst().getTypeName();

      String typeMenuName = homogeneousModels.size() + " " + typeName + "s";

      AbstractMenuBuilder typeMenu;
      if (menuBuilder == null) {
        typeMenu = new PopupMenuBuilder(typeMenuName);
        menuBuilder = (PopupMenuBuilder) typeMenu;
      } else {
        typeMenu = menuBuilder.addSubMenu(typeMenuName);
View Full Code Here

TOP

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

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.