JAL-2360 refactoring for JalviewColourScheme enum,
[jalview.git] / src / jalview / schemes / TCoffeeColourScheme.java
index 2be51c2..19c92a0 100644 (file)
@@ -141,4 +141,35 @@ public class TCoffeeColourScheme extends ResidueColourScheme
   {
     return new TCoffeeColourScheme(sg);
   }
+
+  /**
+   * Answers true if the annotated data has TCoffee score annotation
+   */
+  @Override
+  public boolean isApplicableTo(AnnotatedCollectionI ac)
+  {
+    if (ac.getContext() != null)
+    {
+      ac = ac.getContext();
+    }
+    AlignmentAnnotation[] anns = ac.getAlignmentAnnotation();
+    if (anns == null)
+    {
+      return false;
+    }
+    for (AlignmentAnnotation ann : anns)
+    {
+      if (TCoffeeScoreFile.TCOFFEE_SCORE.equals(ann.getCalcId()))
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  @Override
+  public String getSchemeName()
+  {
+    return JalviewColourScheme.TCoffee.toString();
+  }
 }