From: gmungoc Date: Fri, 23 Jan 2015 16:49:19 +0000 (+0000) Subject: JAL-1588 first working (?) restore of Chimera session incl bindings X-Git-Tag: Jalview_2_9~106^2~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=95e0cdd0a7da15cad5d1d3adbb621419d84e135a;p=jalview.git JAL-1588 first working (?) restore of Chimera session incl bindings --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 563429f..bb4ef8b 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -3233,10 +3233,35 @@ public class Jalview2XML { final ViewerData data = viewerData.getValue(); String chimeraSession = data.stateData; + List pdbfilenames = new ArrayList(); + List seqmaps = new ArrayList(); + List pdbids = new ArrayList(); + if (new File(chimeraSession).exists()) { + Set> fileData = data.fileData.entrySet(); + List pdbs = new ArrayList(); + List allseqs = new ArrayList(); + for (Entry pdb : fileData) + { + String filePath = (String) pdb.getValue()[0]; + String pdbId = (String) pdb.getValue()[1]; + final Vector seqList = (Vector) pdb.getValue()[2]; + PDBEntry pdbentry = new PDBEntry(); + pdbentry.setFile(filePath); + pdbentry.setId(pdbId); + pdbs.add(pdbentry); + SequenceI[] seqs = new SequenceI[seqList.size()]; + seqList.copyInto(seqs); + allseqs.add(seqs); + } + // TODO can/should this be done via StructureViewer (like Jmol)? - ChimeraViewFrame cvf = new ChimeraViewFrame(data, af); + final PDBEntry[] pdbArray = pdbs.toArray(new PDBEntry[pdbs + .size()]); + final SequenceI[][] seqsArray = allseqs.toArray(new SequenceI[allseqs.size()][]); + ChimeraViewFrame cvf = // new ChimeraViewFrame(data, af); + new ChimeraViewFrame(af.alignPanel, pdbArray, seqsArray); } else {