JAL-952 refactor code to select annotation for colouring the alignment
[jalview.git] / src / jalview / schemes / RNAHelicesColourChooser.java
index 45c374d..bcac5c7 100644 (file)
@@ -97,28 +97,9 @@ public class RNAHelicesColourChooser
     {
       return;
     }
-
-    // This loop will find the first rna structure annotation by which to colour
-    //  the sequences.
-    AlignmentAnnotation[] annotations = av.getAlignment().getAlignmentAnnotation();
-    for (int i = 0; i < annotations.length; i++) {
-       
-       // is this a sensible way of determining type of annotation?
-       if (annotations[i].getRNAStruc() != null) { 
-               currentAnnotation = annotations[i];
-               break;
-       }
-    }
-    if (currentAnnotation == null)   
-    {
-       System.err.println("Jalview is about to try and colour by RNAHelices even"
-                       + " though there are no RNA secondary structure annotations present!");
-       currentAnnotation = av.getAlignment().getAlignmentAnnotation()[0];// annotations.getSelectedIndex()];
-    }
-    
     RNAHelicesColour rhc = null;
 
-    rhc = new RNAHelicesColour(currentAnnotation);
+    rhc = new RNAHelicesColour(av.getAlignment());
 
     av.setGlobalColourScheme(rhc);
 
@@ -131,7 +112,7 @@ public class RNAHelicesColourChooser
           continue;
         }
 
-        sg.cs = new RNAHelicesColour(currentAnnotation);
+        sg.cs = new RNAHelicesColour(sg);
 
       }
     }