com.metsci.glimpse.support.font
Class AttributedTextRenderer.DefaultRenderDelegate

java.lang.Object
  extended by com.metsci.glimpse.support.font.AttributedTextRenderer.DefaultRenderDelegate
All Implemented Interfaces:
AttributedTextRenderer.RenderDelegate
Enclosing class:
AttributedTextRenderer

public static class AttributedTextRenderer.DefaultRenderDelegate
extends java.lang.Object
implements AttributedTextRenderer.RenderDelegate


Constructor Summary
AttributedTextRenderer.DefaultRenderDelegate()
           
 
Method Summary
 void draw(java.awt.Graphics2D g, java.text.AttributedString str2, int strx, int stry)
           
 void draw(java.awt.Graphics2D graphics, java.lang.String str, int x, int y)
          Render the passed character sequence at the designated location using the supplied Graphics2D instance.
 void drawGlyphVector(java.awt.Graphics2D graphics, java.awt.font.GlyphVector str, int x, int y)
          Render the passed GlyphVector at the designated location using the supplied Graphics2D instance.
 java.awt.geom.Rectangle2D getBounds(java.text.AttributedString str2, java.awt.Font font, java.awt.font.FontRenderContext fontRenderContext)
           
 java.awt.geom.Rectangle2D getBounds(java.lang.CharSequence str, java.awt.Font font, java.awt.font.FontRenderContext frc)
          Computes the bounds of the given character sequence relative to the origin.
 java.awt.geom.Rectangle2D getBounds(java.awt.font.GlyphVector gv, java.awt.font.FontRenderContext frc)
          Computes the bounds of the given GlyphVector, already assumed to have been created for a particular Font, relative to the origin.
 java.awt.geom.Rectangle2D getBounds(java.lang.String str, java.awt.Font font, java.awt.font.FontRenderContext frc)
          Computes the bounds of the given String relative to the origin.
 boolean intensityOnly()
          Indicates whether the backing store of this TextRenderer should be intensity-only (the default) or full-color.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributedTextRenderer.DefaultRenderDelegate

public AttributedTextRenderer.DefaultRenderDelegate()
Method Detail

intensityOnly

public boolean intensityOnly()
Description copied from interface: AttributedTextRenderer.RenderDelegate
Indicates whether the backing store of this TextRenderer should be intensity-only (the default) or full-color.

Specified by:
intensityOnly in interface AttributedTextRenderer.RenderDelegate

getBounds

public java.awt.geom.Rectangle2D getBounds(java.lang.CharSequence str,
                                           java.awt.Font font,
                                           java.awt.font.FontRenderContext frc)
Description copied from interface: AttributedTextRenderer.RenderDelegate
Computes the bounds of the given character sequence relative to the origin.

Specified by:
getBounds in interface AttributedTextRenderer.RenderDelegate

getBounds

public java.awt.geom.Rectangle2D getBounds(java.lang.String str,
                                           java.awt.Font font,
                                           java.awt.font.FontRenderContext frc)
Description copied from interface: AttributedTextRenderer.RenderDelegate
Computes the bounds of the given String relative to the origin.

Specified by:
getBounds in interface AttributedTextRenderer.RenderDelegate

getBounds

public java.awt.geom.Rectangle2D getBounds(java.awt.font.GlyphVector gv,
                                           java.awt.font.FontRenderContext frc)
Description copied from interface: AttributedTextRenderer.RenderDelegate
Computes the bounds of the given GlyphVector, already assumed to have been created for a particular Font, relative to the origin.

Specified by:
getBounds in interface AttributedTextRenderer.RenderDelegate

drawGlyphVector

public void drawGlyphVector(java.awt.Graphics2D graphics,
                            java.awt.font.GlyphVector str,
                            int x,
                            int y)
Description copied from interface: AttributedTextRenderer.RenderDelegate
Render the passed GlyphVector 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.

Specified by:
drawGlyphVector in interface AttributedTextRenderer.RenderDelegate

draw

public void draw(java.awt.Graphics2D graphics,
                 java.lang.String str,
                 int x,
                 int y)
Description copied from interface: AttributedTextRenderer.RenderDelegate
Render the passed character sequence 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.

Specified by:
draw in interface AttributedTextRenderer.RenderDelegate

draw

public void draw(java.awt.Graphics2D g,
                 java.text.AttributedString str2,
                 int strx,
                 int stry)
Specified by:
draw in interface AttributedTextRenderer.RenderDelegate

getBounds

public java.awt.geom.Rectangle2D getBounds(java.text.AttributedString str2,
                                           java.awt.Font font,
                                           java.awt.font.FontRenderContext fontRenderContext)
Specified by:
getBounds in interface AttributedTextRenderer.RenderDelegate


Copyright © 2012 Metron, Inc.. All Rights Reserved.