JAL-2360 ColourMenuHelper now builds and selects items in colour menu
[jalview.git] / src / jalview / schemes / ColourSchemes.java
index 21faa2a..33ec966 100644 (file)
@@ -1,7 +1,8 @@
 package jalview.schemes;
 
-import jalview.api.AlignViewportI;
 import jalview.datamodel.AnnotatedCollectionI;
+import jalview.datamodel.SequenceCollectionI;
+import jalview.datamodel.SequenceI;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
@@ -102,33 +103,39 @@ public class ColourSchemes
    * 
    * @param name
    *          name of the colour scheme
-   * @param viewport
+   * @param forData
+   *          the data to be coloured
+   * @param optional
+   *          map from hidden representative sequences to the sequences they
+   *          represent
    * @return
    */
-  public ColourSchemeI getColourScheme(String name, AlignViewportI viewport)
+  public ColourSchemeI getColourScheme(String name,
+          AnnotatedCollectionI forData,
+          Map<SequenceI, SequenceCollectionI> hiddenRepSequences)
   {
     if (name == null)
     {
       return null;
     }
     ColourSchemeI cs = schemes.get(name.toLowerCase());
-    return cs == null ? null : cs.getInstance(viewport.getAlignment(),
-            viewport.getHiddenRepSequences());
+    return cs == null ? null : cs.getInstance(forData, hiddenRepSequences);
   }
 
   /**
-   * Returns an instance of the colour scheme with which the given data may be
+   * Returns an instance of the colour scheme with which the given view may be
    * coloured
    * 
    * @param name
+   *          name of the colour scheme
    * @param forData
+   *          the data to be coloured
    * @return
    */
   public ColourSchemeI getColourScheme(String name,
           AnnotatedCollectionI forData)
   {
-    ColourSchemeI cs = schemes.get(name.toLowerCase());
-    return cs == null ? null : cs.getInstance(forData, null);
+    return getColourScheme(name, forData, null);
   }
 
   /**