import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
+import java.util.Hashtable;
import java.util.Vector;
import java.util.jar.JarOutputStream;
// user and organisation stuff.
public VamsasClient(Desktop jdesktop,
File sessionPath) {
- super("Jalview User", "Dundee", "jalview","2.7",
+ super(System.getProperty("user.name"),System.getProperty("host.name"), "jalview","2.7",
sessionPath);
us=jdesktop;
}
public void initial_update() {
Cache.log.info("Jalview loading the Vamsas Session.");
// load in the vamsas archive for the first time
+ ClientDoc cdoc = this.getUpdateable();
- // VamsasArchive doc = new VamsasArchive();
}
public void get_update(VamsasArchive doc) {
Cache.log.info("Jalview updating from Vamsas Session.");
// stop any update/watcher thread.
Cache.log.info("Jalview disconnecting from the Vamsas Session.");
}
- public void updateVamsasDocument(VamsasDocument doc) {
+ java.util.Hashtable jv2vobj = null;
+ public void updateVamsasDocument(ClientDoc doc) {
+ if (jv2vobj==null)
+ jv2vobj = new Hashtable();
// wander through frames
JInternalFrame[] frames = Desktop.desktop.getAllFrames();
try
{
+ // Mapping
+ // Alignframe.alignment (non-null dataset)==alignment
+ // alignframe .alignment (dataset==null) = VAMAS[]
+ // Tree.alignment = vamsas[].tree (vamsas[] given by dataset, alignment given by local ref]
+
Vector shortNames = new Vector();
//REVERSE ORDER
AlignFrame af = (AlignFrame) frames[i];
// check if this frame has an associated alignment object ?
// update alignment and root from frame.
-
-
- String shortName = af.getTitle();
-
- if (shortName.indexOf(File.separatorChar) > -1)
- {
- shortName = shortName.substring(shortName.lastIndexOf(
- File.separatorChar) + 1);
- }
-
- int count = 1;
-
- while (shortNames.contains(shortName))
- {
- if (shortName.endsWith("_" + (count - 1)))
- {
- shortName = shortName.substring(0,
- shortName.lastIndexOf("_"));
- }
-
- shortName = shortName.concat("_" + count);
- count++;
- }
-
- shortNames.addElement(shortName);
-
- if (!shortName.endsWith(".xml"))
- {
- shortName = shortName + ".xml";
- }
}
}