for (int i = 0, n = experiment.getSocietyComponentCount(); i < n; i++) { addSocietyComponent(experiment.getSocietyComponent(i));
SocietyComponent society = experiment.getSocietyComponent(); if (society != null) { addSocietyComponent(society);
  private void initDisplay() {    model.removeTreeModelListener(myTreeModelListener);    societies.removeAllChildren();    recipes.removeAllChildren();    model.nodeStructureChanged(root);    DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer();    if (!isEditable) {      renderer.setTextNonSelectionColor(Color.gray);      renderer.setTextSelectionColor(Color.gray);    }    tree.setCellRenderer(renderer);    tree.setEditable(isEditable);    for (int i = 0, n = experiment.getSocietyComponentCount(); i < n; i++) {      addSocietyComponent(experiment.getSocietyComponent(i));    }    for (int i = 0, n = experiment.getRecipeCount(); i < n; i++) {      addRecipe(experiment.getRecipe(i));    }    tree.expandNode(societies);    tree.expandNode(recipes);    model.addTreeModelListener(myTreeModelListener);    updateTrialCount();  }