3253-omnibus save
[jalview.git] / src / jalview / bin / Jalview.java
index 5d82015..0ec9ee0 100755 (executable)
@@ -598,7 +598,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
       System.out.println("No files to open!");
       System.exit(1);
     }
-    boolean haveImport = checkStartVamas(aparser);
+    boolean haveImport = false;// checkStartVamas(aparser);
     // Finally, deal with the remaining input data.
     long progress = -1;
     if (file == null && isJavaAppletTag)
@@ -692,7 +692,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
         System.out.println("CMD [nocalculation] executed successfully!");
       }
 
-      AlignFrame af = new FileLoader(!headless).loadFileWaitTillLoaded(file,
+      AlignFrame af = new FileLoader(!headless).LoadFileWaitTillLoaded(file,
               protocol, format);
       if (af == null)
       {
@@ -713,7 +713,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
             // TODO ?
           }
           AlignFrame af2 = new FileLoader(!headless)
-                  .loadFileWaitTillLoaded(file2, protocol, format);
+                  .LoadFileWaitTillLoaded(file2, protocol, format);
           if (af2 == null)
           {
             System.out.println("error");
@@ -933,7 +933,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
       }
 
       startUpAlframe = new FileLoader(!headless)
-              .loadFileWaitTillLoaded(file, protocol, format);
+              .LoadFileWaitTillLoaded(file, protocol, format);
       // extract groovy arguments before anything else.
     }
 
@@ -965,99 +965,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
     return null;
   }
 
-  private boolean checkStartVamas(ArgsParser aparser)
-  {
-    String vamsasImport = aparser.getValue(ArgsParser.VDOC);
-    String vamsasSession = aparser.getValue(ArgsParser.VSESS);
-    if (vamsasImport == null && vamsasSession == null)
-    {
-      return false;
-    }
-    if (desktop == null || headless)
-    {
-      System.out.println(
-              "Headless vamsas sessions not yet supported. Sorry.");
-      System.exit(1);
-    }
-    boolean haveImport = (vamsasImport != null);
-    if (haveImport)
-    {
-      // if we have a file, start a new session and import it.
-      boolean inSession = false;
-      try
-      {
-        DataSourceType viprotocol = AppletFormatAdapter
-                .checkProtocol(vamsasImport);
-        if (viprotocol == DataSourceType.FILE)
-        {
-          inSession = desktop.vamsasImport(new File(vamsasImport));
-        }
-        else if (viprotocol == DataSourceType.URL)
-        {
-          inSession = desktop.vamsasImport(new URL(vamsasImport));
-        }
-
-      } catch (Exception e)
-      {
-        System.err.println("Exeption when importing " + vamsasImport
-                + " as a vamsas document.");
-        e.printStackTrace();
-      }
-      if (!inSession)
-      {
-        System.err.println("Failed to import " + vamsasImport
-                + " as a vamsas document.");
-      }
-      else
-      {
-        System.out.println("Imported Successfully into new session "
-                + desktop.getVamsasApplication().getCurrentSession());
-      }
-    }
-    if (vamsasSession != null)
-    {
-      if (vamsasImport != null)
-      {
-        // close the newly imported session and import the Jalview specific
-        // remnants into the new session later on.
-        desktop.vamsasStop_actionPerformed(null);
-      }
-      // now join the new session
-      try
-      {
-        if (desktop.joinVamsasSession(vamsasSession))
-        {
-          System.out.println(
-                  "Successfully joined vamsas session " + vamsasSession);
-        }
-        else
-        {
-          System.err.println("WARNING: Failed to join vamsas session "
-                  + vamsasSession);
-        }
-      } catch (Exception e)
-      {
-        System.err.println(
-                "ERROR: Failed to join vamsas session " + vamsasSession);
-        e.printStackTrace();
-      }
-      if (vamsasImport != null)
-      {
-        // the Jalview specific remnants can now be imported into the new
-        // session at the user's leisure.
-        Cache.log.info(
-                "Skipping Push for import of data into existing vamsas session.");
-        // TODO:
-        // enable
-        // this
-        // when
-        // debugged
-        // desktop.getVamsasApplication().push_update();
-      }
-    }
-    return haveImport;
-  }
-
   /**
    * Writes an output file for each format (if any) specified in the
    * command-line arguments. Supported formats are currently
@@ -1387,23 +1294,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
   }
 
   /**
-   * Get the SwingJS applet ID and combine that with the frameType
-   * 
-   * @param frameType
-   *          "alignment", "desktop", etc., or null
-   * @return
-   */
-  public static String getAppID(String frameType)
-  {
-    String id = Cache.getProperty("Info.j2sAppletID");
-    if (id == null)
-    {
-      id = "jalview";
-    }
-    return id + (frameType == null ? "" : "-" + frameType);
-  }
-
-  /**
    * Handle all JalviewLite applet parameters
    * 
    * @param aparser
@@ -1886,7 +1776,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
     {
       alf = getCurrentAlignFrame();
     }
-    return appLoader.getFeaturesFrom(alf, format);
+    return appLoader.getFeaturesFrom(alf, format, true, false);
   }
 
   @Override
@@ -2266,4 +2156,21 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
     }
   }
 
+  /**
+   * Get the SwingJS applet ID and combine that with the frameType
+   * 
+   * @param frameType
+   *          "alignment", "desktop", etc., or null
+   * @return
+   */
+  public static String getAppID(String frameType)
+  {
+    String id = Cache.getProperty("Info.j2sAppletID");
+    if (id == null)
+    {
+      id = "jalview";
+    }
+    return id + (frameType == null ? "" : "-" + frameType);
+  }
+
 }
\ No newline at end of file