JAL-2527 Wired up cached values to overview
[jalview.git] / src / jalview / renderer / OverviewResColourFinder.java
index c591f54..b28aa27 100644 (file)
@@ -28,12 +28,42 @@ import java.awt.Color;
 
 public class OverviewResColourFinder extends ResidueColourFinder
 {
-  final Color GAP_COLOUR = new Color(240, 240, 240);
+  final Color GAP_COLOUR;
+
+  final Color RESIDUE_COLOUR;
+
+  final Color HIDDEN_COLOUR;
+
+  boolean useLegacy = false;
+
+  public OverviewResColourFinder()
+  {
+    GAP_COLOUR = new Color(240, 240, 240);
+    RESIDUE_COLOUR = Color.white;
+    HIDDEN_COLOUR = Color.DARK_GRAY.darker();
+  }
+
+  public OverviewResColourFinder(boolean useLegacyColouring, Color gapCol,
+          Color hiddenCol)
+  {
+    if (useLegacyColouring)
+    {
+      GAP_COLOUR = Color.white;
+      RESIDUE_COLOUR = new Color(240, 240, 240);
+      HIDDEN_COLOUR = hiddenCol;
+    }
+    else
+    {
+      GAP_COLOUR = gapCol;
+      RESIDUE_COLOUR = Color.white;
+      HIDDEN_COLOUR = hiddenCol;
+    }
+  }
 
   @Override
   public Color getBoxColour(ResidueShaderI shader, SequenceI seq, int i)
   {
-    Color resBoxColour = Color.white;
+    Color resBoxColour = RESIDUE_COLOUR;
     char currentChar = seq.getCharAt(i);
 
     // In the overview window, gaps are coloured grey, unless the colour scheme
@@ -82,4 +112,9 @@ public class OverviewResColourFinder extends ResidueColourFinder
 
     return getBoxColour(currentShader, seq, i);
   }
+
+  protected Color getHiddenColour()
+  {
+    return HIDDEN_COLOUR;
+  }
 }