@Test(groups = "Functional")
public void testFindMousePosition_wrapped_annotations()
{
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+ Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignViewportI av = alignFrame.getViewport();
@Test(groups = "Functional")
public void testFindMousePosition_wrapped_scaleAbove()
{
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "true");
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+ Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "true");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignViewportI av = alignFrame.getViewport();
@Test(groups = "Functional")
public void testFindMousePosition_wrapped_noAnnotations()
{
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", "false");
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+ Cache.setPropertyNoSave("SHOW_ANNOTATIONS", "false");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignViewportI av = alignFrame.getViewport();
@Test(groups = "Functional")
public void testFindColumn_unwrapped()
{
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "false");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "false");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
SeqPanel testee = alignFrame.alignPanel.getSeqPanel();
final int charWidth = alignFrame.getViewport().getCharWidth();
assertTrue(charWidth > 0); // sanity check
assertEquals(alignFrame.getViewport().getRanges().getStartRes(), 0);
-
/*
* mouse at top left of unwrapped panel
*/
SeqCanvas seqCanvas = alignFrame.alignPanel.getSeqPanel().seqCanvas;
int w = seqCanvas.getWidth();
// limited to number of whole columns, base 0
- int expected = w / charWidth - 1;
- assertEquals(testee.findColumn(evt), expected);
+
+ int expected = w / charWidth;
+ expected = Math.min(
+ alignFrame.getViewport().getRanges().getEndRes(),
+ expected);
+ int col = testee.findColumn(evt);
+ assertEquals(col, expected);
/*
* hide columns 5-10 (base 1)
// x is in 6th visible column, absolute column 12, or 11 base 0
evt = new MouseEvent(testee, Event.MOUSE_MOVE, 0L, 0, x, 0, 0, 0, 0,
false, 0);
- assertEquals(testee.findColumn(evt), 11);
+ col = testee.findColumn(evt);
+ assertEquals(col, 11);
}
@Test(groups = "Functional")
public void testFindColumn_wrapped()
{
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignViewport av = alignFrame.getViewport();