JAL-3383 JAL-3253-applet FeatureColourFinder avoiding unnec. creation of
authorhansonr <hansonr@STO24954W.ad.stolaf.edu>
Mon, 29 Jul 2019 20:32:06 +0000 (15:32 -0500)
committerhansonr <hansonr@STO24954W.ad.stolaf.edu>
Mon, 29 Jul 2019 20:32:06 +0000 (15:32 -0500)
image graphics

src/jalview/renderer/seqfeatures/FeatureColourFinder.java

index cfe2735..7fce08b 100644 (file)
@@ -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());