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.geom.Rectangle2D getBounds(TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.geom.Rectangle2D getDecoratedBounds(TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.Shape getDecoratedShape(TextNode node, java.awt.font.FontRenderContext frc)
           
 java.awt.Shape getHighlightShape(Mark beginMark, Mark endMark)
           
 java.awt.geom.Rectangle2D getPaintedBounds(TextNode node, java.awt.font.FontRenderContext frc)
           
 int[] getSelected(java.text.AttributedCharacterIterator aci, Mark start, Mark finish)
           
 java.awt.Shape getShape(TextNode node, java.awt.font.FontRenderContext frc)
           
 void paint(TextNode node, 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 node, 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 node, GraphicsNodeRenderContext context)
          Initiates a text selection on a particular AttributedCharacterIterator, using the text/font metrics employed by this TextPainter instance.
 Mark selectFirst(double x, double y, java.text.AttributedCharacterIterator aci, TextNode node, GraphicsNodeRenderContext context)
          Selects the first glyph in the text node.
 Mark selectLast(double x, double y, java.text.AttributedCharacterIterator aci, TextNode node, GraphicsNodeRenderContext context)
          Selects the last glyph in the text node.
 Mark selectTo(double x, double y, Mark beginMark, java.text.AttributedCharacterIterator aci, TextNode node, 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(TextNode node,
                  java.awt.Graphics2D g2d,
                  GraphicsNodeRenderContext context)
Paints the specified attributed character iterator using the specified Graphics2D and context and font context.
Parameters:
node - the TextNode to paint
g2d - the Graphics2D to use
context - the rendering context.

selectAt

public Mark selectAt(double x,
                     double y,
                     java.text.AttributedCharacterIterator aci,
                     TextNode node,
                     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
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 node,
                     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
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 node,
                      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
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 Mark selectFirst(double x,
                        double y,
                        java.text.AttributedCharacterIterator aci,
                        TextNode node,
                        GraphicsNodeRenderContext context)
Selects the first glyph in the text node.

selectLast

public Mark selectLast(double x,
                       double y,
                       java.text.AttributedCharacterIterator aci,
                       TextNode node,
                       GraphicsNodeRenderContext context)
Selects the last glyph in the text node.

getSelected

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

getHighlightShape

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

getShape

public java.awt.Shape getShape(TextNode node,
                               java.awt.font.FontRenderContext frc)

getDecoratedShape

public java.awt.Shape getDecoratedShape(TextNode node,
                                        java.awt.font.FontRenderContext frc)

getBounds

public java.awt.geom.Rectangle2D getBounds(TextNode node,
                                           java.awt.font.FontRenderContext frc)

getDecoratedBounds

public java.awt.geom.Rectangle2D getDecoratedBounds(TextNode node,
                                                    java.awt.font.FontRenderContext frc)

getPaintedBounds

public java.awt.geom.Rectangle2D getPaintedBounds(TextNode node,
                                                  java.awt.font.FontRenderContext frc)


Copyright © 2001 Apache Software Foundation. All Rights Reserved.