oldNodes.put(nodeComponent, runningNodes.get(nodeComponent)); runningNodes.remove(nodeComponent);
if (runningNodes.get(nodeComponent) != null) { oldNodes.add(nodeComponent); runningNodes.remove(nodeComponent); }
  public void nodeStopped(NodeComponent nodeComponent) {    oldNodes.put(nodeComponent, runningNodes.get(nodeComponent));    runningNodes.remove(nodeComponent);    // enable restart command on node output window    desktop.getNodeFrame(nodeComponent.getShortName()).enableRestart();    // if any node has stopped, then don't kill the rest of the nodes    // when any node has stopped, kill the rest of the nodes    // unless we're already killing the other nodes    //    if (!stopping)     //      stopAllNodes();    // when all nodes have stopped, save results    // run the next trial and update the gui controls    if (runningNodes.isEmpty()) {      stopping = false;      trialFinished();      //      if (aborting) {        //	experimentFinished();      //	aborting = false;      //      } else if (haveMoreTrials()) {      if (haveMoreTrials()) {	if (!userStoppedTrials) {	  destroyOldNodes(); // destroy old guis before starting new ones	  runTrial(); // run next trial	} else { // user stopped trials, allow them to run the next one	  runButton.setSelected(false);	}      } else { // no more trials, experiment is done	experimentFinished();      }    }  }