fileChooser.setAcceptAllFileFilterUsed(false);
if (fileChooser.showSaveDialog(getShellComponent()) ==
JFileChooser.APPROVE_OPTION) {
if (fileChooser.getFileFilter() == svgFilter) {
try {
SvgExporter exporter = new SvgExporter();
exporter.writeSVG(appState.getCurrentEditor(),
fileChooser.getSelectedFile());
} catch (IOException ex) {
JOptionPane.showMessageDialog(getShellComponent(),
ex.getMessage(), getResourceString("error.exportgfx.title"),
JOptionPane.ERROR_MESSAGE);
}
} else if (fileChooser.getFileFilter() == pngFilter) {
try {
PngExporter exporter = new PngExporter();
exporter.writePNG(appState.getCurrentEditor(),
fileChooser.getSelectedFile());
} catch (IOException ex) {
JOptionPane.showMessageDialog(getShellComponent(),
ex.getMessage(), getResourceString("error.exportgfx.title"),
JOptionPane.ERROR_MESSAGE);