X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FVamsasClient.java;fp=src%2Fjalview%2Fgui%2FVamsasClient.java;h=76e9599e498dc8c4c22f4898c34e76c1e6a0f5a1;hb=072fc418c393cbd2a40dfa1d3e46f90178b79572;hp=8d635a39ed144c4b26f01b632ab83bf05e57e79f;hpb=91cb798a47b512b0ac3792fd3a84f2c5bd3c7218;p=jalview.git diff --git a/src/jalview/gui/VamsasClient.java b/src/jalview/gui/VamsasClient.java index 8d635a3..76e9599 100755 --- a/src/jalview/gui/VamsasClient.java +++ b/src/jalview/gui/VamsasClient.java @@ -8,6 +8,7 @@ import java.io.FileOutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Hashtable; +import java.util.IdentityHashMap; import java.util.Vector; import java.util.jar.JarOutputStream; @@ -42,9 +43,33 @@ public class VamsasClient extends ArchiveClient { Cache.log.info("Jalview loading the Vamsas Session."); // load in the vamsas archive for the first time ClientDoc cdoc = this.getUpdateable(); + updateJalview(cdoc); + + } + /** + * this will close all windows currently in Jalview. + * + */ + protected void closeWindows() { + JInternalFrame[] frames = Desktop.desktop.getAllFrames(); + + if (frames == null) + { + return; + } + + try + { + for (int i = frames.length - 1; i > -1; i--) { + frames[i].dispose(); + } + } catch (Exception e) { + Cache.log.error("Whilst closing windows",e); + } } public void get_update(VamsasArchive doc) { + // Close windows - load update. Cache.log.info("Jalview updating from Vamsas Session."); } public void push_update() { @@ -56,10 +81,22 @@ public class VamsasClient extends ArchiveClient { // stop any update/watcher thread. Cache.log.info("Jalview disconnecting from the Vamsas Session."); } - java.util.Hashtable jv2vobj = null; + public void updateJalview(ClientDoc cdoc) { + + } + protected void _updateAlignFrame(ClientDoc cdoc, AlignFrame av) { + + } + /** + * jalview object binding to VorbaIds + */ + IdentityHashMap jv2vobj = null; + Hashtable vobj2jv = null; public void updateVamsasDocument(ClientDoc doc) { - if (jv2vobj==null) - jv2vobj = new Hashtable(); + if (jv2vobj==null) { + jv2vobj = new IdentityHashMap(); + vobj2jv = new Hashtable(); + } // wander through frames JInternalFrame[] frames = Desktop.desktop.getAllFrames(); @@ -83,7 +120,9 @@ public class VamsasClient extends ArchiveClient { if (frames[i] instanceof AlignFrame) { AlignFrame af = (AlignFrame) frames[i]; + // check if this frame has an associated alignment object ? + // update alignment and root from frame. }