recipeNames.remove(component.getShortName());
if (findNode(component) == null) { recipeNames.remove(component.getShortName()); removeRecipeFromList((RecipeComponent)component); }
  public void replaceComponent(Experiment experiment,                               ModifiableComponent component,                               ModifiableComponent newComponent) {    // find experiment node    DefaultMutableTreeNode expNode = findNode(experiment);    if (expNode == null) {      if (log.isErrorEnabled()) {        log.error("Experiment is not in tree: " +                   experiment.getExperimentName());      }      return;    }    // find component node in experiment    DefaultMutableTreeNode componentNode = null;    Enumeration nodes = expNode.depthFirstEnumeration();    while (nodes.hasMoreElements()) {      DefaultMutableTreeNode node = 	(DefaultMutableTreeNode)nodes.nextElement();      if (node.getUserObject().equals(component)) {        componentNode = node;        break;      }    }    if (componentNode == null) {      if (log.isErrorEnabled()) {        log.error("Component is not in experiment: " +                   component.getShortName());      }      return;    }    model.removeNodeFromParent(componentNode);    if (component instanceof SocietyComponent) {      societyNames.remove(component.getShortName());      addSocietyToWorkspace((SocietyComponent)newComponent, expNode);    } else if (component instanceof RecipeComponent) {      recipeNames.remove(component.getShortName());      addRecipeToWorkspace((RecipeComponent)newComponent, expNode);    }  }