org.apache.batik.gvt.renderer
Class BasicTextPainter

java.lang.Object
  |
  +--org.apache.batik.gvt.renderer.BasicTextPainter
All Implemented Interfaces:
TextPainter
Direct Known Subclasses:
ConcreteTextPainter, StrokingTextPainter

public abstract class BasicTextPainter
extends java.lang.Object
implements TextPainter

Basic implementation of TextPainter which renders the attributed character iterator of a TextNode. Suitable for use with "standard" java.awt.font.TextAttributes only.

See Also:
TextAttribute

Inner Class Summary
protected static class BasicTextPainter.BasicMark
          This TextPainter's implementation of the Mark interface.
 
Field Summary
protected  java.awt.font.FontRenderContext fontRenderContext
          The font render context to use.
 
Constructor Summary
BasicTextPainter()
           
 
Method Summary
 java.awt.geom.Rectangle2D getGeometryBounds(TextNode node)
          Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.
protected  TextLayoutFactory getTextLayoutFactory()
           
protected abstract  Mark hitTest(double x, double y, TextNode node)
          Returns the mark for the specified parameters.
 Mark selectAt(double x, double y, TextNode node)
          Given an X, y coordinate, AttributedCharacterIterator, return a Mark which encapsulates a "selection start" action.
 Mark selectTo(double x, double y, Mark beginMark)
          Given an X, y coordinate, starting Mark, AttributedCharacterIterator, return a Mark which encapsulates a "selection continued" action.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.batik.gvt.TextPainter
getBounds2D, getHighlightShape, getMark, getOutline, getSelected, paint, selectFirst, selectLast
 

Field Detail

fontRenderContext

protected java.awt.font.FontRenderContext fontRenderContext
The font render context to use.
Constructor Detail

BasicTextPainter

public BasicTextPainter()
Method Detail

getTextLayoutFactory

protected TextLayoutFactory getTextLayoutFactory()

selectAt

public Mark selectAt(double x,
                     double y,
                     TextNode node)
Given an X, y coordinate, AttributedCharacterIterator, return a Mark which encapsulates a "selection start" action. The standard order of method calls for selection is: selectAt(); [selectTo(),...], selectTo(); getSelection().
Specified by:
selectAt in interface TextPainter

selectTo

public Mark selectTo(double x,
                     double y,
                     Mark beginMark)
Given an X, y coordinate, starting Mark, AttributedCharacterIterator, return a Mark which encapsulates a "selection continued" action. The standard order of method calls for selection is: selectAt(); [selectTo(),...], selectTo(); getSelection().
Specified by:
selectTo in interface TextPainter

getGeometryBounds

public java.awt.geom.Rectangle2D getGeometryBounds(TextNode node)
Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.
Specified by:
getGeometryBounds in interface TextPainter
Parameters:
node - the TextNode to measure

hitTest

protected abstract Mark hitTest(double x,
                                double y,
                                TextNode node)
Returns the mark for the specified parameters.


Copyright © 2002 Apache Software Foundation. All Rights Reserved.