Package ca.nengo.ui.models.nodes.widgets

Examples of ca.nengo.ui.models.nodes.widgets.UITermination


        /*
         * Destroy unreferenced projections
         */
        for (UIProjection projectionUI : projectionsToRemove) {
            UITermination terminationUI = projectionUI.getTermination();

            projectionUI.destroy();
            if (!isFirstUpdate) {
                terminationUI.showPopupMessage("REMOVED Projection to "
                        + terminationUI.getNodeParent().getName() + "." + terminationUI.getName());
            }
        }

        /*
         * Construct projections
         */
        for (Projection projection : projectionsToAdd) {
            Origin origin = projection.getOrigin();
            Termination term = projection.getTermination();

            UINeoNode nodeOrigin = getUINode(origin.getNode());

            UINeoNode nodeTerm = getUINode(term.getNode());

            if (nodeOrigin != null && nodeTerm != null) {
                UIOrigin originUI = nodeOrigin.showOrigin(origin.getName());
                UITermination termUI = nodeTerm.showTermination(term.getName());

                originUI.connectTo(termUI, false);
                if (!isFirstUpdate) {
                    termUI.showPopupMessage("NEW Projection to " + termUI.getName() + "."
                            + getName());
                }
            } else {
                if (nodeOrigin == null) {
                    Util.Assert(false, "Could not find a Origin attached to a projection: "
View Full Code Here


  protected void prepareToDestroyModel() {
    super.prepareToDestroyModel();

    for (WorldObject wo : getChildren()) {
      if (wo instanceof UITermination) {
        UITermination term = (UITermination) wo;
        term.disconnect();
      }
    }

  }
View Full Code Here

  public void showAllTerminations() {

    Termination[] terminations = getModel().getTerminations();

    for (Termination element : terminations) {
      UITermination termUI = showTermination(element.getName());
      termUI.setWidgetVisible(true);
    }
    layoutChildren();
  }
View Full Code Here

   * @param layoutName
   *            Name of an Termination on the Node model
   * @return
   */
  public UITermination showTermination(String terminationName) {
    UITermination termUI;

    // Try to find if the origin has already been created
    termUI = (UITermination) getChild(terminationName, UITermination.class);
    if (termUI == null) {
      // Otherwise try to create it
      try {

        Termination termModel = getModel().getTermination(terminationName);
        if (termModel != null) {
          termUI = UITermination.createTerminationUI(this, termModel);
          addWidget(termUI);
        } else {
          Util.Assert(false, "Could not find termination: " + terminationName);
        }

      } catch (StructuralException e) {
        UserMessages.showError(e.toString());
      }
    }
    if (termUI != null) {
      termUI.setWidgetVisible(true);
    }
    return termUI;

  }
View Full Code Here

    try {
      Termination term = (Termination) ModelFactory.constructModel(this,
          new CDecodedTermination(getModel()));

      UITermination termUI = UITermination.createTerminationUI(this, term);
      showPopupMessage("New decoded TERMINATION added");
      addWidget(termUI);
      return termUI;

    } catch (ConfigException e) {
View Full Code Here

      super("Add decoded termination");
    }

    @Override
    protected void action() throws ActionException {
      UITermination term = addDecodedTermination();
      if (term == null)
        throw new UserCancelledException();
      else
        addedTermination = term;
    }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.models.nodes.widgets.UITermination

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.