} else { if (trialBuilder == null) { trialBuilder = new TrialBuilder(experiment); tabbedPane.add("Trials", trialBuilder); } else trialBuilder.reinit(experiment);
} if (threadBuilder == null) { threadBuilder = new ThreadBuilder(experiment); tabbedPane.add("Threads", threadBuilder); } else threadBuilder.reinit(experiment); } else { if (trialBuilder == null) { trialBuilder = new TrialBuilder(experiment); tabbedPane.add("Trials", trialBuilder); } else trialBuilder.reinit(experiment); if (threadBuilder != null) { tabbedPane.remove(threadBuilder); threadBuilder = null;
  public void reinit(Experiment newExperiment) {    // restore editable flag on previous experiment    if (isEditable)       experiment.setEditable(isEditable);    if (isRunnable)      experiment.setRunnable(isRunnable);    experiment = newExperiment;    isEditable = newExperiment.isEditable();    isRunnable = newExperiment.isRunnable();    propertyBuilder.reinit(experiment);    hostConfigurationBuilder.reinit(experiment);    // only display trial builder for non-database experiments    if (experiment.isInDatabase()) {      if (trialBuilder != null) {        tabbedPane.remove(trialBuilder);        trialBuilder = null;      } else {        if (trialBuilder == null) {          trialBuilder = new TrialBuilder(experiment);          tabbedPane.add("Trials", trialBuilder);        } else          trialBuilder.reinit(experiment);      }    }    experiment.setEditable(false);    experiment.setRunnable(false);  }