JAL-2808 refactored getColor() checks feature visibility
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 2 Nov 2017 14:51:43 +0000 (14:51 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 2 Nov 2017 14:51:43 +0000 (14:51 +0000)
src/jalview/controller/AlignViewController.java

index 8b001b3..5662d0c 100644 (file)
@@ -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<String> 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)
           {