saveMenuItem.setEnabled(graph.hasOutputFile());
  public void actionPerformed(ActionEvent evt) {    String command = ((JMenuItem)evt.getSource()).getText();    if (command.equals(FIND_MENU_ITEM)) {      findNode();      return;    }    if (command.equals(CLEAR_MENU_ITEM)) {      if (evt.getSource() instanceof JComponent) {	JComponent component = (JComponent)evt.getSource();	if (component.getParent() instanceof JPopupMenu) {	  JPopupMenu parentMenu = (JPopupMenu)component.getParent();	  JMenu menu = (JMenu)parentMenu.getInvoker();	  if (menu.getText().equals(SHOW_MENU)) {	    graph.resetColors();	  } else {	    graph.clearSelection();	    graph.resetColors();	    enableSelectedMenus(false);	  }	}      }      return;    }    if (command.equals(SELECT_ALL_MENU_ITEM)) {      graph.selectAll();      enableSelectedMenus(true);      return;    }    if (command.equals(OVERVIEW_MENU_ITEM)) {      displayOverview();      return;    }    if (command.equals(ATTRIBUTES_MENU_ITEM)) {      Node selectedNode = getSelectedNode();      if (selectedNode != null)	displayAttributes(selectedNode);      return;    }    if (command.equals(CLOSE_MENU_ITEM)) {      //      Util.getNamedFrame().removeFrame(this);      NamedFrame.getNamedFrame().removeFrame(this);      // always get rid of overview and attribute frames      for (int i = 0; i < associatedFrames.size(); i++)	((JFrame)associatedFrames.elementAt(i)).dispose();      associatedFrames.removeAllElements();      overviewFrame = null;      this.dispose();      return;    }    // save graph into file it was read from    if (command.equals(SAVE_MENU_ITEM)) {      graph.saveGraph();      return;    }    if (command.equals(SAVE_AS_MENU_ITEM)) {      graph.saveAsGraph();      return;    }    if (command.equals(ZOOM_IN_MENU_ITEM)) {      gp.multiplyScaleFactor(1.25);      gp.repaint();      return;    }    if (command.equals(ZOOM_OUT_MENU_ITEM)) {      gp.multiplyScaleFactor(0.8);      gp.repaint();      return;    }    if (command.equals(ZOOM_RESET_MENU_ITEM)) {      gp.resetZoom();      gp.repaint();      return;    }    if (command.equals(SCROLL_TO_SELECTED_MENU_ITEM)) {      scrollToSelected();      return;    }    if (command.equals(PRINT_MENU_ITEM)) {      // print grappa panel      //      ComponentPrinter printer = new ComponentPrinter(gp, this.title);      ComponentPrinter printer = new ComponentPrinter(viewport, this.title);      printer.printPages();      return;    }    if (command.equals(ABOUT_CSMART_ITEM)) {      URL about = (URL)getClass().getResource(ABOUT_DOC);      if (about != null)	Browser.setPage(about);      return;    }    if (command.equals(HELP_MENU_ITEM)) {      //      System.err.println("Try to open " + HELP_DOC);      URL help = (URL)getClass().getResource(HELP_DOC);      if (help != null)	Browser.setPage(help);      return;    }    JOptionPane.showMessageDialog(this, "Not implemented: " + command);  }