X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fcontroller%2FAlignViewController.java;h=cacde84dc4de4e61003941329f901ca10ac57873;hb=58d01bd17f04745e37f69f947a41432fb9e3ec15;hp=d992e4e6a804f0f83fa6272a4cfa537bd91c1ddf;hpb=14b1b2a878190d5fffda298c4b9a901c72c74ad3;p=jalview.git diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index d992e4e..cacde84 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -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();