X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJalview2XML.java;h=c8466b109484f227c6c6264304437d2e9ea1e323;hb=3492dd1b00c0cd49ea8dc14a5a2d717ac3ff9e8a;hp=a9827d4f2826554a08af3b5827450180dabbf3ae;hpb=ff4d98fbde57ca9dea2fc607d36d80a00963746d;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index a9827d4..c8466b1 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) - * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) + * Copyright (C) 2011 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * @@ -612,7 +612,8 @@ public class Jalview2XML for (int smap = 0; smap < jmol.jmb.sequence[peid].length; smap++) { - if (jal.findIndex(jmol.jmb.sequence[peid][smap]) > -1) +// if (jal.findIndex(jmol.jmb.sequence[peid][smap]) > -1) + if (jds==jmol.jmb.sequence[peid][smap]) { StructureState state = new StructureState(); state.setVisible(true); @@ -1822,9 +1823,9 @@ public class Jalview2XML } ; out.close(); - - alreadyLoadedPDB.put(pdbId, outFile.getAbsolutePath()); - return outFile.getAbsolutePath(); + String t=outFile.toURI().getPath().substring(1); + alreadyLoadedPDB.put(pdbId, t); + return t; } else { @@ -2626,12 +2627,13 @@ public class Jalview2XML } if (ids[p].getFile() != null) { + File mapkey=new File(ids[p].getFile()); Object[] seqstrmaps = (Object[]) ((Hashtable) jmoldat[2]) - .get(ids[p].getFile()); + .get(mapkey); if (seqstrmaps == null) { ((Hashtable) jmoldat[2]).put( - new File(ids[p].getFile()).toString(), + mapkey, seqstrmaps = new Object[] { pdbFile, ids[p].getId(), new Vector(), new Vector() }); @@ -2664,7 +2666,7 @@ public class Jalview2XML Object[] svattrib = entry.getValue(); int[] geom = (int[]) svattrib[0]; String state = (String) svattrib[1]; - Hashtable oldFiles = (Hashtable) svattrib[2]; + Hashtable oldFiles = (Hashtable) svattrib[2]; final boolean useinJmolsuperpos = ((boolean[]) svattrib[3])[0], usetoColourbyseq = ((boolean[]) svattrib[3])[1], jmolColouring = ((boolean[]) svattrib[3])[2]; int x = geom[0], y = geom[1], width = geom[2], height = geom[3]; // collate the pdbfile -> sequence mappings from this view @@ -2728,6 +2730,8 @@ public class Jalview2XML { newFileLoc = new StringBuffer(); } + do { + // look for next filename in load statement newFileLoc.append(state.substring(cp, ncp = (state.indexOf("\"", ncp + 1) + 1))); String oldfilenam = state.substring(ncp, @@ -2735,8 +2739,7 @@ public class Jalview2XML // recover the new mapping data for this old filename // have to normalize filename - since Jmol and jalview do filename // translation differently. - Object[] filedat = oldFiles.get(new File(oldfilenam) - .toString()); + Object[] filedat = oldFiles.get(new File(oldfilenam)); newFileLoc.append(((String) filedat[0])); pdbfilenames.addElement((String) filedat[0]); pdbids.addElement((String) filedat[1]); @@ -2745,6 +2748,7 @@ public class Jalview2XML newFileLoc.append("\""); cp = ecp + 1; // advance beyond last \" and set cursor so we can // look for next file statement. + } while ((ncp=state.indexOf("/*file*/",cp))>-1); } if (cp > 0) { @@ -2757,7 +2761,7 @@ public class Jalview2XML .print("Ignoring incomplete Jmol state for PDB ids: "); newFileLoc = new StringBuffer(state); newFileLoc.append("; load append "); - for (String id : oldFiles.keySet()) + for (File id : oldFiles.keySet()) { // add this and any other pdb files that should be present in // the viewer @@ -2855,7 +2859,7 @@ public class Jalview2XML // add mapping for sequences in this view to an already open Jmol // instance - for (String id : oldFiles.keySet()) + for (File id : oldFiles.keySet()) { // add this and any other pdb files that should be present in the // viewer