Does TextRenderer.RenderDelegate support RGBA?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Does TextRenderer.RenderDelegate support RGBA?

Martin JANDA
Hello,

  please can you tell me whether TextRenderer.RenderDelegate fully supports RGBA? I have custom render delegate that renders white rectangle bellow text/character.
  I get no text, only rectangles in single color (text color).  Both colors are opaque.

  Thank you very much
      Martin
 
public class BackgroundRenderDelegate implements TextRenderer.RenderDelegate {
...
    @Override
    public boolean intensityOnly() {  // i think that FALSE is for RGBA support
        return false;
    }
...
    @Override
    public void draw(final Graphics2D g2, final String text, final int x, final int y) {
        Color oldColor = g2.getColor();
        g2.setColor(Color.WHITE);
        g2.drawRect(...)
        g2.setColor(oldColor);
        g2.drawString(text, x, y);
    }
...
}