JAL-2629 current hmmer commands are now executed in threads
[jalview.git] / src / jalview / bin / Jalview.java
index 966e952..76f9958 100755 (executable)
@@ -20,9 +20,6 @@
  */
 package jalview.bin;
 
-import groovy.lang.Binding;
-import groovy.util.GroovyScriptEngine;
-
 import jalview.ext.so.SequenceOntology;
 import jalview.gui.AlignFrame;
 import jalview.gui.Desktop;
@@ -66,6 +63,9 @@ import java.util.Vector;
 
 import javax.swing.UIManager;
 
+import groovy.lang.Binding;
+import groovy.util.GroovyScriptEngine;
+
 /**
  * Main class for Jalview Application <br>
  * <br>
@@ -175,8 +175,11 @@ public class Jalview
    * 
    * @param args
    *          open <em>filename</em>
+   * @throws InterruptedException
+   * @throws IOException
    */
   public static void main(String[] args)
+          throws IOException, InterruptedException
   {
     instance = new Jalview();
     instance.doMain(args);
@@ -184,8 +187,10 @@ public class Jalview
 
   /**
    * @param args
+   * @throws InterruptedException
+   * @throws IOException
    */
-  void doMain(String[] args)
+  void doMain(String[] args) throws IOException, InterruptedException
   {
     System.setSecurityManager(null);
     System.out.println("Java version: "
@@ -578,18 +583,14 @@ public class Jalview
         data = aparser.getValue("tree", true);
         if (data != null)
         {
-          jalview.io.NewickFile fin = null;
           try
           {
             System.out.println("CMD [-tree " + data
                     + "] executed successfully!");
-            fin = new NewickFile(data,
+            NewickFile nf = new NewickFile(data,
                     AppletFormatAdapter.checkProtocol(data));
-            if (fin != null)
-            {
-              af.getViewport().setCurrentTree(
-                      af.ShowNewickTree(fin, data).getTree());
-            }
+            af.getViewport().setCurrentTree(
+                    af.showNewickTree(nf, data).getTree());
           } catch (IOException ex)
           {
             System.err.println("Couldn't add tree " + data);
@@ -972,7 +973,7 @@ public class Jalview
     }
     try
     {
-      Map<String, Object> vbinding = new HashMap<String, Object>();
+      Map<String, Object> vbinding = new HashMap<>();
       vbinding.put("Jalview", this);
       if (af != null)
       {
@@ -1039,7 +1040,7 @@ public class Jalview
                         + nickname + "|" + url);
         if (source == null)
         {
-          source = new Vector<String>();
+          source = new Vector<>();
         }
         source.addElement(nickname);
       }
@@ -1057,7 +1058,7 @@ public class Jalview
       System.out.println("adding source '" + data + "'");
       if (source == null)
       {
-        source = new Vector<String>();
+        source = new Vector<>();
       }
       source.addElement(data);
     }