public void exportEmitter ( ) { if ( selected == null ) { return ; } chooser . setDialogTitle ( "Save" ) ; int resp = chooser . showSaveDialog ( this ) ; if ( resp == JFileChooser . APPROVE_OPTION ) { File file = chooser . getSelectedFile ( ) ; if ( ! file . getName ( ) . endsWith ( ".xml" ) ) { file = new File ( file . getAbsolutePath ( ) + ".xml" ) ; } try { ParticleIO . saveEmitter ( file , selected ) ; } catch ( IOException e ) { Log . error ( e ) ; JOptionPane . showMessageDialog ( this , e . getMessage ( ) ) ; } } }
Export an emitter XML file