From: Jim Procter Date: Tue, 21 Jun 2016 09:22:57 +0000 (+0100) Subject: JAL-1369 mark reference sequence & view state and restore it X-Git-Tag: Release_2_10_0~161^2~5^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=07c11f6db82ac33ec895aa82e603d4a659928a24;p=jalview.git JAL-1369 mark reference sequence & view state and restore it --- diff --git a/src/jalview/gui/Jalview2XML.java b/src/jalview/gui/Jalview2XML.java index 701656d..2509f15 100644 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@ -739,6 +739,11 @@ public class Jalview2XML } } } + // mark sequence as reference - if it is the reference for this view + if (jal.hasSeqrep()) + { + jseq.setViewreference(rjal.getSequenceAt(i) == jal.getSeqrep()); + } } // TODO: omit sequence features from each alignment view's XML dump if we @@ -2662,7 +2667,7 @@ public class Jalview2XML List tmpseqs = new ArrayList(); boolean multipleView = false; - + SequenceI referenceseqForView = null; JSeq[] jseqs = object.getJalviewModelSequence().getJSeq(); int vi = 0; // counter in vamsasSeq array for (int i = 0; i < jseqs.length; i++) @@ -2687,6 +2692,11 @@ public class Jalview2XML vi++; } + if (jseqs[i].hasViewreference() && jseqs[i].getViewreference()) + { + referenceseqForView = tmpseqs.get(tmpseqs.size() - 1); + } + if (jseqs[i].getHidden()) { if (hiddenSeqs == null) @@ -2696,7 +2706,6 @@ public class Jalview2XML hiddenSeqs.add(seqRefIds.get(seqId)); } - } // / @@ -2707,6 +2716,10 @@ public class Jalview2XML Alignment al = new Alignment(orderedSeqs); + if (referenceseqForView != null) + { + al.setSeqrep(referenceseqForView); + } // / Add the alignment properties for (int i = 0; i < vamsasSet.getSequenceSetPropertiesCount(); i++) { @@ -4100,6 +4113,12 @@ public class Jalview2XML .getSequenceAt(i), new java.awt.Color(JSEQ[i].getColour())); } + if (al.hasSeqrep()) + { + af.getViewport().setColourByReferenceSeq(true); + af.getViewport().setDisplayReferenceSeq(true); + } + af.viewport.setGatherViewsHere(view.getGatheredViews()); if (view.getSequenceSetId() != null)