org.apache.fop.render.ps
public class PSTextPainter extends java.lang.Object implements org.apache.batik.gvt.TextPainter
Modifier and Type | Field and Description |
---|---|
protected org.apache.commons.logging.Log |
log
the logger for this class
|
protected static org.apache.batik.gvt.TextPainter |
PROXY_PAINTER
Use the stroking text painter to get the bounds and shape.
|
Constructor and Description |
---|
PSTextPainter(NativeTextHandler nativeTextHandler)
Create a new PS text painter with the given font information.
|
Modifier and Type | Method and Description |
---|---|
protected void |
drawPrimitiveString(java.awt.Graphics2D g2d,
java.awt.geom.Point2D loc,
Font font,
java.lang.String txt,
float tx) |
java.awt.geom.Rectangle2D |
getBounds2D(org.apache.batik.gvt.TextNode node)
Get the bounds.
|
java.awt.geom.Rectangle2D |
getGeometryBounds(org.apache.batik.gvt.TextNode node)
Get the geometry bounds.
|
java.awt.Shape |
getHighlightShape(org.apache.batik.gvt.text.Mark beginMark,
org.apache.batik.gvt.text.Mark endMark)
Get the highlighted shape.
|
org.apache.batik.gvt.text.Mark |
getMark(org.apache.batik.gvt.TextNode node,
int pos,
boolean all)
Get the mark.
|
java.awt.Shape |
getOutline(org.apache.batik.gvt.TextNode node)
Get the outline shape of the text characters.
|
int[] |
getSelected(org.apache.batik.gvt.text.Mark start,
org.apache.batik.gvt.text.Mark finish)
Get selected.
|
protected java.lang.String |
getText(java.text.AttributedCharacterIterator aci)
Extract the raw text from an ACI.
|
void |
paint(org.apache.batik.gvt.TextNode node,
java.awt.Graphics2D g2d)
Paints the specified attributed character iterator using the
specified Graphics2D and context and font context.
|
protected java.awt.geom.Point2D |
paintACI(java.text.AttributedCharacterIterator aci,
java.awt.Graphics2D g2d,
java.awt.geom.Point2D loc)
Paint an ACI on a Graphics2D at a given location.
|
protected java.awt.geom.Point2D |
paintTextRun(org.apache.batik.gvt.renderer.StrokingTextPainter.TextRun run,
java.awt.Graphics2D g2d,
java.awt.geom.Point2D loc)
Paint a single text run on the Graphics2D at a given location.
|
protected void |
paintTextRuns(java.util.List textRuns,
java.awt.Graphics2D g2d,
java.awt.geom.Point2D loc)
Paint a list of text runs on the Graphics2D at a given location.
|
org.apache.batik.gvt.text.Mark |
selectAt(double x,
double y,
org.apache.batik.gvt.TextNode node)
Select at.
|
org.apache.batik.gvt.text.Mark |
selectFirst(org.apache.batik.gvt.TextNode node)
Selec first.
|
org.apache.batik.gvt.text.Mark |
selectLast(org.apache.batik.gvt.TextNode node)
Select last.
|
org.apache.batik.gvt.text.Mark |
selectTo(double x,
double y,
org.apache.batik.gvt.text.Mark beginMark)
Select to.
|
protected org.apache.commons.logging.Log log
protected static final org.apache.batik.gvt.TextPainter PROXY_PAINTER
public PSTextPainter(NativeTextHandler nativeTextHandler)
nativeTextHandler
- the NativeTextHandler instance used for text paintingpublic void paint(org.apache.batik.gvt.TextNode node, java.awt.Graphics2D g2d)
paint
in interface org.apache.batik.gvt.TextPainter
node
- the TextNode to paintg2d
- the Graphics2D to useprotected void paintTextRuns(java.util.List textRuns, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
textRuns
- the list of text runsg2d
- the Graphics2D to paint toloc
- the current location of the "cursor"protected java.awt.geom.Point2D paintTextRun(org.apache.batik.gvt.renderer.StrokingTextPainter.TextRun run, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
run
- the text run to paintg2d
- the Graphics2D to paint toloc
- the current location of the "cursor"protected java.lang.String getText(java.text.AttributedCharacterIterator aci)
aci
- ACI to inspectprotected java.awt.geom.Point2D paintACI(java.text.AttributedCharacterIterator aci, java.awt.Graphics2D g2d, java.awt.geom.Point2D loc)
aci
- ACI to paintg2d
- Graphics2D to paint onloc
- start locationprotected void drawPrimitiveString(java.awt.Graphics2D g2d, java.awt.geom.Point2D loc, Font font, java.lang.String txt, float tx)
public java.awt.Shape getOutline(org.apache.batik.gvt.TextNode node)
getOutline
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepublic java.awt.geom.Rectangle2D getBounds2D(org.apache.batik.gvt.TextNode node)
getBounds2D
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepublic java.awt.geom.Rectangle2D getGeometryBounds(org.apache.batik.gvt.TextNode node)
getGeometryBounds
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepublic org.apache.batik.gvt.text.Mark getMark(org.apache.batik.gvt.TextNode node, int pos, boolean all)
getMark
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepos
- the positionall
- select allpublic org.apache.batik.gvt.text.Mark selectAt(double x, double y, org.apache.batik.gvt.TextNode node)
selectAt
in interface org.apache.batik.gvt.TextPainter
x
- the x positiony
- the y positionnode
- the text nodepublic org.apache.batik.gvt.text.Mark selectTo(double x, double y, org.apache.batik.gvt.text.Mark beginMark)
selectTo
in interface org.apache.batik.gvt.TextPainter
x
- the x positiony
- the y positionbeginMark
- the start markpublic org.apache.batik.gvt.text.Mark selectFirst(org.apache.batik.gvt.TextNode node)
selectFirst
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepublic org.apache.batik.gvt.text.Mark selectLast(org.apache.batik.gvt.TextNode node)
selectLast
in interface org.apache.batik.gvt.TextPainter
node
- the text nodepublic int[] getSelected(org.apache.batik.gvt.text.Mark start, org.apache.batik.gvt.text.Mark finish)
getSelected
in interface org.apache.batik.gvt.TextPainter
start
- the start markfinish
- the finish markpublic java.awt.Shape getHighlightShape(org.apache.batik.gvt.text.Mark beginMark, org.apache.batik.gvt.text.Mark endMark)
getHighlightShape
in interface org.apache.batik.gvt.TextPainter
beginMark
- the start markendMark
- the end markCopyright 1999-2008 The Apache Software Foundation. All Rights Reserved.