*/
package jalview.gui;
+import static org.junit.Assert.assertNotEquals;
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertFalse;
import static org.testng.Assert.assertNotSame;
import jalview.datamodel.SequenceI;
import jalview.io.DataSourceType;
import jalview.io.FileLoader;
-import jalview.io.Jalview2xmlTests;
+import jalview.project.Jalview2xmlTests;
import jalview.renderer.ResidueShaderI;
import jalview.schemes.BuriedColourScheme;
import jalview.schemes.FeatureColour;
* seq1 feature in columns 1-5 is hidden
* seq2 feature in columns 6-10 is shown
*/
- FeatureColourI fc = new FeatureColour(Color.red, Color.blue, 0f, 10f);
+ FeatureColourI fc = new FeatureColour(null, Color.red, Color.blue, null,
+ 0f, 10f);
fc.setAboveThreshold(true);
fc.setThreshold(5f);
alignFrame.getFeatureRenderer().setColour("Metal", fc);
sp.valueChanged(22);
assertEquals(av2.getResidueShading().getConservationInc(), 22);
}
+
+ /**
+ * Verify that making a New View preserves the dataset reference for the
+ * alignment. Otherwise, see a 'duplicate jar entry' reference when trying to
+ * save alignments with multiple views, and codon mappings will not be shared
+ * across all panels in a split frame.
+ *
+ * @see Jalview2xmlTests#testStoreAndRecoverColourThresholds()
+ */
+ @Test(groups = "Functional")
+ public void testNewView_dsRefPreserved()
+ {
+ AlignViewport av = af.getViewport();
+ AlignmentI al = av.getAlignment();
+ AlignmentI original_ds = al.getDataset();
+ af.newView_actionPerformed(null);
+ assertNotEquals("New view didn't select the a new panel", av,
+ af.getViewport());
+ org.testng.Assert.assertEquals(original_ds,
+ af.getViewport().getAlignment().getDataset(),
+ "Dataset was not preserved in new view");
+ }
}