From 99a6058f41bfbc372a7e20803b39769294068c65 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 30 Oct 2017 16:58:23 +0000 Subject: [PATCH] JAL-2791 check feature visibility when selecting columns --- src/jalview/controller/AlignViewController.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index 460c2b3..cc5a184 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -36,6 +36,7 @@ import jalview.datamodel.SequenceI; import jalview.io.DataSourceType; import jalview.io.FeaturesFile; import jalview.util.MessageManager; +import jalview.viewmodel.seqfeatures.FeatureRendererModel; import java.awt.Color; import java.util.BitSet; @@ -223,9 +224,13 @@ public class AlignViewController implements AlignViewControllerI * @param bs * @return */ - static int findColumnsWithFeature(String featureType, + int findColumnsWithFeature(String featureType, SequenceCollectionI sqcol, BitSet bs) { + FeatureRendererModel fr = (FeatureRendererModel) alignPanel + .getFeatureRenderer(); + List visibleFeatures = fr.getDisplayedFeatureTypes(); + final int startColumn = sqcol.getStartRes() + 1; // converted to base 1 final int endColumn = sqcol.getEndRes() + 1; List seqs = sqcol.getSequences(); @@ -245,6 +250,13 @@ public class AlignViewController implements AlignViewControllerI for (SequenceFeature sf : sfs) { + { + if (!visibleFeatures.contains(sf.getType()) + || fr.getColour(sf) == null) // could pull up getColour to FeatureRenderer interface + { + continue; + } + } int sfStartCol = sq.findIndex(sf.getBegin()); int sfEndCol = sq.findIndex(sf.getEnd()); -- 1.7.10.2