From: Jim Procter Date: Wed, 27 Apr 2016 15:34:06 +0000 (+0100) Subject: JAL-2085 JAL-2086 fix hiddenRepSequence and new referenceSeq getter X-Git-Tag: Release_2_10_0~235^2~2^2~1^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ef9d515865742b8a9b80371c65a201801b7f0253;p=jalview.git JAL-2085 JAL-2086 fix hiddenRepSequence and new referenceSeq getter --- 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