MapPropertiesDialog pd = new MapPropertiesDialog(appFrame, this);
PropertiesDialog pd = new PropertiesDialog(appFrame, currentMap.getAllProperties()); pd.setTitle("Map Properties");
    private void handleEvent(ActionEvent event) {        String command = event.getActionCommand();        Object src = event.getSource();        if (command.equals("Open...")) {            if (checkSave()) {                openMap();            }        } else if (command.equals("Exit")) {            exit();        } 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.setVisible(true);            }        } 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("Layer Properties")) {            PropertiesDialog lpd =                new PropertiesDialog(appFrame,  currentMap.getLayer(this.currentLayer).getAllProperties());            lpd.setTitle(currentMap.getLayer(this.currentLayer).getName()+" Properties");            lpd.getProps();        } else if (command.equals("Show Boundaries") ||                command.equals("Hide Boundaries")) {            mapView.toggleMode(MapView.PF_BOUNDARYMODE);        } else if (command.equals("Show Grid") ||                command.equals("Hide Grid")) {            // Toggle grid            mapView.toggleMode(MapView.PF_GRIDMODE);        } else if (command.equals("Resize")) {            ResizeDialog rd = new ResizeDialog(appFrame, this);            rd.showDialog();        }  else if (command.equals("Search")) {            SearchDialog sd = new SearchDialog(appFrame, currentMap);            sd.showDialog();        } else if (command.equals("About Tiled")) {            if (aboutDialog == null) {                aboutDialog = new AboutDialog(appFrame);            }            aboutDialog.setVisible(true);        } else if (command.equals("About Plug-ins")) {            if (pluginDialog == null) {                pluginDialog = new PluginDialog(appFrame, pluginLoader);            }            pluginDialog.setVisible(true);        } else if (command.substring(0, command.length() < 5 ? command.length() : 5).equals("_open")) {            try {                loadMap(configuration.getValue(                            "tmx.recent." + command.substring(5)));            } catch (Exception e) {                e.printStackTrace();            }        } else if (command.equals("Preferences...")) {            ConfigurationDialog d = new ConfigurationDialog(appFrame);            d.configure();        } else {            System.out.println(event);        }    }