} else if (command.equals("Flip Vertical")) {
} else if (src == mFlipVer) {
    private void handleEvent(ActionEvent event) {        String command = event.getActionCommand();        if (command.equals("Open...")) {            if (checkSave()) {            	openMap();            }        } else if (command.equals("Exit")) {            if (checkSave()) {            	try {                    TiledConfiguration.write("tiled.conf");                } catch (Exception e) {                    e.printStackTrace();                }                System.exit(0);            }        } else if (command.equals("Close")) {            if (checkSave()) {            	setCurrentMap(null);            }        } else if (command.equals("New")) {        	if (checkSave()) {            	newMap();        	}        } else if (command.equals("Print...")) {            try {                MapPrinter mp = new MapPrinter();                mp.print(mapView);            } catch (PrinterException e) {                e.printStackTrace();            }        } else if (command.equals("Add Layer") ||                command.equals("Duplicate Layer") ||                command.equals("Delete Layer") ||                command.equals("Move Layer Up") ||                command.equals("Move Layer Down") ||                command.equals("Merge Down") ||                command.equals("Merge All")) {            doLayerStateChange(event);        } else if (command.equals("New tileset...")) {            if (currentMap != null) {                NewTilesetDialog dialog =                    new NewTilesetDialog(appFrame, currentMap);                TileSet newSet = dialog.create();                if (newSet != null) {                    currentMap.addTileset(newSet);                }            }        } else if (command.equals("Import tileset...")) {            if (currentMap != null) {                JFileChooser ch = new JFileChooser(currentMap.getFilename());				ch.setFileFilter(new TiledFileFilter());                int ret = ch.showOpenDialog(appFrame);                if (ret == JFileChooser.APPROVE_OPTION) {                    String filename = ch.getSelectedFile().getAbsolutePath();                    MapReader mr = new XMLMapTransformer();                    try {                        TileSet set = mr.readTileset(filename);                        set.setSource(null);                        currentMap.addTileset(set);                    } catch (Exception e) {                        e.printStackTrace();                    }                }            }        } else if (command.equals("Tileset Manager")) {            if (currentMap != null) {                TilesetManager manager = new TilesetManager(this, currentMap);                manager.show();            }        } else if (command.equals("Save")) {            if (currentMap != null) {                saveMap(currentMap.getFilename(),false);            }        } else if (command.equals("Save as...")) {            if (currentMap != null) {            	saveMap(currentMap.getFilename(), true);            }        } else if (command.equals("Properties")) {            MapPropertiesDialog pd = new MapPropertiesDialog(appFrame, this);            pd.getProps();        } else if (command.equals("Zoom In")) {            zoomIn();        } else if (command.equals("Zoom Out")) {            zoomOut();        } else if (command.equals("Zoom Normalsize")) {            if (currentMap != null) {                zoomIn.setEnabled(true);                zoomOut.setEnabled(true);                zoomNormal.setEnabled(false);                mapView.setZoomLevel(MapView.ZOOM_NORMALSIZE);            }        } else if (command.equals("Show Grid") ||                command.equals("Hide Grid")) {            // Toggle grid            mapView.toggleMode(MapView.PF_GRIDMODE);        } else if (command.equals("Undo")) {            undoStack.undo();            updateHistory();            mapView.repaint();        }  else if (command.equals("Redo")) {            undoStack.redo();            updateHistory();            mapView.repaint();        } else if(command.equals("Resize")) {            ResizeDialog rd = new ResizeDialog(this);            rd.showDialog();        } else if (command.equals("About")) {            if (aboutDialog == null) {                aboutDialog = new AboutDialog(appFrame);            }            aboutDialog.show();        } else if (command.substring(0, command.length() < 5 ? command.length() : 5).equals("_open")) {            try {                loadMap(TiledConfiguration.getValue(                            "tmx.recent." + command.substring(5)));            } catch (Exception e) {                e.printStackTrace();            }        } else if (command.equals("Preferences...")) {            ConfigurationDialog d = new ConfigurationDialog(appFrame);            d.configure();        } else if (command.equals("Flip Horizontal")) {            MapLayer layer = currentMap.getLayer(currentLayer);			            paintEdit = new MapLayerEdit(currentMap, new MapLayer(layer));            currentMap.getLayer(currentLayer).mirror(MapLayer.MIRROR_HORIZONTAL);            layer = new MapLayer(currentMap.getLayer(currentLayer));            paintEdit.end(layer);            paintEdit.setPresentationName("Flip Horizontal");            undoStack.addEdit(paintEdit);            updateHistory();            mapView.repaint();        } else if (command.equals("Flip Vertical")) {            MapLayer layer = currentMap.getLayer(currentLayer);            paintEdit = new MapLayerEdit(currentMap, new MapLayer(layer));            paintEdit.setPresentationName("Flip Vertical");            layer.mirror(MapLayer.MIRROR_VERTICAL);            paintEdit.end(new MapLayer(layer));            undoStack.addEdit(paintEdit);            updateHistory();            mapView.repaint();        } else if (command.equals("Rotate 90")) {            MapLayer layer = currentMap.getLayer(currentLayer);            paintEdit = new MapLayerEdit(currentMap, new MapLayer(layer));            paintEdit.setPresentationName("Rotate 90");            layer.rotate(MapLayer.ROTATE_90);            paintEdit.end(new MapLayer(layer));            undoStack.addEdit(paintEdit);            updateHistory();            mapView.repaint();        } else if (command.equals("Rotate 180")) {            MapLayer layer = currentMap.getLayer(currentLayer);            paintEdit = new MapLayerEdit(currentMap, new MapLayer(layer));            paintEdit.setPresentationName("Rotate 180");            layer.rotate(MapLayer.ROTATE_180);            paintEdit.end(new MapLayer(layer));            undoStack.addEdit(paintEdit);            updateHistory();            mapView.repaint();        } else if (command.equals("Rotate 270")) {            MapLayer layer = currentMap.getLayer(currentLayer);            paintEdit = new MapLayerEdit(currentMap, new MapLayer(layer));            paintEdit.setPresentationName("Rotate 270");            layer.rotate(MapLayer.ROTATE_270);            paintEdit.end(new MapLayer(layer));            undoStack.addEdit(paintEdit);            updateHistory();            mapView.repaint();        } else {            System.out.println(event);        }    }