} for (int i = 0; i < nodesToRun.length; i++) { NodeComponent nodeComponent = nodesToRun[i];
  private void prepareToCreateNodes() {    for (int i = 0; i < nodesToRun.length; i++) {      NodeComponent nodeComponent = nodesToRun[i];      // set configuration file name      nodeComponent.addProperty("ConfigurationFileName",                                nodeComponent.getShortName() + currentTrial);      String hostName = hostsToRunOn[i];      final String nodeName = nodeComponent.getShortName();      // create an unique node name to circumvent server problems      String uniqueNodeName = nodeName;      // get arguments from NodeComponent and pass them to ApplicationServer      // note that these properties augment any properties that      // are passed to the server in a properties file on startup      Properties properties = getNodeMinusD(nodeComponent);      String[] args = getNodeArguments(nodeComponent);      if (!experiment.isInDatabase()) {        // Can't change the name of the Nodes when running        // from the database, cause it needs to load those names        uniqueNodeName = nodeName + currentTrial;        properties.setProperty("org.cougaar.node.name", uniqueNodeName);        properties.setProperty("org.cougaar.filename", uniqueNodeName + ".ini");      } else        properties.setProperty("org.cougaar.experiment.id",                                experiment.getTrialID());      //Don't override if it's already set      if (properties.getProperty("org.cougaar.core.persistence.clear")           == null) {        properties.setProperty("org.cougaar.core.persistence.clear",                               "true");      }      // create a status button      NodeStatusButton statusButton = createStatusButton(nodeName, hostName);      ConsoleStyledDocument doc = new ConsoleStyledDocument();      ConsoleTextPane textPane = new ConsoleTextPane(doc, statusButton);      JScrollPane scrollPane = new JScrollPane(textPane);      // create a node event listener to get events from the node      NodeEventListener listener;      String logFileName = getLogFileName(nodeName);      try {        listener = new ConsoleNodeListener(this,                                           nodeComponent,                                           logFileName,                                           statusButton,                                           doc);      } catch (Exception e) {        System.err.println("Unable to create output for: " + nodeName);        continue;      }      if (notifyCondition != null)        textPane.setNotifyCondition(notifyCondition);      ((ConsoleStyledDocument)textPane.getStyledDocument()).setBufferSize(viewSize);      if (notifyOnStandardError)        statusButton.setNotifyOnStandardError(true);      if (displayFilter != null)        ((ConsoleNodeListener)listener).setFilter(displayFilter);      nodeListeners.put(nodeName, listener);      nodePanes.put(nodeName, textPane);      NodeEventFilter filter = new NodeEventFilter(10);      ConfigurationWriter configWriter =         experiment.getConfigurationWriter(nodesToRun);      HostServesClient hsc = null;      try {        hsc = communitySupport.getHost(hostName, getAppServerPort(properties));      } catch (Exception e) {        System.out.println("CSMARTConsole: cannot create node: " + nodeName);        JOptionPane.showMessageDialog(this,                                      "Cannot create node on: " + hostName +                                      "; check that server is running");        continue;      }      NodeCreationInfo nci =        new NodeCreationInfo(hsc, uniqueNodeName, properties, args,                             listener, filter, configWriter,                              nodeName, hostName,                             nodeComponent, scrollPane, statusButton,                             logFileName);      nodeCreationInfoList.add(nci);    }  }