JAL-3814 NONEWS property
[jalview.git] / src / jalview / renderer / OverviewResColourFinder.java
index 8fa0e23..a497d92 100644 (file)
@@ -28,21 +28,39 @@ import java.awt.Color;
 
 public class OverviewResColourFinder extends ResidueColourFinder
 {
-  final Color GAP_COLOUR;
+  final Color GAP_COLOUR; // default colour to use at gaps
 
-  final Color RESIDUE_COLOUR;
+  final Color RESIDUE_COLOUR; // default colour to use at residues
 
-  final Color HIDDEN_COLOUR;
+  final Color HIDDEN_COLOUR; // colour for hidden regions
 
   boolean useLegacy = false;
 
+  public static final Color OVERVIEW_DEFAULT_GAP = Color.lightGray;
+
+  public static final Color OVERVIEW_DEFAULT_LEGACY_GAP = Color.white;
+
+  public static final Color OVERVIEW_DEFAULT_HIDDEN = Color.darkGray
+          .darker();
+
+  /**
+   * Constructor without colour settings (used by applet)
+   */
   public OverviewResColourFinder()
   {
-    GAP_COLOUR = Color.lightGray; // new Color(240, 240, 240);
-    RESIDUE_COLOUR = Color.white;
-    HIDDEN_COLOUR = Color.DARK_GRAY.darker();
+    this(false, OVERVIEW_DEFAULT_GAP, OVERVIEW_DEFAULT_HIDDEN);
   }
 
+  /**
+   * Constructor with colour settings
+   * 
+   * @param useLegacyColouring
+   *          whether to use legacy gap colouring (white gaps, grey residues)
+   * @param gapCol
+   *          gap colour if not legacy
+   * @param hiddenCol
+   *          hidden region colour (transparency applied by rendering code)
+   */
   public OverviewResColourFinder(boolean useLegacyColouring, Color gapCol,
           Color hiddenCol)
   {
@@ -71,8 +89,8 @@ public class OverviewResColourFinder extends ResidueColourFinder
     // settings
     if (shader.getColourScheme() != null)
     {
-      if (!shader.getColourScheme().hasGapColour()
-              && Comparison.isGap(currentChar))
+      if (Comparison.isGap(currentChar)
+              && (!shader.getColourScheme().hasGapColour()))
       {
         resBoxColour = GAP_COLOUR;
       }
@@ -113,6 +131,11 @@ public class OverviewResColourFinder extends ResidueColourFinder
     return getBoxColour(currentShader, seq, i);
   }
 
+  /**
+   * Supply hidden colour
+   * 
+   * @return colour of hidden regions
+   */
   protected Color getHiddenColour()
   {
     return HIDDEN_COLOUR;