Merge branch 'develop' into features/JAL-3010ontologyFeatureSettings
[jalview.git] / src / jalview / controller / AlignViewController.java
index f45afa5..078a820 100644 (file)
@@ -161,7 +161,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
@@ -171,7 +171,7 @@ public class AlignViewController implements AlignViewControllerI
     SequenceCollectionI sqcol = searchSelection ? viewport
             .getSelectionGroup() : viewport.getAlignment();
 
-    int nseq = findColumnsWithFeature(featureType, sqcol, bs);
+    int nseq = findColumnsWithFeature(sqcol, bs, featureType);
 
     ColumnSelection cs = viewport.getColumnSelection();
     if (cs == null)
@@ -179,6 +179,16 @@ public class AlignViewController implements AlignViewControllerI
       cs = new ColumnSelection();
     }
 
+    String featureTypeString = featureType[0];
+    if (featureType.length > 1)
+    {
+      /*
+       * ellipsis if multiple feature types selected
+       * (from Summary View in Feature Settings)
+       */
+      featureTypeString += "...";
+    }
+
     if (bs.cardinality() > 0 || invert)
     {
       boolean changed = cs.markColumns(bs, sqcol.getStartRes(),
@@ -199,7 +209,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;
       }
     }
@@ -207,8 +217,9 @@ public class AlignViewController implements AlignViewControllerI
     {
       String key = searchSelection ? "label.no_feature_found_selection"
               : "label.no_feature_of_type_found";
-      avcg.setStatus(MessageManager.formatMessage(key,
-              new String[] { featureType }));
+      avcg.setStatus(
+              MessageManager.formatMessage(key, new String[]
+              { featureTypeString }));
       if (!extendCurrent)
       {
         cs.clear();
@@ -220,17 +231,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();