From 95e0cdd0a7da15cad5d1d3adbb621419d84e135a Mon Sep 17 00:00:00 2001 From: gmungoc Date: Fri, 23 Jan 2015 16:49:19 +0000 Subject: [PATCH] JAL-1588 first working (?) restore of Chimera session incl bindings --- src/jalview/gui/Jalview2XML.java | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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 { -- 1.7.10.2