@Test(groups = { "Functional" })
public void testPositionInBox()
{
+ od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols);
+
+ assertFalse(od.isPositionInBox(0, 0));
+ assertTrue(od.isPositionInBox(10, 9));
+ assertFalse(od.isPositionInBox(0, 9));
+ assertFalse(od.isPositionInBox(9, 0));
+ assertFalse(od.isPositionInBox(75, 20));
+
+ // hide columns in the box area
+ // makes absolutely no difference
+ hiddenCols.hideColumns(1, 4);
+ od.setBoxPosition(al.getHiddenSequences(), hiddenCols);
+ assertFalse(od.isPositionInBox(0, 0));
+ assertTrue(od.isPositionInBox(10, 9));
+ assertFalse(od.isPositionInBox(0, 9));
+ assertFalse(od.isPositionInBox(9, 0));
+ assertFalse(od.isPositionInBox(75, 20));
+
+ // hide sequences in box area
+ // makes absolutely no difference
+ hideSequences(1, 3);
+ od.setBoxPosition(al.getHiddenSequences(), hiddenCols);
assertFalse(od.isPositionInBox(0, 0));
assertTrue(od.isPositionInBox(10, 9));
assertFalse(od.isPositionInBox(0, 9));
@Test(groups = { "Functional" })
public void testPositionInBox()
{
+ od.updateViewportFromMouse(0, 0, al.getHiddenSequences(), hiddenCols);
+
+ assertFalse(od.isPositionInBox(0, 0));
+ assertTrue(od.isPositionInBox(10, 9));
+ assertFalse(od.isPositionInBox(0, 9));
+ assertFalse(od.isPositionInBox(9, 0));
+ assertFalse(od.isPositionInBox(75, 20));
+
+ assertTrue(od.isPositionInBox(47, 6));
+ assertFalse(od.isPositionInBox(48, 6));
+ assertTrue(od.isPositionInBox(47, 9));
+ assertFalse(od.isPositionInBox(47, 10));
+
+ // hide columns in the box area
+ // extends area where a point is considered to be in the box
+ hiddenCols.hideColumns(1, 4);
+ od.setBoxPosition(al.getHiddenSequences(), hiddenCols);
assertFalse(od.isPositionInBox(0, 0));
assertTrue(od.isPositionInBox(10, 9));
assertFalse(od.isPositionInBox(0, 9));
assertFalse(od.isPositionInBox(9, 0));
assertFalse(od.isPositionInBox(75, 20));
+
+ assertTrue(od.isPositionInBox(47, 6));
+ assertTrue(od.isPositionInBox(48, 6));
+ assertTrue(od.isPositionInBox(47, 9));
+ assertFalse(od.isPositionInBox(47, 10));
+
+ // hide sequences in box area
+ // extends area where a point is considered to be in the box
+ hideSequences(1, 3);
+ ColumnSelection cs = new ColumnSelection();
+ hiddenCols.revealAllHiddenColumns(cs);
+ od.setBoxPosition(al.getHiddenSequences(), hiddenCols);
+ assertFalse(od.isPositionInBox(0, 0));
+ assertTrue(od.isPositionInBox(10, 9));
+ assertFalse(od.isPositionInBox(0, 9));
+ assertFalse(od.isPositionInBox(9, 0));
+ assertFalse(od.isPositionInBox(75, 20));
+
+ assertTrue(od.isPositionInBox(47, 6));
+ assertFalse(od.isPositionInBox(48, 6));
+ assertTrue(od.isPositionInBox(47, 9));
+ assertTrue(od.isPositionInBox(47, 10));
}
/*