JAL-3383 get color as int options removed (to separate branch 3443)
[jalview.git] / src / jalview / renderer / OverviewResColourFinder.java
index 7207dea..8206b32 100644 (file)
@@ -22,7 +22,6 @@ package jalview.renderer;
 
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
-import jalview.renderer.seqfeatures.FeatureColourFinder;
 import jalview.util.Comparison;
 
 import java.awt.Color;
@@ -38,12 +37,10 @@ public class OverviewResColourFinder extends ResidueColourFinder
 
   final Color gapColour; // colour to use for gaps
 
-  final int gapColourInt;
+  final int gapColourInt; // RGB value of gapColour
 
   final Color residueColour; // colour to use for uncoloured residues
 
-  final int residueColourInt;
-
   final Color hiddenColour; // colour for hidden regions
 
   boolean useLegacy = false;
@@ -80,73 +77,33 @@ public class OverviewResColourFinder extends ResidueColourFinder
       residueColour = Color.WHITE;
     }
     gapColourInt = gapColour.getRGB();
-    residueColourInt = residueColour.getRGB();
     hiddenColour = hiddenCol;
   }
 
+  /**
+   * Overrides the method to return the currently configured Overview colours
+   * for gaps, or residues with no colour scheme set. A custom colour scheme
+   * which specifies a colour for gaps overrides the normal gap colour.
+   */
   @Override
   public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
   {
-    return new Color(getBoxColourInt(shader, seq, i));
-  }
-
-  public int getBoxColourInt(ResidueShaderI shader, SequenceI seq, int i)
-  {
     char currentChar = seq.getCharAt(i);
-    // In the overview window, gaps are coloured grey, unless the colour scheme
-    // specifies a gap colour, in which case gaps honour the colour scheme
-    // settings
     boolean isGap = Comparison.isGap(currentChar);
     if (shader.getColourScheme() == null)
     {
-      return (isGap ? gapColourInt : residueColourInt);
+      return (isGap ? gapColour : residueColour);
     }
-    return (isGap && !shader.getColourScheme().hasGapColour() ? gapColourInt
-            : shader.findColourInt(currentChar, i, seq));
-  }
-
-  @Override
-  public Color getResidueColour(boolean showBoxes, ResidueShaderI shader,
-          SequenceGroup[] allGroups, final SequenceI seq, int i,
-          FeatureColourFinder finder)
-  {
-    Color col = getResidueBoxColour(showBoxes, shader, allGroups, seq, i);
-
-    // if there's a FeatureColourFinder we might override the residue colour
-    // here with feature colouring
-    col = finder == null || finder.noFeaturesDisplayed() ? col
-            : finder.findFeatureColour(col, seq, i);
-    return col;
-  }
-
-
-  public int getResidueColourInt(boolean showBoxes, ResidueShaderI shader,
-          SequenceGroup[] allGroups, final SequenceI seq, int i,
-          FeatureColourFinder finder)
-  {
-    int col = getResidueBoxColourInt(showBoxes, shader, allGroups, seq, i);
-
-    // if there's a FeatureColourFinder we might override the residue colour
-    // here with feature colouring
-    col = finder == null || finder.noFeaturesDisplayed() ? col
-            : finder.findFeatureColourInt(col, seq, i);
-    return col;
-  }
-
-  @Override
-  protected Color getResidueBoxColour(boolean showBoxes,
-          ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq,
-          int i)
-  {
-    return new Color(
-            getResidueBoxColourInt(showBoxes, shader, allGroups, seq, i));
+    return (isGap && !shader.getColourScheme().hasGapColour() ? gapColour
+            : shader.findColour(currentChar, i, seq));
   }
 
   /**
    * In the overview, the showBoxes setting is ignored, as the overview displays
-   * the colours regardless.
+   * the colours regardless
    */
-  protected int getResidueBoxColourInt(boolean showBoxes,
+  @Override
+  protected Color getResidueBoxColour(boolean showBoxes,
           ResidueShaderI shader, SequenceGroup[] allGroups, SequenceI seq,
           int i)
   {
@@ -154,13 +111,13 @@ public class OverviewResColourFinder extends ResidueColourFinder
             i);
     ResidueShaderI currentShader = (currentSequenceGroup == null ? shader
             : currentSequenceGroup.getGroupColourScheme());
-    return getBoxColourInt(currentShader, seq, i);
+    return getBoxColour(currentShader, seq, i);
   }
 
   /**
-   * Supply hidden colour
+   * Returns the coloured configured for hidden regions in the Overview
    * 
-   * @return colour of hidden regions
+   * @return
    */
   protected Color getHiddenColour()
   {