import jalview.datamodel.Annotation;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
+import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
import jalview.datamodel.Sequence;
import jalview.datamodel.SequenceI;
import jalview.io.FileLoader;
af.getViewport().setGlobalColourScheme(cs);
assertFalse(cs.conservationApplied());
}
+
+ @Test(groups = { "Functional" })
+ public void testSetGetHasSearchResults()
+ {
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.fa", FormatAdapter.FILE);
+ SearchResultsI sr = new SearchResults();
+ SequenceI s1 = af.getViewport().getAlignment().getSequenceAt(0);
+
+ // create arbitrary range on first sequence
+ sr.addResult(s1, s1.getStart() + 10, s1.getStart() + 15);
+
+ // test set
+ af.getViewport().setSearchResults(sr);
+ // has -> true
+ assertTrue(af.getViewport().hasSearchResults());
+ // get == original
+ assertEquals(sr, af.getViewport().getSearchResults());
+
+ // set(null) results in has -> false
+
+ af.getViewport().setSearchResults(null);
+ assertFalse(af.getViewport().hasSearchResults());
+ }
}