import static org.testng.AssertJUnit.assertEquals;
import static org.testng.AssertJUnit.assertFalse;
import static org.testng.AssertJUnit.assertNotNull;
+import static org.testng.AssertJUnit.assertNotSame;
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
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.DataSourceType;
import jalview.io.FileLoader;
+import jalview.schemes.ClustalxColourScheme;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.PIDColourScheme;
import jalview.structure.StructureSelectionManager;
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
ColourSchemeI cs = new PIDColourScheme();
- af.getViewport().setGlobalColourScheme(cs);
- assertFalse(af.getViewport().getResidueShading()
+ AlignViewport viewport = af.getViewport();
+ viewport.setGlobalColourScheme(cs);
+ assertFalse(viewport.getResidueShading()
.conservationApplied());
+
+ /*
+ * JAL-3201 groups have their own ColourSchemeI instances
+ */
+ AlignmentI aln = viewport.getAlignment();
+ SequenceGroup sg1 = new SequenceGroup();
+ sg1.addSequence(aln.getSequenceAt(0), false);
+ sg1.addSequence(aln.getSequenceAt(2), false);
+ SequenceGroup sg2 = new SequenceGroup();
+ sg2.addSequence(aln.getSequenceAt(1), false);
+ sg2.addSequence(aln.getSequenceAt(3), false);
+ aln.addGroup(sg1);
+ aln.addGroup(sg2);
+ viewport.setColourAppliesToAllGroups(true);
+ viewport.setGlobalColourScheme(new ClustalxColourScheme());
+ ColourSchemeI cs0 = viewport.getGlobalColourScheme();
+ ColourSchemeI cs1 = sg1.getColourScheme();
+ ColourSchemeI cs2 = sg2.getColourScheme();
+ assertTrue(cs0 instanceof ClustalxColourScheme);
+ assertTrue(cs1 instanceof ClustalxColourScheme);
+ assertTrue(cs2 instanceof ClustalxColourScheme);
+ assertNotSame(cs0, cs1);
+ assertNotSame(cs0, cs2);
+ assertNotSame(cs1, cs2);
}
@Test(groups = { "Functional" })