org.apache.poi.sl.draw
Class DrawTextFragment

java.lang.Object
  extended by org.apache.poi.sl.draw.DrawTextFragment
All Implemented Interfaces:
Drawable

public class DrawTextFragment
extends java.lang.Object
implements Drawable


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.poi.sl.draw.Drawable
Drawable.DrawableHint
 
Field Summary
 
Fields inherited from interface org.apache.poi.sl.draw.Drawable
CURRENT_SLIDE, DRAW_FACTORY, FONT_FALLBACK, FONT_HANDLER, FONT_MAP, GRADIENT_SHAPE, GRESTORE, GROUP_TRANSFORM, GSAVE, IMAGE_RENDERER, PRESET_GEOMETRY_CACHE, TEXT_AS_CHARACTERS, TEXT_AS_SHAPES, TEXT_RENDERING_MODE
 
Constructor Summary
DrawTextFragment(java.awt.font.TextLayout layout, java.text.AttributedString str)
           
 
Method Summary
 void applyTransform(java.awt.Graphics2D graphics)
          Apply 2-D transforms before drawing this shape.
 void draw(java.awt.Graphics2D graphics)
          Draw this shape into the supplied canvas
 void drawContent(java.awt.Graphics2D graphics)
          draw any content within this shape (image, text, etc.).
 java.text.AttributedString getAttributedString()
           
 float getHeight()
           
 java.awt.font.TextLayout getLayout()
           
 float getLeading()
           
 java.lang.String getString()
           
 float getWidth()
           
 void setPosition(double x, double y)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DrawTextFragment

public DrawTextFragment(java.awt.font.TextLayout layout,
                        java.text.AttributedString str)
Method Detail

setPosition

public void setPosition(double x,
                        double y)

draw

public void draw(java.awt.Graphics2D graphics)
Description copied from interface: Drawable
Draw this shape into the supplied canvas

Specified by:
draw in interface Drawable
Parameters:
graphics - the graphics to draw into

applyTransform

public void applyTransform(java.awt.Graphics2D graphics)
Description copied from interface: Drawable
Apply 2-D transforms before drawing this shape. This includes rotation and flipping.

Specified by:
applyTransform in interface Drawable
Parameters:
graphics - the graphics whos transform matrix will be modified

drawContent

public void drawContent(java.awt.Graphics2D graphics)
Description copied from interface: Drawable
draw any content within this shape (image, text, etc.).

Specified by:
drawContent in interface Drawable
Parameters:
graphics - the graphics to draw into

getLayout

public java.awt.font.TextLayout getLayout()

getAttributedString

public java.text.AttributedString getAttributedString()

getHeight

public float getHeight()
Returns:
full height of this text run which is sum of ascent, descent and leading

getLeading

public float getLeading()
Returns:
the leading height before/after a text line

getWidth

public float getWidth()
Returns:
width if this text run

getString

public java.lang.String getString()
Returns:
the string to be painted

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object