From: hansonr Date: Mon, 29 Jul 2019 20:32:06 +0000 (-0500) Subject: JAL-3383 JAL-3253-applet FeatureColourFinder avoiding unnec. creation of X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7a50e26392e5943ed3b50cc46ea0e7e15f78340d;p=jalview.git JAL-3383 JAL-3253-applet FeatureColourFinder avoiding unnec. creation of image graphics --- diff --git a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java index cfe2735..7fce08b 100644 --- a/src/jalview/renderer/seqfeatures/FeatureColourFinder.java +++ b/src/jalview/renderer/seqfeatures/FeatureColourFinder.java @@ -48,6 +48,8 @@ public class FeatureColourFinder */ private BufferedImage offscreenImage; + private Graphics goff; + /** * Constructor * @@ -57,6 +59,7 @@ public class FeatureColourFinder { featureRenderer = fr; offscreenImage = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); + goff = offscreenImage.getGraphics(); } /** @@ -94,7 +97,7 @@ public class FeatureColourFinder */ if (featureRenderer.getTransparency() != 1f) { - g = offscreenImage.getGraphics(); + g = goff; if (defaultColour != null) { offscreenImage.setRGB(0, 0, defaultColour.getRGB());