From 48b550e4b6a14c90518c55a0e30829876193c347 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 5 Nov 2018 14:34:45 +0000 Subject: [PATCH] JAL-3148 add findColour(char) to ColourSchemeI --- src/jalview/schemes/ColourSchemeI.java | 12 ++++++++++++ src/jalview/schemes/ResidueColourScheme.java | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) 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; -- 1.7.10.2