float getTransparency();
/**
- * Returns -1 if feature1 'precedes' (is displayed on top of) feature 2, +1 if
- * feature2 is on top of feature1, or 0 if we don't care
+ * Returns -1 if feature1 is displayed before (below) feature 2, +1 if
+ * feature2 is displayed after (on top of) feature1, or 0 if we don't care.
+ *
+ * <br>
+ * Note that this is the opposite ordering to how features are displayed in
+ * the feature settings dialogue. FeatureRendererModel.setFeaturePriority
+ * takes care of converting between the two.
*
* @param feature1
* @param feature2
import static org.testng.AssertJUnit.assertSame;
import static org.testng.AssertJUnit.assertTrue;
+import jalview.api.FeatureSettingsModelI;
import jalview.datamodel.SequenceDummy;
import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceI;
import jalview.io.gff.SequenceOntologyLite;
import jalview.util.MapList;
+import java.awt.Color;
import java.util.List;
import org.testng.annotations.AfterClass;
sf.setType("exon");
assertFalse(testee.identifiesSequence(sf, accId));
}
+
+ /**
+ * Check behaviour of feature colour scheme for EnsemblGene sequences.
+ * Currently coded to display exon and sequence_variant (or sub-types) only,
+ * with sequence_variant in red above exon coloured by label.
+ */
+ @Test(groups = "Functional")
+ public void testGetFeatureColourScheme()
+ {
+ FeatureSettingsModelI fc = new EnsemblGene().getFeatureColourScheme();
+ assertTrue(fc.isFeatureDisplayed("exon"));
+ assertTrue(fc.isFeatureDisplayed("coding_exon")); // subtype of exon
+ assertTrue(fc.isFeatureDisplayed("sequence_variant"));
+ assertTrue(fc.isFeatureDisplayed("feature_variant")); // subtype
+ assertFalse(fc.isFeatureDisplayed("transcript"));
+ assertEquals(Color.RED, fc.getFeatureColour("sequence_variant")
+ .getColour());
+ assertEquals(Color.RED, fc.getFeatureColour("feature_variant")
+ .getColour());
+ assertTrue(fc.getFeatureColour("exon").isColourByLabel());
+ assertTrue(fc.getFeatureColour("coding_exon").isColourByLabel());
+ assertEquals(1, fc.compare("sequence_variant", "exon"));
+ assertEquals(-1, fc.compare("exon", "sequence_variant"));
+ assertEquals(1, fc.compare("feature_variant", "coding_exon"));
+ assertEquals(-1, fc.compare("coding_exon", "feature_variant"));
+ assertEquals(1f, fc.getTransparency());
+ }
}