} else if (o instanceof Experiment) { popupMenu.show(tree, e.getX(), e.getY()); } else if (popupNode == societies) { societiesMenu.show(tree, e.getX(), e.getY()); } else if (popupNode == recipes) { recipesMenu.show(tree, e.getX(), e.getY()); }
  private void doPopup(MouseEvent e) {    TreePath selPath = tree.getPathForLocation(e.getX(), e.getY());    if (selPath == null) return;    // set the selected node to be the node the mouse is pointing at    tree.setSelectionPath(selPath);    DefaultMutableTreeNode popupNode =      (DefaultMutableTreeNode) selPath.getLastPathComponent();    Object o = popupNode.getUserObject();    if (o instanceof SocietyComponent) {    } else if (o instanceof RecipeComponent) {      popupMenu.show(tree, e.getX(), e.getY());    } else if (o instanceof Experiment) {      popupMenu.show(tree, e.getX(), e.getY());    } else if (popupNode == societies) {      societiesMenu.show(tree, e.getX(), e.getY());    } else if (popupNode == recipes) {      recipesMenu.show(tree, e.getX(), e.getY());    }  }