else if (ae.getActionCommand().equals("importImg")) { importImg();  updatePaletteDisplay(); tileSelector.repaint(); arrangementEditor.clearSelection(); arrangementEditor.repaint(); updateTileEditor(); }
    public void actionPerformed(ActionEvent ae)    {        if (ae.getActionCommand().equals("drawingArea"))        {            getSelectedStation()                .setTile(getCurrentTile(), da.getByteArrImage());            tileSelector.repaintCurrent();            arrangementEditor.repaintCurrentTile();            fi.setFocus(da);        }        else if (ae.getActionCommand().equals("arrangementEditor"))        {            fi.setFocus(arrangementEditor);        }        else if (ae.getActionCommand().equals("tileSelector"))        {            updateTileEditor();        }        else if (ae.getActionCommand().equals("palSelector"))        {            updatePaletteDisplay();            tileSelector.repaint();            arrangementEditor.repaint();            da.repaint();        }        else if (ae.getActionCommand().equals("paletteEditor"))        {            getSelectedStation().setPaletteColor(pal.getSelectedColorIndex(),                getCurrentSubPalette(), pal.getNewColor());            updatePaletteDisplay();            da.repaint();            tileSelector.repaint();            arrangementEditor.repaint();        }        //flip        else if (ae.getActionCommand().equals("hFlip"))        {            da.doHFlip();        }        else if (ae.getActionCommand().equals("vFlip"))        {            da.doVFlip();        }        //edit menu        //undo        else if (ae.getActionCommand().equals("undo"))        {            fi.getCurrentUndoable().undo();        }        //copy&paste stuff        else if (ae.getActionCommand().equals("cut"))        {            fi.getCurrentCopyAndPaster().cut();        }        else if (ae.getActionCommand().equals("copy"))        {            fi.getCurrentCopyAndPaster().copy();        }        else if (ae.getActionCommand().equals("paste"))        {            fi.getCurrentCopyAndPaster().paste();        }        else if (ae.getActionCommand().equals("delete"))        {            fi.getCurrentCopyAndPaster().delete();        }        else if (ae.getActionCommand().equals("copyPal"))        {            copyPal();        }        else if (ae.getActionCommand().equals("pastePal"))        {            pastePal();        }        else if (ae.getActionCommand().equals("tileSelGridLines"))        {            mainWindow.getContentPane().invalidate();            tileSelector.invalidate();            tileSelector.resetPreferredSize();            tileSelector.validate();            tileSelector.repaint();            mainWindow.getContentPane().validate();        }        else if (ae.getActionCommand().equals("arrEdGridLines"))        {            mainWindow.getContentPane().invalidate();            arrangementEditor.invalidate();            arrangementEditor.resetPreferredSize();            arrangementEditor.validate();            arrangementEditor.repaint();            mainWindow.getContentPane().validate();        }        else if (ae.getActionCommand().equals("import"))        {            importData();            updatePaletteDisplay();            tileSelector.repaint();            arrangementEditor.clearSelection();            arrangementEditor.repaint();            updateTileEditor();        }        else if (ae.getActionCommand().equals("export"))        {            exportData();        }        else if (ae.getActionCommand().equals("apply"))        {            //TownMap.writeInfo() will only write if the map has been inited            for (int i = 0; i < gasStations.length; i++)                gasStations[i].writeInfo();            //            int m = getCurrentStation();            //            gasStationNames[m] = name.getText();            //            notifyDataListeners(gasStationNames, this, m);            //            writeArray("gasStationNames.txt", false, gasStationNames);        }        else if (ae.getActionCommand().equals("close"))        {            hide();        }        else        {            System.err                .println("GasStationEditor.actionPerformed: ERROR: unhandled "                    + "action command: \"" + ae.getActionCommand() + "\"");        }    }