Package ca.nengo.ui.models

Examples of ca.nengo.ui.models.UINeoNode


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

        StandardAction simulateAction = null;
        StandardAction interactivePlotsAction = null;
        UINeoNode node = null;
        WorldObject selectedObj = SelectionHandler.getActiveObject();

        if (selectedObj != null) {
            if (selectedObj instanceof UINeoNode) {
                node = (UINeoNode) selectedObj;
            } else if (selectedObj instanceof UIProjection) {
                if (((UIProjection) selectedObj).getTermination() != null) {
                    node = ((UIProjection) selectedObj).getTermination().getNodeParent();
                } else {
                    node = ((UIProjection) selectedObj).getOriginUI().getNodeParent();
                }
            } else if (selectedObj instanceof Widget){
                node = ((Widget) selectedObj).getNodeParent();
            } else if (selectedObj instanceof UIProbe) {
                node = ((UIProbe) selectedObj).getProbeParent();
            }
        }

        if (node != null) {
            while (node.getNetworkParent() != null) {
                node = node.getNetworkParent();
            }

            UINetwork network = (UINetwork) node;

            simulateAction = new RunSimulatorAction("Simulate " + network.getName(), network);
View Full Code Here


        NodeContainer nodeContainer = getTopNodeContainer();
        if (nodeContainer != this && nodeContainer != null) {
            // Delegate to the top Node Container in the Application
            return nodeContainer.addNodeModel(node, posX, posY);
        } else if (nodeContainer == this) {
            UINeoNode nodeUI = getNengoWorld().addNodeModel(node, posX, posY);
            try {
                DragAction.dropNode(nodeUI);
            } catch (UserCancelledException e) {
                // the user should not be given a chance to do this
                throw new ContainerException("Unexpected cancellation of action by user");
View Full Code Here

  public UINeoNode addNodeModel(Node node, Double posX, Double posY) throws ContainerException {
    if (!(node instanceof Network)) {
      throw new ContainerException("Only Networks are allowed to be added to the top-level Window");
    }

    UINeoNode nodeUI = UINeoNode.createNodeUI(node);

    if (posX != null && posY != null) {
      nodeUI.setOffset(posX, posY);

      getGround().addChild(nodeUI);
    } else {
      getGround().addChildFancy(nodeUI);
    }
View Full Code Here


  public Node getNodeModel(String name) {
    for (WorldObject wo : getGround().getChildren()) {
      if (wo instanceof UINeoNode) {
        UINeoNode nodeUI = (UINeoNode) wo;

        if (nodeUI.getName().equals(name)) {
          return nodeUI.getModel();
        }
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of ca.nengo.ui.models.UINeoNode

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.