Package org.apache.batik.bridge
Class BasicTextPainter
- java.lang.Object
-
- org.apache.batik.bridge.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 aTextNode. Suitable for use with "standard" java.awt.font.TextAttributes only.- Version:
- $Id: BasicTextPainter.java 1733416 2016-03-03 07:07:13Z gadams $
- See Also:
TextAttribute
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classBasicTextPainter.BasicMarkThis TextPainter's implementation of the Mark interface.
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.font.FontRenderContextaaOffFontRenderContextprotected java.awt.font.FontRenderContextfontRenderContextThe font render context to use.private static TextLayoutFactorytextLayoutFactory
-
Constructor Summary
Constructors Constructor Description BasicTextPainter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.awt.geom.Rectangle2DgetGeometryBounds(TextNode node)Get a Rectangle2D in userspace coords which encloses the textnode glyphs just including the geometry info.protected TextLayoutFactorygetTextLayoutFactory()protected abstract MarkhitTest(double x, double y, TextNode node)Returns the mark for the specified parameters.MarkselectAt(double x, double y, TextNode node)Given an X, y coordinate, AttributedCharacterIterator, return a Mark which encapsulates a "selection start" action.MarkselectTo(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.bridge.TextPainter
getBounds2D, getHighlightShape, getMark, getOutline, getSelected, paint, selectFirst, selectLast
-
-
-
-
Field Detail
-
textLayoutFactory
private static TextLayoutFactory textLayoutFactory
-
fontRenderContext
protected java.awt.font.FontRenderContext fontRenderContext
The font render context to use.
-
aaOffFontRenderContext
protected java.awt.font.FontRenderContext aaOffFontRenderContext
-
-
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:
selectAtin interfaceTextPainter
-
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:
selectToin interfaceTextPainter
-
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:
getGeometryBoundsin interfaceTextPainter- Parameters:
node- the TextNode to measure
-
-