Merge branch 'releases/Release_2_11_3_Branch'
[jalview.git] / src / jalview / schemes / ResidueColourScheme.java
index b47b82e..03ab536 100755 (executable)
@@ -35,9 +35,23 @@ public abstract class ResidueColourScheme implements ColourSchemeI
 {
   public static final String NONE = "None";
 
+  /*
+   * default display name for a user defined colour scheme
+   */
   public static final String USER_DEFINED = "User Defined";
 
   /*
+   * name for (new) "User Defined.." colour scheme menu item
+   */
+  public static final String USER_DEFINED_MENU = "*User Defined*";
+
+  /*
+   * the canonical name of the annotation colour scheme 
+   * (may be used to identify it in menu items)
+   */
+  public static final String ANNOTATION_COLOUR = "Annotation";
+
+  /*
    * lookup up by character value e.g. 'G' to the colors array index
    * e.g. if symbolIndex['K'] = 11 then colors[11] is the colour for K
    */
@@ -54,8 +68,9 @@ public abstract class ResidueColourScheme implements ColourSchemeI
   /**
    * Creates a new ResidueColourScheme object.
    * 
-   * @param final int[] index table into colors (ResidueProperties.naIndex or
-   *        ResidueProperties.aaIndex)
+   * @param final
+   *          int[] index table into colors (ResidueProperties.naIndex or
+   *          ResidueProperties.aaIndex)
    * @param colors
    *          colours for symbols in sequences
    */
@@ -90,8 +105,7 @@ public abstract class ResidueColourScheme implements ColourSchemeI
   {
     Color colour = Color.white;
 
-    if (colors != null && symbolIndex != null
-            && c < symbolIndex.length
+    if (colors != null && symbolIndex != null && c < symbolIndex.length
             && symbolIndex[c] < colors.length)
     {
       colour = colors[symbolIndex[c]];
@@ -200,4 +214,14 @@ public abstract class ResidueColourScheme implements ColourSchemeI
   {
     return true;
   }
+
+  /**
+   * Default method returns false. Override this to return true in colour
+   * schemes that have a colour associated with gap residues.
+   */
+  @Override
+  public boolean hasGapColour()
+  {
+    return false;
+  }
 }