From: gmungoc Date: Mon, 5 Nov 2018 14:34:45 +0000 (+0000) Subject: JAL-3148 add findColour(char) to ColourSchemeI X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=48b550e4b6a14c90518c55a0e30829876193c347;hp=2c2ac117a3d29360070c143ff2480edc213e5d78;p=jalview.git JAL-3148 add findColour(char) to ColourSchemeI --- diff --git a/src/jalview/schemes/ColourSchemeI.java b/src/jalview/schemes/ColourSchemeI.java index d70b4e2..bbc2955 100755 --- a/src/jalview/schemes/ColourSchemeI.java +++ b/src/jalview/schemes/ColourSchemeI.java @@ -45,6 +45,18 @@ public interface ColourSchemeI */ Color findColour(char symbol, int position, SequenceI seq, String consensusResidue, float pid); + + /** + * Answers the colour for the specified residue character (for 'simple' colour + * schemes where residue alone determines the colour) + * + * @param res + * @return + */ + default Color findColour(char res) + { + return Color.WHITE; + } /** * Recalculate dependent data using the given sequence collection, taking diff --git a/src/jalview/schemes/ResidueColourScheme.java b/src/jalview/schemes/ResidueColourScheme.java index 2f7a5e0..3f1ee7f 100755 --- a/src/jalview/schemes/ResidueColourScheme.java +++ b/src/jalview/schemes/ResidueColourScheme.java @@ -92,9 +92,7 @@ public abstract class ResidueColourScheme implements ColourSchemeI symbolIndex = null; } - /** - * Find a colour without an index in a sequence - */ + @Override public Color findColour(char c) { Color colour = Color.white;