X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FJalview2XML.java;h=e63984425888244bcd1e1fe8debdf455a7efeeed;hb=c42398f840e2a6709c5ccc45f84de2a12011c90a;hp=147a68df4c6eda7455d82c83737d91603122bc7f;hpb=cb105dfc09cebd040a202758a3756fdf6c5fa3b6;p=jalview.git diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java old mode 100755 new mode 100644 index 147a68d..e639844 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -48,7 +48,7 @@ import jalview.util.jarInputStreamProvider; * will be :) * * @author $author$ - * @version $Revision$ + * @version $Revision: 1.134 $ */ public class Jalview2XML { @@ -624,6 +624,7 @@ public class Jalview2XML state.setAlignwithAlignPanel(jmol.isUsedforaligment(ap)); state.setColourwithAlignPanel(jmol .isUsedforcolourby(ap)); + state.setColourByJmol(jmol.isColouredByJmol()); if (!jmolViewIds.contains(state.getViewId())) { // Make sure we only store a Jmol state once in each XML @@ -2573,13 +2574,12 @@ public class Jalview2XML { new int[] { x, y, width, height }, "", new Hashtable(), new boolean[] - { false, false } }); - // Legacy->2.7 conversion: if there is no attribute for - // colouring with the alignPanel then by default we set the - // first encountered view to be the default source of colour - // information. + { false, false, true } }); + // Legacy pre-2.7 conversion JAL-823 : + // do not assume any view has to be linked for colour by sequence } - // TODO: assemble String[] { pdb files }, String[] { id for each + + // assemble String[] { pdb files }, String[] { id for each // file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, { // seqs_file 2}, boolean[] { // linkAlignPanel,superposeWithAlignpanel}} from hash @@ -2587,11 +2587,13 @@ public class Jalview2XML ((boolean[]) jmoldat[3])[0] |= ids[p].getStructureState(s) .hasAlignwithAlignPanel() ? ids[p].getStructureState( s).getAlignwithAlignPanel() : false; - // always colour by linked panel if not specified + // never colour by linked panel if not specified ((boolean[]) jmoldat[3])[1] |= ids[p].getStructureState(s) .hasColourwithAlignPanel() ? ids[p] .getStructureState(s).getColourwithAlignPanel() : false; + // default for pre-2.7 projects is that Jmol colouring is enabled + ((boolean[])jmoldat[3])[2] &=ids[p].getStructureState(s).hasColourByJmol() ? ids[p].getStructureState(s).getColourByJmol() : true; if (((String) jmoldat[1]).length() < ids[p] .getStructureState(s).getContent().length()) @@ -2631,7 +2633,7 @@ public class Jalview2XML int[] geom = (int[]) svattrib[0]; String state = (String) svattrib[1]; Hashtable oldFiles = (Hashtable) svattrib[2]; - final boolean useinJmolsuperpos = ((boolean[]) svattrib[3])[0], usetoColourbyseq = ((boolean[]) svattrib[3])[1]; + 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 Vector pdbfilenames = new Vector(); @@ -2787,7 +2789,7 @@ public class Jalview2XML try { sview = new AppJmol(pdbf, id, sq, alf.alignPanel, - useinJmolsuperpos, usetoColourbyseq, fileloc, + useinJmolsuperpos, usetoColourbyseq, jmolColouring, fileloc, rect, vid); } catch (OutOfMemoryError ex) { @@ -2829,8 +2831,7 @@ public class Jalview2XML String pdbFile = (String) filedat[0]; SequenceI[] seq = (SequenceI[]) ((Vector) filedat[2]) .toArray(new SequenceI[0]); - StructureSelectionManager.getStructureSelectionManager() - .setMapping(seq, null, pdbFile, + ((AppJmol) comp).jmb.ssm.setMapping(seq, null, pdbFile, jalview.io.AppletFormatAdapter.FILE); ((AppJmol) comp).jmb.addSequenceForStructFile(pdbFile, seq); } @@ -2846,7 +2847,7 @@ public class Jalview2XML } if (usetoColourbyseq) { - ((AppJmol) comp).useAlignmentPanelForColourbyseq(ap); + ((AppJmol) comp).useAlignmentPanelForColourbyseq(ap, !jmolColouring); } else {