git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
97b26ba
)
JAL-2388 Renamed column and row subtraction functions
author
kiramt
<k.mourao@dundee.ac.uk>
Fri, 17 Mar 2017 07:24:00 +0000
(07:24 +0000)
committer
kiramt
<k.mourao@dundee.ac.uk>
Fri, 17 Mar 2017 07:24:00 +0000
(07:24 +0000)
src/jalview/datamodel/ColumnSelection.java
patch
|
blob
|
history
src/jalview/datamodel/HiddenSequences.java
patch
|
blob
|
history
src/jalview/viewmodel/OverviewDimensions.java
patch
|
blob
|
history
test/jalview/datamodel/ColumnSelectionTest.java
patch
|
blob
|
history
test/jalview/datamodel/HiddenSequencesTest.java
patch
|
blob
|
history
diff --git
a/src/jalview/datamodel/ColumnSelection.java
b/src/jalview/datamodel/ColumnSelection.java
index
56d9859
..
97bc5a3
100644
(file)
--- a/
src/jalview/datamodel/ColumnSelection.java
+++ b/
src/jalview/datamodel/ColumnSelection.java
@@
-744,7
+744,7
@@
public class ColumnSelection
* the column to start from
* @return the position of the column in the visible alignment
*/
* 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;
{
int distance = visibleDistance;
diff --git
a/src/jalview/datamodel/HiddenSequences.java
b/src/jalview/datamodel/HiddenSequences.java
index
d3aa01a
..
6950c28
100755
(executable)
--- a/
src/jalview/datamodel/HiddenSequences.java
+++ b/
src/jalview/datamodel/HiddenSequences.java
@@
-294,7
+294,7
@@
public class HiddenSequences
* the row to start from
* @return the position of the row in the visible alignment
*/
* 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
{
// walk upwards through the alignment
// count all the non-null sequences until we have visibleDistance counted
diff --git
a/src/jalview/viewmodel/OverviewDimensions.java
b/src/jalview/viewmodel/OverviewDimensions.java
index
1e9eaf7
..
43680b5
100644
(file)
--- a/
src/jalview/viewmodel/OverviewDimensions.java
+++ b/
src/jalview/viewmodel/OverviewDimensions.java
@@
-174,7
+174,7
@@
public class OverviewDimensions
if ((scrollCol + vpwidth - 1) < visAlignWidth)
{
visXAsRes = hiddenCols.findColumnPosition(hiddenCols
if ((scrollCol + vpwidth - 1) < visAlignWidth)
{
visXAsRes = hiddenCols.findColumnPosition(hiddenCols
- .findColumnNToLeft(vpwidth - 1, alwidth - 1));
+ .subtractVisibleColumns(vpwidth - 1, alwidth - 1));
}
else
{
}
else
{
@@
-209,7
+209,7
@@
public class OverviewDimensions
if ((scrollRow + vpheight - 1) < visAlignHeight)
{
visYAsRes = hiddenSeqs.findIndexWithoutHiddenSeqs(hiddenSeqs
if ((scrollRow + vpheight - 1) < visAlignHeight)
{
visYAsRes = hiddenSeqs.findIndexWithoutHiddenSeqs(hiddenSeqs
- .findIndexNAboveRow(vpheight - 1, alheight - 1));
+ .subtractVisibleRows(vpheight - 1, alheight - 1));
}
else
{
}
else
{
diff --git
a/test/jalview/datamodel/ColumnSelectionTest.java
b/test/jalview/datamodel/ColumnSelectionTest.java
index
49f29d7
..
4d3f611
100644
(file)
--- a/
test/jalview/datamodel/ColumnSelectionTest.java
+++ b/
test/jalview/datamodel/ColumnSelectionTest.java
@@
-150,15
+150,15
@@
public class ColumnSelectionTest
// test that without hidden columns, findColumnNToLeft returns
// position n to left of provided position
// 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
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
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
assertEquals(-3, pos);
// test that with hidden columns to left of result column
@@
-166,21
+166,21
@@
public class ColumnSelectionTest
cs.hideColumns(1, 3);
// position n to left of provided position
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
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);
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);
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
assertEquals(9, pos);
// repeat last 2 tests with no hidden columns to left of required position
@@
-188,12
+188,12
@@
public class ColumnSelectionTest
// test with one set of hidden columns between start and required position
cs.hideColumns(12, 15);
// 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);
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);
}
assertEquals(9, pos);
}
diff --git
a/test/jalview/datamodel/HiddenSequencesTest.java
b/test/jalview/datamodel/HiddenSequencesTest.java
index
a556458
..
7795988
100644
(file)
--- a/
test/jalview/datamodel/HiddenSequencesTest.java
+++ b/
test/jalview/datamodel/HiddenSequencesTest.java
@@
-219,15
+219,15
@@
public class HiddenSequencesTest
// test that without hidden rows, findIndexNFromRow returns
// position n above provided position
// 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
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
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
assertEquals(-3, pos);
// test that with hidden rows above result row
@@
-237,11
+237,11
@@
public class HiddenSequencesTest
hs.hideSequence(seqs[3]);
// position n above provided position
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
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
assertEquals(10, pos);
// test with one set of hidden rows between start and required position
@@
-249,13
+249,13
@@
public class HiddenSequencesTest
hs.hideSequence(seqs[13]);
hs.hideSequence(seqs[14]);
hs.hideSequence(seqs[15]);
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]);
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
assertEquals(9, pos);
// repeat last 2 tests with no hidden columns to left of required position
@@
-266,13
+266,13
@@
public class HiddenSequencesTest
hs.hideSequence(seqs[13]);
hs.hideSequence(seqs[14]);
hs.hideSequence(seqs[15]);
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]);
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);
}
assertEquals(9, pos);
}