X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fschemes%2FResidueColourScheme.java;h=03ab5364b4d54f20362ca306c0706af6e3b5476f;hb=a0bd24f90375fc1d4be619bf65746a912dfcfc89;hp=6aa798e6b7e435353dcf5e3a790c3f65ad2cb564;hpb=11b2e9b16c3bb93d8788c2bc5d5654f6163402e6;p=jalview.git diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index 6aa798e..03ab536 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -46,6 +46,12 @@ public abstract class ResidueColourScheme implements ColourSchemeI 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 */ @@ -62,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 */ @@ -98,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]]; @@ -208,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; + } }