JAL-2085 JAL-2086 fix hiddenRepSequence and new referenceSeq getter
authorJim Procter <jprocter@issues.jalview.org>
Wed, 27 Apr 2016 15:34:06 +0000 (16:34 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Wed, 27 Apr 2016 15:34:06 +0000 (16:34 +0100)
src/jalview/viewmodel/AlignmentViewport.java

index b70e92b..fbd1622 100644 (file)
@@ -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