From b71733cda46c5a88cb65417501727f2e4b4cf135 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 19 Nov 2018 18:06:31 +0000 Subject: [PATCH] =?utf8?q?JAL-3127=20javadoc,=20don=E2=80=99t=20darken=20whi?= =?utf8?q?te=20when=20shading=20residues,=20and=20don=E2=80=99t=20need=20to=20?= =?utf8?q?hold=20reference=20to=20group?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/jalview/schemes/IdColourScheme.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/jalview/schemes/IdColourScheme.java b/src/jalview/schemes/IdColourScheme.java index 65dbcc9..5add470 100644 --- a/src/jalview/schemes/IdColourScheme.java +++ b/src/jalview/schemes/IdColourScheme.java @@ -28,12 +28,17 @@ import jalview.datamodel.SequenceI; import java.awt.Color; import java.util.Map; +/** + * shade sequences using the colour shown in the ID panel. Useful to map + * sequence groupings onto residue data (eg tree subgroups visualised on + * structures or overview window) + * + * @author jprocter + */ public class IdColourScheme implements ColourSchemeI { AlignViewportI view = null; - AnnotatedCollectionI coll = null; - public IdColourScheme() { @@ -41,7 +46,6 @@ public class IdColourScheme implements ColourSchemeI public IdColourScheme(AlignViewportI view, AnnotatedCollectionI coll) { this.view = view; - this.coll = coll; } @@ -76,8 +80,12 @@ public class IdColourScheme implements ColourSchemeI // ((SequenceGroup)coll).idColour // we always return the sequence ID colour, in case the user has customised // the displayed Id colour by right-clicking an internal node in the tree. - return (view == null) ? Color.WHITE - : view.getSequenceColour(seq).darker(); + if (view == null) + { + return Color.WHITE; + } + Color col = view.getSequenceColour(seq); + return Color.WHITE.equals(col) ? Color.WHITE : col.darker(); } @Override @@ -95,7 +103,6 @@ public class IdColourScheme implements ColourSchemeI @Override public boolean isSimple() { - // this is really a sequence colour - return true; + return false; } } -- 1.7.10.2