selectedAut = guiSide.getCurrentSelection();
    public void actionPerformed(ActionEvent event) {        JMenuItem eventSource = (JMenuItem)event.getSource();        MainMenu.MenuID val = entries.get(eventSource);                FSA currAut;        int selectedAut;                switch (val) {            case FILE_NEW:                /* Datei -> Neu, prfen ob die aktuelle Datei gespeichert werden soll */                if (guiMain.options.getBoolValueForKey("ASKSAVE_OPTION", false)) {                    if (guiMain.checkSave(false, true))                        guiMain.newFile();                } else {                    guiMain.newFile();                }                                break;            case FILE_OPEN:                /* Datei -> ffnen, prfen ob aktuelle Datei gespeichert werden soll */                if (guiMain.options.getBoolValueForKey("ASKSAVE_OPTION", false)) {                    if (guiMain.checkSave(false, true))                        guiMain.openFile();                } else {                    guiMain.openFile();                }                break;            case FILE_SAVE:                guiMain.checkSave(true,false);                break;            case FILE_SAVEAS:                guiMain.checkSave(true,true);                break;            case FILE_OPTIONS:                guiMain.showOptions();                break;            case FILE_QUIT:                guiMain.saveOptions();                if (guiMain.options.getBoolValueForKey("ASKSAVE_OPTION", false)) {                    if (guiMain.checkSave(false, true))                        guiMain.dispose();                } else {                    guiMain.dispose();                }                break;            case ALGO_REPLACE:                guiMain.options.setBoolValueForKey("REPLACE_AUT", eventSource.isSelected());                guiMain.saveOptions();                break;            case ALGO_UNION:                SelectAutDialog selAutDlg = new SelectAutDialog(guiMain);                selAutDlg.run(guiSide.getList());                if (selAutDlg.getSelection()!=-1) {                    selectedAut = guiSide.getCurrentSelection();                    currAut = guiSide.getCurrentAut();                    FSA otherAut = guiSide.getList().get(selAutDlg.getSelection());                    guiSide.insertAut(FSAAlgo.autUnion(currAut, otherAut), guiMain.options.getBoolValueForKey("REPLACE_AUT", false));                }                break;            case ALGO_LANG:                guiMain.guessLang();                break;            case ALGO_DETERM:                guiMain.determ();                break;            case ALGO_REMISO:                currAut = guiSide.getCurrentAut();                 if (!currAut.isDeterministic()) {                    JOptionPane.showMessageDialog(guiMain, "Only DFA can be minimized.", "Warning", JOptionPane.WARNING_MESSAGE);                    break;                }                guiSide.insertAut(FSAAlgo.removeIsolatedStates(currAut), guiMain.options.getBoolValueForKey("REPLACE_AUT", false));                break;            case ALGO_COMPLEMENT:                // muhahaha, easy ;)                currAut = guiSide.getCurrentAut();                currAut.setName(currAut.getName()+"_compl");                currAut.invertStates();                guiSide.insertAut(currAut, guiMain.options.getBoolValueForKey("REPLACE_AUT", false));                break;            case VIEW_FITWINDOW:                guiMain.fitWindow();                break;            case VIEW_ALIGNGRID:                guiMain.alignToGrid();                break;            case HELP_ABOUT:                AboutDialog aboutDlg = new AboutDialog(guiMain,"About",true);                aboutDlg.run();                break;            case HELP_HELP:                HelpFrame myHelpFrame;                myHelpFrame = new HelpFrame(guiMain,"Help", true);                myHelpFrame.run();                break;            default:                System.err.println("menu event not handled");        }    }