JAL-2797 added constructor including embedded/standalone boolean
[jalview.git] / forester / java / src / org / forester / archaeopteryx / Archaeopteryx.java
index 648fd65..43481f5 100644 (file)
@@ -44,6 +44,15 @@ public final class Archaeopteryx {
         return createApplication( phylogenies, "", "" );
     }
 
+    public static MainFrame createApplication( final Phylogeny phylogeny, final Configuration config, final String title ) {
+        final Phylogeny[] phylogenies = new Phylogeny[ 1 ];
+        phylogenies[ 0 ] = phylogeny;
+        return MainFrameApplication.createInstance( phylogenies, config, title );
+    }
+    public static MainFrame createApplication( final Phylogeny[] phylogenies, final Configuration config, final String title ) {
+        return MainFrameApplication.createInstance( phylogenies, config, title );
+    }
+    
     public static MainFrame createApplication( final Phylogeny[] phylogenies ) {
         return createApplication( phylogenies, "", "" );
     }
@@ -54,13 +63,7 @@ public final class Archaeopteryx {
         return MainFrameApplication.createInstance( phylogenies, config_file_name, title );
     }
 
-    public static MainFrame createApplication( final Phylogeny phylogeny, final Configuration config, final String title ) {
-        final Phylogeny[] phylogenies = new Phylogeny[ 1 ];
-        phylogenies[ 0 ] = phylogeny;
-        return MainFrameApplication.createInstance( phylogenies, config, title );
-    }
-
-    public static void main( final String args[] ) {
+    public static MainFrame main( final String args[] ) {
         Phylogeny[] phylogenies = null;
         String config_filename = null;
         Configuration conf = null;
@@ -84,11 +87,11 @@ public final class Archaeopteryx {
                     f = new File( args[ filename_index ] );
                     final String err = ForesterUtil.isReadableFile( f );
                     if ( !ForesterUtil.isEmpty( err ) ) {
-                        ForesterUtil.fatalError( Constants.PRG_NAME, err );
+                        ForesterUtil.fatalError( AptxConstants.PRG_NAME, err );
                     }
                     boolean nhx_or_nexus = false;
                     final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( f, conf
-                            .isValidatePhyloXmlAgainstSchema() );
+                                                                                           .isValidatePhyloXmlAgainstSchema() );
                     if ( p instanceof NHXParser ) {
                         nhx_or_nexus = true;
                         final NHXParser nhx = ( NHXParser ) p;
@@ -115,7 +118,7 @@ public final class Archaeopteryx {
             }
         }
         catch ( final Exception e ) {
-            ForesterUtil.fatalError( Constants.PRG_NAME, "failed to start: " + e.getLocalizedMessage() );
+            ForesterUtil.fatalError( AptxConstants.PRG_NAME, "failed to start: " + e.getLocalizedMessage() );
         }
         String title = "";
         if ( f != null ) {
@@ -126,7 +129,7 @@ public final class Archaeopteryx {
             current_dir = new File( "." );
         }
         try {
-            MainFrameApplication.createInstance( phylogenies, conf, title, current_dir );
+           return MainFrameApplication.createInstance( phylogenies, conf, title, current_dir );
         }
         catch ( final OutOfMemoryError e ) {
             AptxUtil.outOfMemoryError( e );
@@ -137,5 +140,5 @@ public final class Archaeopteryx {
         catch ( final Error e ) {
             AptxUtil.unexpectedError( e );
         }
-    }
+    return null;}
 }
\ No newline at end of file