Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.opengl.util.j2d
Interface TextRenderer.RenderDelegate

Enclosing interface:
  TextRenderer

public static interface TextRenderer.RenderDelegate

Class supporting more full control over the process of rendering the bitmapped text. Allows customization of whether the backing store text bitmap is full-color or intensity only, the size of each individual rendered text rectangle, and the contents of each individual rendered text string. The default implementation of this interface uses an intensity-only texture, a closely-cropped rectangle around the text, and renders text using the color white, which is modulated by the set color during the rendering process.

Method Summary
`void` | `draw(Graphics2D graphics, String str, int x, int y)` Render the passed String at the designated location using the supplied Graphics2D instance.
`Rectangle2D` | `getBounds(String str, Font font, FontRenderContext frc)` Computes the bounds of the given text string relative to the origin.
`boolean` | `intensityOnly()` Indicates whether the backing store of this TextRenderer should be intensity-only (the default) or full-color.

Method Detail

### intensityOnly

    public boolean intensityOnly()

  Indicates whether the backing store of this TextRenderer should be intensity-only (the default) or full-color.

### getBounds

    public Rectangle2D getBounds(String str,
                                 Font font,
                                 FontRenderContext frc)

  Computes the bounds of the given text string relative to the origin.

### draw

    public void draw(Graphics2D graphics,
                     String str,
                     int x,
                     int y)

  Render the passed String at the designated location using the supplied Graphics2D instance. The surrounding region will already have been cleared to the RGB color (0, 0, 0) with zero alpha. The initial drawing context of the passed Graphics2D will be set to use AlphaComposite.Src, the color white, the Font specified in the TextRenderer's constructor, and the rendering hints specified in the TextRenderer constructor. Changes made by the end user may be visible in successive calls to this method, but are not guaranteed to be preserved. Implementors of this method should reset the Graphics2D's state to that desired each time this method is called, in particular those states which are not the defaults.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.