From: gmungoc Date: Thu, 2 Nov 2017 14:51:43 +0000 (+0000) Subject: JAL-2808 refactored getColor() checks feature visibility X-Git-Tag: Release_2_11_0~158 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=786b83267920fc35b826cc61b4299e9192692ff1;p=jalview.git JAL-2808 refactored getColor() checks feature visibility --- diff --git a/src/jalview/controller/AlignViewController.java b/src/jalview/controller/AlignViewController.java index 8b001b3..5662d0c 100644 --- a/src/jalview/controller/AlignViewController.java +++ b/src/jalview/controller/AlignViewController.java @@ -36,7 +36,6 @@ 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; @@ -54,20 +53,19 @@ public class AlignViewController implements AlignViewControllerI private AlignViewControllerGuiI avcg; public AlignViewController(AlignViewControllerGuiI alignFrame, - AlignViewportI viewport, AlignmentViewPanel alignPanel) + AlignViewportI vp, AlignmentViewPanel ap) { this.avcg = alignFrame; - this.viewport = viewport; - this.alignPanel = alignPanel; + this.viewport = vp; + this.alignPanel = ap; } @Override - public void setViewportAndAlignmentPanel(AlignViewportI viewport, - AlignmentViewPanel alignPanel) + public void setViewportAndAlignmentPanel(AlignViewportI vp, + AlignmentViewPanel ap) { - this.alignPanel = alignPanel; - this.viewport = viewport; - + this.alignPanel = ap; + this.viewport = vp; } @Override @@ -228,9 +226,8 @@ public class AlignViewController implements AlignViewControllerI int findColumnsWithFeature(String featureType, SequenceCollectionI sqcol, BitSet bs) { - FeatureRendererModel fr = alignPanel == null ? null - : (FeatureRendererModel) alignPanel.getFeatureRenderer(); - List visibleFeatures = fr.getDisplayedFeatureTypes(); + FeatureRenderer fr = alignPanel == null ? null : alignPanel + .getFeatureRenderer(); final int startColumn = sqcol.getStartRes() + 1; // converted to base 1 final int endColumn = sqcol.getEndRes() + 1; @@ -247,12 +244,9 @@ public class AlignViewController implements AlignViewControllerI boolean found = false; for (SequenceFeature sf : sfs) { - { - if (!visibleFeatures.contains(sf.getType()) - || fr.getColour(sf) == null) // could pull up getColour to FeatureRenderer interface - { - continue; - } + if (fr.getColour(sf) == null) + { + continue; } if (!found) {