+ /**
+ * Returns a descriptor for suitable feature display settings with
+ * <ul>
+ * <li>only exon or sequence_variant features (or their subtypes in the
+ * Sequence Ontology) visible</li>
+ * <li>variant features coloured red</li>
+ * <li>exon features coloured by label (exon name)</li>
+ * <li>variants displayed above (on top of) exons</li>
+ * </ul>
+ */
+ @Override
+ public FeatureSettingsModelI getFeatureColourScheme()
+ {
+ return new FeatureSettingsAdapter()
+ {
+ SequenceOntologyI so = SequenceOntologyFactory.getInstance();
+
+ @Override
+ public boolean isFeatureDisplayed(String type)
+ {
+ return (so.isA(type, SequenceOntologyI.EXON)
+ || so.isA(type, SequenceOntologyI.SEQUENCE_VARIANT));
+ }
+
+ @Override
+ public FeatureColourI getFeatureColour(String type)
+ {
+ if (so.isA(type, SequenceOntologyI.EXON))
+ {
+ return new FeatureColour()
+ {
+ @Override
+ public boolean isColourByLabel()
+ {
+ return true;
+ }
+ };
+ }
+ if (so.isA(type, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return new FeatureColour()
+ {
+
+ @Override
+ public Color getColour()
+ {
+ return Color.RED;
+ }
+ };
+ }
+ return null;
+ }
+
+ /**
+ * order to render sequence_variant after exon after the rest
+ */
+ @Override
+ public int compare(String feature1, String feature2)
+ {
+ if (so.isA(feature1, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return +1;
+ }
+ if (so.isA(feature2, SequenceOntologyI.SEQUENCE_VARIANT))
+ {
+ return -1;
+ }
+ if (so.isA(feature1, SequenceOntologyI.EXON))
+ {
+ return +1;
+ }
+ if (so.isA(feature2, SequenceOntologyI.EXON))
+ {
+ return -1;
+ }
+ return 0;
+ }
+ };
+ }
+