FileDocCategorySizeDatePackage
GTKGraphicsUtils.javaAPI DocJava SE 5 API2704Fri Aug 26 14:54:44 BST 2005com.sun.java.swing.plaf.gtk

GTKGraphicsUtils

public class GTKGraphicsUtils extends SynthGraphicsUtils
version
1.13, 12/19/03
author
Joshua Outwater

Fields Summary
Constructors Summary
Methods Summary
public voidpaintText(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, java.lang.String text, int x, int y, int mnemonicIndex)

        int componentState = context.getComponentState();
        if ((componentState & SynthConstants.DISABLED) ==
                              SynthConstants.DISABLED){
            Color orgColor = g.getColor();
            g.setColor(context.getStyle().getColor(context,
                                                   GTKColorType.WHITE));
            x += 1;
            y += 1;
            super.paintText(context, g, text, x, y, mnemonicIndex);

            g.setColor(orgColor);
            x -= 1;
            y -= 1;
            super.paintText(context, g, text, x, y, mnemonicIndex);
        }
        else {
            super.paintText(context, g, text, x, y, mnemonicIndex);
        }
    
public voidpaintText(javax.swing.plaf.synth.SynthContext context, java.awt.Graphics g, java.lang.String text, java.awt.Rectangle bounds, int mnemonicIndex)
Paints text at the specified location. This will not attempt to render the text as html nor will it offset by the insets of the component.

param
ss SynthContext
param
g Graphics used to render string in.
param
text Text to render
param
bounds Bounds of the text to be drawn.
param
mnemonicIndex Index to draw string at.

        Color color = g.getColor();

        Region region = context.getRegion();
        if ((region == Region.RADIO_BUTTON || region == Region.CHECK_BOX ||
             region == Region.TABBED_PANE_TAB) &&
             (context.getComponentState() & SynthConstants.FOCUSED) != 0) {
            JComponent source = context.getComponent();
            if (!(source instanceof AbstractButton) ||
                ((AbstractButton)source).isFocusPainted()) {
                ((GTKStyle)(context.getStyle())).getEngine(context).paintFocus(
                    context, g, SynthConstants.ENABLED,
                        "checkbutton", bounds.x - 2, bounds.y - 2,
                        bounds.width + 4, bounds.height + 4);
                g.setColor(color);
            }
        }
        super.paintText(context, g, text, bounds, mnemonicIndex);