+ /**
+ * import file into a new vamsas session (uses jalview.gui.VamsasApplication)
+ * @param file
+ * @return true if import was a success and a session was started.
+ */
+ public boolean vamsasImport(File file)
+ {
+ if (v_client != null)
+ {
+
+ jalview.bin.Cache.log
+ .error("Implementation error - load session from a running session is not supported.");
+ return false;
+ }
+
+ try
+ {
+ v_client = new jalview.gui.VamsasApplication(this, file);
+ } catch (Exception ex)
+ {
+ jalview.bin.Cache.log.error(
+ "New vamsas session from existing session file failed:", ex);
+ return false;
+ }
+ setupVamsasConnectedGui();
+ v_client.initial_update(); // TODO: thread ?
+ return v_client.inSession();
+ }
+ public boolean joinVamsasSession(String mysesid) {
+ if (v_client!=null)
+ {
+ throw new Error("Trying to join a vamsas session when another is already connected.");
+ }
+ if (mysesid==null)
+ {
+ throw new Error("Invalid vamsas session id.");
+ }
+ v_client = new VamsasApplication(this, mysesid);
+ setupVamsasConnectedGui();
+ v_client.initial_update();
+ return (v_client.inSession());
+ }
+