From bf3afd12ede3a18ddb4843a100b075285c9fa92c Mon Sep 17 00:00:00 2001 From: hansonr Date: Tue, 15 Oct 2019 11:02:16 -0500 Subject: [PATCH] JAL-3442 (Aug 28 commit) option to use/not use cache --- src/jalview/renderer/OverviewResColourFinder.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/jalview/renderer/OverviewResColourFinder.java b/src/jalview/renderer/OverviewResColourFinder.java index a98f3b3..3bf1ef4 100644 --- a/src/jalview/renderer/OverviewResColourFinder.java +++ b/src/jalview/renderer/OverviewResColourFinder.java @@ -114,13 +114,18 @@ public class OverviewResColourFinder extends ResidueColourFinder i, finder)); } + private boolean useCache = // + true // option to use cache + // false // option to not use cache + ; public int getResidueColourInt(boolean showBoxes, ResidueShaderI shader, SequenceGroup[] allGroups, final SequenceI seq, int i, FeatureColourFinder finder) { - int c = seq.getColor(i); + + int c = (useCache ? seq.getColor(i) : 0); if (c != 0) { return c; @@ -130,9 +135,9 @@ public class OverviewResColourFinder extends ResidueColourFinder // if there's a FeatureColourFinder we might override the residue colour // here with feature colouring - return seq.setColor(i, - finder == null || finder.noFeaturesDisplayed() ? col - : finder.findFeatureColourInt(col, seq, i)); + c = (finder == null || finder.noFeaturesDisplayed() ? col + : finder.findFeatureColourInt(col, seq, i)); + return (useCache ? seq.setColor(i, c) : c); } /** -- 1.7.10.2