JAL-2360 refactoring for JalviewColourScheme enum,
[jalview.git] / src / jalview / schemes / RNAHelicesColour.java
index 9729a83..6448898 100644 (file)
@@ -21,6 +21,7 @@
 package jalview.schemes;
 
 import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AnnotatedCollectionI;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceI;
@@ -202,4 +203,34 @@ public class RNAHelicesColour extends ResidueColourScheme
   {
     return new RNAHelicesColour(this);
   }
-}
\ No newline at end of file
+
+  @Override
+  public boolean isNucleotideSpecific()
+  {
+    return true;
+  }
+
+  /**
+   * Answers true if the data has RNA secondary structure annotation
+   */
+  @Override
+  public boolean isApplicableTo(AnnotatedCollectionI ac)
+  {
+    AnnotatedCollectionI context = ac.getContext();
+    if (context == null)
+    {
+      context = ac;
+    }
+    if (context instanceof AlignmentI)
+    {
+      return ((AlignmentI) context).hasRNAStructure();
+    }
+    return false;
+  }
+
+  @Override
+  public String getSchemeName()
+  {
+    return JalviewColourScheme.RNAHelices.toString();
+  }
+}