HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents != null && agents.length > 0) { runButton.setEnabled(true); return; } }
if (experiment != null) { HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.length; i++) { NodeComponent[] nodes = hosts[i].getNodes(); if (nodes != null && nodes.length > 0) { for (int j = 0; j < nodes.length; j++) { AgentComponent[] agents = nodes[j].getAgents(); if (agents != null && agents.length > 0) { runButton.setEnabled(true); return; } } }
  private void initRunButton() {    HostComponent[] hosts = experiment.getHostComponents();    for (int i = 0; i < hosts.length; i++) {      NodeComponent[] nodes = hosts[i].getNodes();      if (nodes != null && nodes.length > 0) {	for (int j = 0; j < nodes.length; j++) {	  AgentComponent[] agents = nodes[j].getAgents();	  if (agents != null && agents.length > 0) {	    runButton.setEnabled(true);	    return;	  }	}      }    }    runButton.setEnabled(false);  }