Class TextRenderer.DefaultRenderDelegate

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      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.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.
      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.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.
      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.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.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

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultRenderDelegate

        public DefaultRenderDelegate()
    • Method Detail

      • intensityOnly

        public boolean intensityOnly()
        Description copied from interface: TextRenderer.RenderDelegate
        Indicates whether the backing store of this TextRenderer should be intensity-only (the default) or full-color.
        Specified by:
        intensityOnly in interface TextRenderer.RenderDelegate
        Returns:
        whether or not intensity only is on.
      • getBounds

        public java.awt.geom.Rectangle2D getBounds​(java.lang.CharSequence str,
                                                   java.awt.Font font,
                                                   java.awt.font.FontRenderContext frc)
        Description copied from interface: TextRenderer.RenderDelegate
        Computes the bounds of the given character sequence relative to the origin.
        Specified by:
        getBounds in interface TextRenderer.RenderDelegate
        Parameters:
        str - The string to process.
        font - The font to use.
        frc - The render context to use.
        Returns:
        The bounds given the parameters.
      • getBounds

        public java.awt.geom.Rectangle2D getBounds​(java.lang.String str,
                                                   java.awt.Font font,
                                                   java.awt.font.FontRenderContext frc)
        Description copied from interface: TextRenderer.RenderDelegate
        Computes the bounds of the given String relative to the origin.
        Specified by:
        getBounds in interface TextRenderer.RenderDelegate
        Parameters:
        str - The string to process.
        font - The font to use.
        frc - The render context to use.
        Returns:
        The bounds given the parameters.
      • getBounds

        public java.awt.geom.Rectangle2D getBounds​(java.awt.font.GlyphVector gv,
                                                   java.awt.font.FontRenderContext frc)
        Description copied from interface: TextRenderer.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 TextRenderer.RenderDelegate
        Parameters:
        gv - The string to process.
        frc - The render context to use.
        Returns:
        The bounds given the parameters.
      • drawGlyphVector

        public void drawGlyphVector​(java.awt.Graphics2D graphics,
                                    java.awt.font.GlyphVector str,
                                    int x,
                                    int y)
        Description copied from interface: TextRenderer.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 TextRenderer.RenderDelegate
        Parameters:
        graphics - The canvas to draw on.
        str - The string to draw.
        x - The x location.
        y - The y location.
      • draw

        public void draw​(java.awt.Graphics2D graphics,
                         java.lang.String str,
                         int x,
                         int y)
        Description copied from interface: TextRenderer.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 TextRenderer.RenderDelegate
        Parameters:
        graphics - The canvas to draw on.
        str - The string to draw.
        x - The x location.
        y - The y location.