JAL-3253-applet JAL-3383
[jalview.git] / src / jalview / renderer / seqfeatures / FeatureColourFinder.java
index 7fce08b..8da880a 100644 (file)
@@ -117,13 +117,48 @@ public class FeatureColourFinder
     return c;
   }
 
+  public int findFeatureColourInt(int defaultColour, SequenceI seq,
+          int column)
+  {
+    // if (noFeaturesDisplayed())
+    // {
+    // return defaultColour;
+    // }
+
+    Graphics g = null;
+
+    /*
+     * if transparency applies, provide a notional 1x1 graphics context 
+     * that has been primed with the default colour
+     */
+    if (featureRenderer.getTransparency() != 1f)
+    {
+      g = goff;
+      if (defaultColour != 0)
+      {
+        offscreenImage.setRGB(0, 0, defaultColour);
+      }
+    }
+
+    Color c = featureRenderer.findFeatureColour(seq, column + 1, g);
+    if (c == null)
+    {
+      return defaultColour;
+    }
+
+    if (g != null)
+    {
+      return offscreenImage.getRGB(0, 0);
+    }
+    return c.getRGB();
+  }
   /**
    * Answers true if feature display is turned off, or there are no features
    * configured to be visible
    * 
    * @return
    */
-  boolean noFeaturesDisplayed()
+  public boolean noFeaturesDisplayed()
   {
     if (featureRenderer == null
             || !featureRenderer.getViewport().isShowSequenceFeatures())