nodeNodeMenu.show(nodeTree, e.getX(), e.getY());
if (nodeTree.isEditable()) nodeNodeMenu.show(nodeTree, e.getX(), e.getY()); else viewOnlyMenu.show(nodeTree, e.getX(), e.getY());
  private void displayNodeTreeMenu(MouseEvent e) {    // the path to the node the mouse is pointing at    TreePath selPath = nodeTree.getPathForLocation(e.getX(), e.getY());    if (selPath == null)      return;    // if the mouse is pointing at a selected node    // and all selected nodes are of the same type, then act on all of them    TreePath[] selectedPaths = nodeTree.getSelectionPaths();    if (nodeTree.isPathSelected(selPath) && selectedPaths.length > 1) {      boolean haveNodes = false;      for (int i = 0; i < selectedPaths.length; i++) {        DefaultMutableTreeNode selNode =          (DefaultMutableTreeNode)selectedPaths[i].getLastPathComponent();        ConsoleTreeObject selected =          (ConsoleTreeObject)selNode.getUserObject();        if (selected.isNode())          haveNodes = true;        else {          haveNodes = false;          break;        }      }      // handle multiple selected nodes      // disable menu command to set individual node command line arguments      if (haveNodes) {        cmdLineNodeMenuItem.setEnabled(false);        nodeNodeMenu.show(nodeTree, e.getX(), e.getY());        return;      }    } else {      // set the selected node to be the node the mouse is pointing at      nodeTree.setSelectionPath(selPath);      DefaultMutableTreeNode selNode =        (DefaultMutableTreeNode)selPath.getLastPathComponent();      ConsoleTreeObject selected =        (ConsoleTreeObject)selNode.getUserObject();      // display popup menu      if (selected.isRoot())        nodeRootMenu.show(nodeTree, e.getX(), e.getY());      else if (selected.isNode()) {        cmdLineNodeMenuItem.setEnabled(true);        nodeNodeMenu.show(nodeTree, e.getX(), e.getY());      }    }  }