Merge branch 'features/JAL-3010ontologyFeatureSettings' into
[jalview.git] / src / jalview / controller / AlignViewController.java
index d992e4e..cacde84 100644 (file)
@@ -157,7 +157,7 @@ public class AlignViewController implements AlignViewControllerI
 
   @Override
   public boolean markColumnsContainingFeatures(boolean invert,
-          boolean extendCurrent, boolean toggle, String featureType)
+          boolean extendCurrent, boolean toggle, String... featureType)
   {
     // JBPNote this routine could also mark rows, not just columns.
     // need a decent query structure to allow all types of feature searches
@@ -166,7 +166,7 @@ public class AlignViewController implements AlignViewControllerI
             || extendCurrent) ? viewport.getAlignment()
                     : viewport.getSelectionGroup();
 
-    int nseq = findColumnsWithFeature(featureType, sqcol, bs);
+    int nseq = findColumnsWithFeature(sqcol, bs, featureType);
 
     ColumnSelection cs = viewport.getColumnSelection();
     if (cs == null)
@@ -174,6 +174,9 @@ public class AlignViewController implements AlignViewControllerI
       cs = new ColumnSelection();
     }
 
+    String featureTypeString = featureType.length == 1 ? featureType[0]
+            : featureType.toString();
+
     if (bs.cardinality() > 0 || invert)
     {
       boolean changed = cs.markColumns(bs, sqcol.getStartRes(),
@@ -194,7 +197,7 @@ public class AlignViewController implements AlignViewControllerI
                     invert ? MessageManager
                             .getString("label.not_containing")
                             : MessageManager.getString("label.containing"),
-                    featureType, Integer.valueOf(nseq).toString() }));
+                    featureTypeString, Integer.valueOf(nseq).toString() }));
         return true;
       }
     }
@@ -202,7 +205,7 @@ public class AlignViewController implements AlignViewControllerI
     {
       avcg.setStatus(MessageManager
               .formatMessage("label.no_feature_of_type_found", new String[]
-              { featureType }));
+              { featureTypeString }));
       if (!extendCurrent)
       {
         cs.clear();
@@ -214,17 +217,18 @@ public class AlignViewController implements AlignViewControllerI
 
   /**
    * Sets a bit in the BitSet for each column (base 0) in the sequence
-   * collection which includes a visible feature of the specified feature type.
-   * Returns the number of sequences which have the feature visible in the
-   * selected range.
+   * collection which includes a visible feature of the specified feature
+   * type(s). Returns the number of sequences which have the feature(s) visible
+   * in the selected range.
    * 
-   * @param featureType
    * @param sqcol
    * @param bs
+   * @param featureType
+   * 
    * @return
    */
-  int findColumnsWithFeature(String featureType,
-          SequenceCollectionI sqcol, BitSet bs)
+  int findColumnsWithFeature(SequenceCollectionI sqcol,
+          BitSet bs, String... featureType)
   {
     FeatureRenderer fr = alignPanel == null ? null : alignPanel
             .getFeatureRenderer();