X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueColourScheme.java;h=2f7a5e0220a366291ca00030c016e83c5897d90d;hp=b47b82ed6cc28a9e3fd4499d5e1ac069edf62bc1;hb=f4766a7bbcfae845fc95923b01fa14ff83d589ff;hpb=163ed5b997bbda48e4cdd950e87a8fe01baae7fb diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index b47b82e..2f7a5e0 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -35,9 +35,17 @@ 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*"; + + /* * 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 +62,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 +99,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 +208,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; + } }