csmart.runExperimentBuilder(experiment, false, openForEditing);
csmart.runExperimentBuilder(experiment, false);
  private void startExperimentBuilder(DefaultMutableTreeNode node,				      boolean openForEditing) {    Object o = node.getUserObject();    Experiment experiment;    if (o instanceof SocietyComponent) {      SocietyComponent sc = (SocietyComponent) o;      String name = "Experiment for " + sc.getSocietyName();      experiment = new Experiment(experimentNames.generateName(name),				  new SocietyComponent[] {sc},      				  new RecipeComponent[0]);    } else if (o instanceof RecipeComponent) {      RecipeComponent recipe = (RecipeComponent) o;      //} else if (o instanceof Recipe) {      //Recipe recipe = (Recipe) o;      String name = "Experiment for " + recipe.getRecipeName();      experiment = new Experiment(experimentNames.generateName(name),				  new SocietyComponent[0],      				  new RecipeComponent[] {recipe});    } else if (o instanceof Experiment) {      experiment = (Experiment) o;    } else if (o instanceof String) {      experiment = new Experiment(experimentNames.generateName(),				  getSocietyComponents(node),				  getRecipes(node));    } else {      return;    }    if (o instanceof Experiment) {      //Experiment already in tree    } else {      if (o instanceof String) {	// Add experiment under the given node	DefaultMutableTreeNode newNode = 	  new DefaultMutableTreeNode(experiment);	model.insertNodeInto(newNode, node, 0);	// make the new node be the selected node	workspace.setSelection(newNode);      } else {	// Add experiment as sibling of given node	DefaultMutableTreeNode newNode =	  new DefaultMutableTreeNode(experiment, false);	DefaultMutableTreeNode parentNode =	  (DefaultMutableTreeNode) node.getParent();	model.insertNodeInto(newNode, parentNode, parentNode.getIndex(node) + 1);	// make the new node be the selected node	workspace.setSelection(newNode);      }      experimentNames.add(experiment.getExperimentName());      experiment.addModificationListener(myModificationListener);    }    csmart.runExperimentBuilder(experiment, false, openForEditing);  }