public void cloneEmitter ( ) { if ( selected == null ) { return ; } try { ByteArrayOutputStream bout = new ByteArrayOutputStream ( ) ; ParticleIO . saveEmitter ( bout , selected ) ; ByteArrayInputStream bin = new ByteArrayInputStream ( bout . toByteArray ( ) ) ; ConfigurableEmitter emitter = ParticleIO . loadEmitter ( bin ) ; emitter . name = emitter . name + "_clone" ; addEmitter ( emitter ) ; emitters . setSelected ( emitter ) ; } catch ( IOException e ) { Log . error ( e ) ; JOptionPane . showMessageDialog ( this , e . getMessage ( ) ) ; } }
Clone the selected emitter