From: Jim Procter Date: Sun, 12 Feb 2012 15:08:16 +0000 (+0000) Subject: (JAL-1025 JAL-1022) File based equivalence used to match Jmol and jalview paths.... X-Git-Tag: Archived_Release_2_7~9 X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=commitdiff_plain;h=0a55a33506f2a76f7e557462257ec7918c764a2f (JAL-1025 JAL-1022) File based equivalence used to match Jmol and jalview paths. Use Jmol style '/' paths for local PDB file strings --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index e259309..3c5259e 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -1823,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 { @@ -2627,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() }); @@ -2665,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 @@ -2736,8 +2737,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]); @@ -2758,7 +2758,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 @@ -2856,7 +2856,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