assertNotNull(
ColourSchemeProperty.getColourScheme(viewport,
viewport.getAlignment(),
- viewport.getGlobalColourScheme()
- .getSchemeName()),
+ viewport.getGlobalColourScheme().getSchemeName()),
"Recognise T-Coffee score from string");
af.saveAlignment(tfile, FileFormat.Jalview);
Assert.assertEquals(Desktop.getAlignFrames().length,
Desktop.getAlignmentPanels(
af.getViewport().getSequenceSetId()).length);
- Assert.assertEquals(
- Desktop.getAlignmentPanels(
- af.getViewport().getSequenceSetId()).length,
+ Assert.assertEquals(Desktop
+ .getAlignmentPanels(af.getViewport().getSequenceSetId()).length,
oldviews);
}
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(seqData,
DataSourceType.PASTE);
assertNotNull(af, "Didn't read in the example file correctly.");
-
+
AlignmentViewPanel ap = Desktop.getAlignmentPanels(null)[0];
SequenceI pep = ap.getAlignment().getSequenceAt(0);
SequenceI cds = ap.getAlignment().getSequenceAt(1);
Assert.fail("Didn't save the state", e);
}
Desktop.instance.closeAll_actionPerformed(null);
-
+
new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
AlignmentViewPanel rap = Desktop.getAlignmentPanels(null)[0];
public void testStoreAndRecoverOverview() throws Exception
{
Desktop.instance.closeAll_actionPerformed(null);
-
- Cache.setProperty("SHOW_OVERVIEW", "false");
+
+ Cache.setProperty("SHOW_OVERVIEW", "false");
Cache.setProperty(Preferences.USE_LEGACY_GAP, "false");
Cache.setColourProperty(Preferences.GAP_COLOUR, Color.green);
Cache.setColourProperty(Preferences.HIDDEN_COLOUR, Color.yellow);
Cache.setProperty(Preferences.SHOW_OV_HIDDEN_AT_START, "true");
-
+
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
-
+
/*
* open and resize / reposition overview
*/
af.overviewMenuItem_actionPerformed(null);
OverviewPanel ov1 = af.alignPanel.getOverviewPanel();
assertNotNull(ov1);
- ov1.setFrameBounds(20, 30, 200, 400);
+ ov1.setFrameBounds(20, 30, 200, 400);
assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa");
assertTrue(ov1.isShowHiddenRegions());
-
+
/*
* open a New View and its Overview and reposition it
*/
OverviewPanel ov2 = af.alignPanel.getOverviewPanel();
assertNotNull(ov2);
assertNotSame(ov1, ov2);
- ov2.setFrameBounds(25, 35, 205, 405);
+ ov2.setFrameBounds(25, 35, 205, 405);
assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa Original");
assertEquals(ov2.getTitle(), "Overview examples/uniref50.fa View 1");
-
-
+
File tfile = File.createTempFile("testStoreAndRecoverOverview", ".jvp");
new Jalview2XML(false).saveState(tfile);
Desktop.instance.closeAll_actionPerformed(null);
-
+
/*
* change preferences (should _not_ affect reloaded Overviews)
*/
- Cache.setProperty("SHOW_OVERVIEW", "true");
+ Cache.setProperty("SHOW_OVERVIEW", "true");
Cache.setProperty(Preferences.USE_LEGACY_GAP, "true");
Cache.setColourProperty(Preferences.GAP_COLOUR, Color.blue);
Cache.setColourProperty(Preferences.HIDDEN_COLOUR, Color.orange);
Cache.setProperty(Preferences.SHOW_OV_HIDDEN_AT_START, "false");
-
+
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
-
+
/*
* workaround: explicitly select View 1 (not in focus after restore)
*/
af.tabSelectionChanged(1);
-
+
/*
* verify restored overview for View 1
*/
assertEquals(ov2.getCanvas().getResidueColour(), Color.white);
assertEquals(ov2.getCanvas().getHiddenColour(), Color.yellow);
assertEquals(ov2.getTitle(), "Overview examples/uniref50.fa View 1");
- assertEquals(ov2.getFrameBounds(), new Rectangle(25, 35, 205, 405));
+ assertEquals(ov2.getFrameBounds(), new Rectangle(25, 35, 205, 405));
assertTrue(ov2.isShowHiddenRegions());
-
+
/*
* verify restored overview for Original view
*/
assertEquals(ov1.getCanvas().getResidueColour(), Color.white);
assertEquals(ov1.getCanvas().getHiddenColour(), Color.yellow);
assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa Original");
- assertEquals(ov1.getFrameBounds(), new Rectangle(20, 30, 200, 400));
+ assertEquals(ov1.getFrameBounds(), new Rectangle(20, 30, 200, 400));
assertTrue(ov1.isShowHiddenRegions());
}
+
+ /**
+ * Test that a view with no Overview is restored with no Overview, even if
+ * 'Open Overview' is selected in Preferences
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = true)
+ public void testStoreAndRecoverNoOverview() throws Exception
+ {
+ Cache.setProperty("SHOW_OVERVIEW", "false");
+ Desktop.instance.closeAll_actionPerformed(null);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ ">seq1\nMATRSQFLVNF\n", DataSourceType.PASTE);
+
+ File tfile = File.createTempFile("testStoreAndRecoverOverview", ".jvp");
+ new Jalview2XML(false).saveState(tfile);
+ Desktop.instance.closeAll_actionPerformed(null);
+
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+
+ assertNull(af.alignPanel.getOverviewPanel());
+ }
}