int absAlignmentIndex = alignment.findIndex(sequence);
int alignmentIndex = adjustForHiddenSeqs(absAlignmentIndex);
- if (hiddenSequences[alignmentIndex] != null)
+ if (alignmentIndex < 0 || hiddenSequences[alignmentIndex] != null)
{
System.out.println("ERROR!!!!!!!!!!!");
+ return;
}
hiddenSequences[alignmentIndex] = sequence;
assertEquals(6, hs.findIndexWithoutHiddenSeqs(9));
/*
- * hide first sequence only
+ * hide first two sequences
*/
hs.showAll(null);
hs.hideSequence(seqs[0]);
- for (int i = 1; i < height; i++)
+ hs.hideSequence(seqs[1]);
+ assertEquals(-1, hs.findIndexWithoutHiddenSeqs(0));
+ assertEquals(-1, hs.findIndexWithoutHiddenSeqs(1));
+ for (int i = 2; i < height; i++)
{
- assertEquals(i - 1, hs.findIndexWithoutHiddenSeqs(i));
+ assertEquals(i - 2, hs.findIndexWithoutHiddenSeqs(i));
}
- assertEquals(-1, hs.findIndexWithoutHiddenSeqs(0));
}
/**