org.apache.batik.gvt
Interface TextPainter

All Known Implementing Classes:
BasicTextPainter

public interface TextPainter

Renders the attributed character iterator of a TextNode.


Method Summary
 java.awt.Shape getHighlightShape(Mark beginMark, Mark endMark)
           
 int[] getSelected(java.text.AttributedCharacterIterator aci, Mark start, Mark finish)
           
 void paint(java.text.AttributedCharacterIterator aci, java.awt.geom.Point2D location, TextNode.Anchor anchor, java.awt.Graphics2D g2d, GraphicsNodeRenderContext context)
          Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
 Mark selectAll(double x, double y, java.text.AttributedCharacterIterator aci, TextNode.Anchor anchor, GraphicsNodeRenderContext context)
          Select all of the text represented by an AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 Mark selectAt(double x, double y, java.text.AttributedCharacterIterator aci, TextNode.Anchor anchor, GraphicsNodeRenderContext context)
          Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 Mark selectTo(double x, double y, Mark beginMark, java.text.AttributedCharacterIterator aci, TextNode.Anchor anchor, GraphicsNodeRenderContext context)
          Continues a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 

Method Detail

paint

public void paint(java.text.AttributedCharacterIterator aci,
                  java.awt.geom.Point2D location,
                  TextNode.Anchor anchor,
                  java.awt.Graphics2D g2d,
                  GraphicsNodeRenderContext context)
Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
Parameters:
shape - the shape to paint
g2d - the Graphics2D to use
context - rendering context.

selectAt

public Mark selectAt(double x,
                     double y,
                     java.text.AttributedCharacterIterator aci,
                     TextNode.Anchor anchor,
                     GraphicsNodeRenderContext context)
Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
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
anchor - the text anchor (alignment) type of this 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 Mark selectTo(double x,
                     double y,
                     Mark beginMark,
                     java.text.AttributedCharacterIterator aci,
                     TextNode.Anchor anchor,
                     GraphicsNodeRenderContext context)
Continues a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
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
anchor - the text anchor (alignment) type of this 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 Mark selectAll(double x,
                      double y,
                      java.text.AttributedCharacterIterator aci,
                      TextNode.Anchor anchor,
                      GraphicsNodeRenderContext context)
Select all of the text represented by an AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
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
anchor - the text anchor (alignment) type of this 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.

getSelected

public int[] getSelected(java.text.AttributedCharacterIterator aci,
                         Mark start,
                         Mark finish)

getHighlightShape

public java.awt.Shape getHighlightShape(Mark beginMark,
                                        Mark endMark)


Copyright © 2000 Apache Software Foundation. All Rights Reserved.