org.apache.fop.svg
Class PDFTextPainter

java.lang.Object
  |
  +--org.apache.fop.svg.PDFTextPainter
All Implemented Interfaces:
org.apache.batik.gvt.TextPainter

public class PDFTextPainter
extends java.lang.Object
implements org.apache.batik.gvt.TextPainter

Renders the attributed character iterator of a TextNode.

Version:
$Id: PDFTextPainter.java,v 1.4 2001/07/30 20:29:34 tore Exp $
Author:
Keiron Liddle

Constructor Summary
PDFTextPainter(FontState fs)
           
 
Method Summary
 java.awt.geom.Rectangle2D getBounds(org.apache.batik.gvt.TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.geom.Rectangle2D getDecoratedBounds(org.apache.batik.gvt.TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.Shape getDecoratedShape(org.apache.batik.gvt.TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.Shape getHighlightShape(org.apache.batik.gvt.text.Mark beginMark, org.apache.batik.gvt.text.Mark endMark)
           
 java.awt.geom.Rectangle2D getPaintedBounds(org.apache.batik.gvt.TextNode node, java.awt.font.FontRenderContext frc)
           
 int[] getSelected(java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.text.Mark start, org.apache.batik.gvt.text.Mark finish)
           
 java.awt.Shape getShape(org.apache.batik.gvt.TextNode node, java.awt.font.FontRenderContext frc)
           
 float getStringWidth(java.lang.String str)
           
 void paint(org.apache.batik.gvt.TextNode node, java.awt.Graphics2D g2d, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
 org.apache.batik.gvt.text.Mark selectAll(double x, double y, java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.TextNode node, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Select all of the text represented by an AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 org.apache.batik.gvt.text.Mark selectAt(double x, double y, java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.TextNode node, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 org.apache.batik.gvt.text.Mark selectFirst(double x, double y, java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.TextNode node, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Selects the first glyph in the text node.
 org.apache.batik.gvt.text.Mark selectLast(double x, double y, java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.TextNode node, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Selects the last glyph in the text node.
 org.apache.batik.gvt.text.Mark selectTo(double x, double y, org.apache.batik.gvt.text.Mark beginMark, java.text.AttributedCharacterIterator aci, org.apache.batik.gvt.TextNode node, org.apache.batik.gvt.GraphicsNodeRenderContext context)
          Continues a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PDFTextPainter

public PDFTextPainter(FontState fs)
Method Detail

paint

public void paint(org.apache.batik.gvt.TextNode node,
                  java.awt.Graphics2D g2d,
                  org.apache.batik.gvt.GraphicsNodeRenderContext context)
Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
Specified by:
paint in interface org.apache.batik.gvt.TextPainter
Parameters:
node - the TextNode to paint
g2d - the Graphics2D to use
context - the rendering context.

getStringWidth

public float getStringWidth(java.lang.String str)

selectAt

public org.apache.batik.gvt.text.Mark selectAt(double x,
                                               double y,
                                               java.text.AttributedCharacterIterator aci,
                                               org.apache.batik.gvt.TextNode node,
                                               org.apache.batik.gvt.GraphicsNodeRenderContext context)
Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
Specified by:
selectAt in interface org.apache.batik.gvt.TextPainter
Parameters:
x - the x coordinate, in the text layout's coordinate system, of the selection event.
y - the y coordinate, in the text layout's coordinate system, of the selection event.
aci - the AttributedCharacterIterator describing the text
context - the GraphicsNodeRenderContext to use when doing text layout.
Returns:
an instance of Mark which encapsulates the state necessary to implement hit testing and text selection.

selectTo

public org.apache.batik.gvt.text.Mark selectTo(double x,
                                               double y,
                                               org.apache.batik.gvt.text.Mark beginMark,
                                               java.text.AttributedCharacterIterator aci,
                                               org.apache.batik.gvt.TextNode node,
                                               org.apache.batik.gvt.GraphicsNodeRenderContext context)
Continues a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
Specified by:
selectTo in interface org.apache.batik.gvt.TextPainter
Parameters:
x - the x coordinate, in the text layout's coordinate system, of the selection event.
y - the y coordinate, in the text layout's coordinate system, of the selection event.
aci - the AttributedCharacterIterator describing the text
context - the GraphicsNodeRenderContext to use when doing text layout.
Returns:
an instance of Mark which encapsulates the state necessary to implement hit testing and text selection.

selectAll

public org.apache.batik.gvt.text.Mark selectAll(double x,
                                                double y,
                                                java.text.AttributedCharacterIterator aci,
                                                org.apache.batik.gvt.TextNode node,
                                                org.apache.batik.gvt.GraphicsNodeRenderContext context)
Select all of the text represented by an AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
Specified by:
selectAll in interface org.apache.batik.gvt.TextPainter
Parameters:
x - the x coordinate, in the text layout's coordinate system, of the selection event.
y - the y coordinate, in the text layout's coordinate system, of the selection event.
aci - the AttributedCharacterIterator describing the text
context - the GraphicsNodeRenderContext to use when doing text layout.
Returns:
an instance of Mark which encapsulates the state necessary to implement hit testing and text selection.

selectFirst

public org.apache.batik.gvt.text.Mark selectFirst(double x,
                                                  double y,
                                                  java.text.AttributedCharacterIterator aci,
                                                  org.apache.batik.gvt.TextNode node,
                                                  org.apache.batik.gvt.GraphicsNodeRenderContext context)
Selects the first glyph in the text node.
Specified by:
selectFirst in interface org.apache.batik.gvt.TextPainter

selectLast

public org.apache.batik.gvt.text.Mark selectLast(double x,
                                                 double y,
                                                 java.text.AttributedCharacterIterator aci,
                                                 org.apache.batik.gvt.TextNode node,
                                                 org.apache.batik.gvt.GraphicsNodeRenderContext context)
Selects the last glyph in the text node.
Specified by:
selectLast in interface org.apache.batik.gvt.TextPainter

getSelected

public int[] getSelected(java.text.AttributedCharacterIterator aci,
                         org.apache.batik.gvt.text.Mark start,
                         org.apache.batik.gvt.text.Mark finish)
Specified by:
getSelected in interface org.apache.batik.gvt.TextPainter

getHighlightShape

public java.awt.Shape getHighlightShape(org.apache.batik.gvt.text.Mark beginMark,
                                        org.apache.batik.gvt.text.Mark endMark)
Specified by:
getHighlightShape in interface org.apache.batik.gvt.TextPainter

getShape

public java.awt.Shape getShape(org.apache.batik.gvt.TextNode node,
                               java.awt.font.FontRenderContext frc)
Specified by:
getShape in interface org.apache.batik.gvt.TextPainter

getDecoratedShape

public java.awt.Shape getDecoratedShape(org.apache.batik.gvt.TextNode node,
                                        java.awt.font.FontRenderContext frc)
Specified by:
getDecoratedShape in interface org.apache.batik.gvt.TextPainter

getBounds

public java.awt.geom.Rectangle2D getBounds(org.apache.batik.gvt.TextNode node,
                                           java.awt.font.FontRenderContext frc)
Specified by:
getBounds in interface org.apache.batik.gvt.TextPainter

getDecoratedBounds

public java.awt.geom.Rectangle2D getDecoratedBounds(org.apache.batik.gvt.TextNode node,
                                                    java.awt.font.FontRenderContext frc)
Specified by:
getDecoratedBounds in interface org.apache.batik.gvt.TextPainter

getPaintedBounds

public java.awt.geom.Rectangle2D getPaintedBounds(org.apache.batik.gvt.TextNode node,
                                                  java.awt.font.FontRenderContext frc)
Specified by:
getPaintedBounds in interface org.apache.batik.gvt.TextPainter


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.