ov.getCanvas().getResidueColour().getRGB());
overview.setHiddenColour(ov.getCanvas().getHiddenColour().getRGB());
view.setOverview(overview);
- }
+ }
if (av.getGlobalColourScheme() instanceof jalview.schemes.UserColourScheme)
{
view.setBgColour(setUserColourScheme(av.getGlobalColourScheme(),
loadPCAViewers(jalviewModel, ap);
loadPDBStructures(jprovider, jseqs, af, ap);
loadRnaViewers(jprovider, jseqs, ap);
- loadOverview(view, af);
+ loadOverview(view, jalviewModel.getVersion(), af);
}
// and finally return.
return af;
* @param view
* @param af
*/
- protected void loadOverview(Viewport view, AlignFrame af)
+ protected void loadOverview(Viewport view, String version, AlignFrame af)
{
+ if (!isVersionStringLaterThan("2.11.3",
+ version) && view.getOverview()==null)
+ {
+ return;
+ }
/*
* first close any Overview that was opened automatically
* (if so configured in Preferences) so that the view is
* - minimum version we are comparing against
* @param version
* - version of data being processsed
- * @return
+ * @return true if version is equal to or later than supported
*/
public static boolean isVersionStringLaterThan(String supported,
String version)
assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.3b1", "2.8.3"));
assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.3", "2.8.2b1"));
assertFalse(Jalview2XML.isVersionStringLaterThan("2.8.0b2", "2.8.0b1"));
+ /*
+ * test for patch release versions
+ */
+ assertFalse(Jalview2XML.isVersionStringLaterThan("2.11.3.0", "2.11.2"));
+ assertTrue(Jalview2XML.isVersionStringLaterThan("2.11.3.0","2.11.4"));
+ assertFalse(Jalview2XML.isVersionStringLaterThan("2.12.2.0b1","2.12.2.0"));
+ assertFalse(Jalview2XML.isVersionStringLaterThan("2.12.2.3","2.12.2.2"));
+
}
/**
}
/**
+ * Test that a view from an older version of Jalview is restored with Overview automatically shown when the preference is set
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = true)
+ public void testAutoShowOverviewForLegacyProjects() throws Exception
+ {
+ Desktop.instance.closeAll_actionPerformed(null);
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile.jvp", DataSourceType.FILE);
+
+ Cache.setProperty("SHOW_OVERVIEW", "false");
+ assertNotNull(af.alignPanel.getOverviewPanel());
+ }
+
+ /**
* Test that loading example.jvp, doing some stuff, then hitting reload
* doesn't leave the modified window still open
*