_save_filechooser.setCurrentDirectory( new File( "." ) );
_save_filechooser.setMultiSelectionEnabled( false );
_save_filechooser.setFileFilter( MainFrameApplication.xmlfilter );
- _save_filechooser.addChoosableFileFilter( MainFrameApplication.nhxfilter );
_save_filechooser.addChoosableFileFilter( MainFrameApplication.nhfilter );
_save_filechooser.addChoosableFileFilter( MainFrameApplication.nexusfilter );
_save_filechooser.addChoosableFileFilter( _save_filechooser.getAcceptAllFileFilter() );
return exception;
}
- private boolean writeAsNHX( final Phylogeny t, boolean exception, final File file ) {
- try {
- final PhylogenyWriter writer = new PhylogenyWriter();
- writer.toNewHampshireX( t, file );
- }
- catch ( final Exception e ) {
- exception = true;
- exceptionOccuredDuringSaveAs( e );
- }
- return exception;
- }
-
private boolean writeAsPhyloXml( final Phylogeny t, boolean exception, final File file ) {
try {
final PhylogenyWriter writer = new PhylogenyWriter();
if ( _save_filechooser.getFileFilter() == MainFrameApplication.nhfilter ) {
exception = writeAsNewHampshire( t, exception, file );
}
- else if ( _save_filechooser.getFileFilter() == MainFrameApplication.nhxfilter ) {
- exception = writeAsNHX( t, exception, file );
- }
else if ( _save_filechooser.getFileFilter() == MainFrameApplication.xmlfilter ) {
exception = writeAsPhyloXml( t, exception, file );
}
|| file_name.endsWith( ".tree" ) ) {
exception = writeAsNewHampshire( t, exception, file );
}
- else if ( file_name.endsWith( ".nhx" ) ) {
- exception = writeAsNHX( t, exception, file );
- }
else if ( file_name.endsWith( ".nex" ) || file_name.endsWith( ".nexus" ) ) {
exception = writeAsNexus( t, exception, file );
}