From ef9d515865742b8a9b80371c65a201801b7f0253 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 27 Apr 2016 16:34:06 +0100 Subject: [PATCH] JAL-2085 JAL-2086 fix hiddenRepSequence and new referenceSeq getter --- src/jalview/viewmodel/AlignmentViewport.java | 33 ++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index b70e92b..fbd1622 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1463,13 +1463,42 @@ public abstract class AlignmentViewport implements AlignViewportI, } + /** + * + * @return null or the current reference sequence + */ + public SequenceI getReferenceSeq() + { + return alignment.getSeqrep(); + } + + /** + * @param seq + * @return true iff seq is the reference for the alignment + */ + public boolean isReferenceSeq(SequenceI seq) + { + return alignment.getSeqrep() == seq; + } + + /** + * + * @param seq + * @return true if there are sequences represented by this sequence that are + * currently hidden + */ public boolean isHiddenRepSequence(SequenceI seq) { - return alignment.getSeqrep() == seq - || (hiddenRepSequences != null && hiddenRepSequences + return (hiddenRepSequences != null && hiddenRepSequences .containsKey(seq)); } + /** + * + * @param seq + * @return null or a sequence group containing the sequences that seq + * represents + */ public SequenceGroup getRepresentedSequences(SequenceI seq) { return (SequenceGroup) (hiddenRepSequences == null ? null -- 1.7.10.2