* the column to start from
* @return the position of the column in the visible alignment
*/
- public int findColumnNToLeft(int visibleDistance, int startColumn)
+ public int subtractVisibleColumns(int visibleDistance, int startColumn)
{
int distance = visibleDistance;
* the row to start from
* @return the position of the row in the visible alignment
*/
- public int findIndexNAboveRow(int visibleDistance, int startRow)
+ public int subtractVisibleRows(int visibleDistance, int startRow)
{
// walk upwards through the alignment
// count all the non-null sequences until we have visibleDistance counted
if ((scrollCol + vpwidth - 1) < visAlignWidth)
{
visXAsRes = hiddenCols.findColumnPosition(hiddenCols
- .findColumnNToLeft(vpwidth - 1, alwidth - 1));
+ .subtractVisibleColumns(vpwidth - 1, alwidth - 1));
}
else
{
if ((scrollRow + vpheight - 1) < visAlignHeight)
{
visYAsRes = hiddenSeqs.findIndexWithoutHiddenSeqs(hiddenSeqs
- .findIndexNAboveRow(vpheight - 1, alheight - 1));
+ .subtractVisibleRows(vpheight - 1, alheight - 1));
}
else
{
// test that without hidden columns, findColumnNToLeft returns
// position n to left of provided position
- int pos = cs.findColumnNToLeft(3, 10);
+ int pos = cs.subtractVisibleColumns(3, 10);
assertEquals(7, pos);
// 0 returns same position
- pos = cs.findColumnNToLeft(0, 10);
+ pos = cs.subtractVisibleColumns(0, 10);
assertEquals(10, pos);
// overflow to left returns negative number
- pos = cs.findColumnNToLeft(3, 0);
+ pos = cs.subtractVisibleColumns(3, 0);
assertEquals(-3, pos);
// test that with hidden columns to left of result column
cs.hideColumns(1, 3);
// position n to left of provided position
- pos = cs.findColumnNToLeft(3, 10);
+ pos = cs.subtractVisibleColumns(3, 10);
assertEquals(7, pos);
// 0 returns same position
- pos = cs.findColumnNToLeft(0, 10);
+ pos = cs.subtractVisibleColumns(0, 10);
assertEquals(10, pos);
// test with one set of hidden columns between start and required position
cs.hideColumns(12, 15);
- pos = cs.findColumnNToLeft(8, 17);
+ pos = cs.subtractVisibleColumns(8, 17);
assertEquals(5, pos);
// test with two sets of hidden columns between start and required position
cs.hideColumns(20, 21);
- pos = cs.findColumnNToLeft(8, 23);
+ pos = cs.subtractVisibleColumns(8, 23);
assertEquals(9, pos);
// repeat last 2 tests with no hidden columns to left of required position
// test with one set of hidden columns between start and required position
cs.hideColumns(12, 15);
- pos = cs.findColumnNToLeft(8, 17);
+ pos = cs.subtractVisibleColumns(8, 17);
assertEquals(5, pos);
// test with two sets of hidden columns between start and required position
cs.hideColumns(20, 21);
- pos = cs.findColumnNToLeft(8, 23);
+ pos = cs.subtractVisibleColumns(8, 23);
assertEquals(9, pos);
}
// test that without hidden rows, findIndexNFromRow returns
// position n above provided position
- int pos = hs.findIndexNAboveRow(3, 10);
+ int pos = hs.subtractVisibleRows(3, 10);
assertEquals(7, pos);
// 0 returns same position
- pos = hs.findIndexNAboveRow(0, 10);
+ pos = hs.subtractVisibleRows(0, 10);
assertEquals(10, pos);
// overflow to top returns negative number
- pos = hs.findIndexNAboveRow(3, 0);
+ pos = hs.subtractVisibleRows(3, 0);
assertEquals(-3, pos);
// test that with hidden rows above result row
hs.hideSequence(seqs[3]);
// position n above provided position
- pos = hs.findIndexNAboveRow(3, 10);
+ pos = hs.subtractVisibleRows(3, 10);
assertEquals(7, pos);
// 0 returns same position
- pos = hs.findIndexNAboveRow(0, 10);
+ pos = hs.subtractVisibleRows(0, 10);
assertEquals(10, pos);
// test with one set of hidden rows between start and required position
hs.hideSequence(seqs[13]);
hs.hideSequence(seqs[14]);
hs.hideSequence(seqs[15]);
- pos = hs.findIndexNAboveRow(8, 17);
+ pos = hs.subtractVisibleRows(8, 17);
assertEquals(5, pos);
// test with two sets of hidden rows between start and required position
hs.hideSequence(seqs[20]);
hs.hideSequence(seqs[21]);
- pos = hs.findIndexNAboveRow(8, 23);
+ pos = hs.subtractVisibleRows(8, 23);
assertEquals(9, pos);
// repeat last 2 tests with no hidden columns to left of required position
hs.hideSequence(seqs[13]);
hs.hideSequence(seqs[14]);
hs.hideSequence(seqs[15]);
- pos = hs.findIndexNAboveRow(8, 17);
+ pos = hs.subtractVisibleRows(8, 17);
assertEquals(5, pos);
// test with two sets of hidden rows between start and required position
hs.hideSequence(seqs[20]);
hs.hideSequence(seqs[21]);
- pos = hs.findIndexNAboveRow(8, 23);
+ pos = hs.subtractVisibleRows(8, 23);
assertEquals(9, pos);
}