Top Fields Constructors Methods
org.apache.poi.sl.draw

public Class DrawTextFragment

extends Object
implements Drawable
Class Inheritance
All Implemented Interfaces
org.apache.poi.sl.draw.Drawable
Imports
java.awt.Color, .Graphics2D, java.awt.font.TextAttribute, .TextLayout, java.text.AttributedCharacterIterator, .AttributedString, .CharacterIterator

Field Summary

Modifier and TypeField and Description
pack-priv final TextLayout
pack-priv final AttributedString
pack-priv double
x

pack-priv double
y

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
applyTransform(Graphics2D
the graphics whose transform matrix will be modified
graphics
)

Implements org.apache.poi.sl.draw.Drawable.applyTransform.

Apply 2-D transforms before drawing this shape.

public void
draw(Graphics2D
the graphics to draw into
graphics
)

Implements org.apache.poi.sl.draw.Drawable.draw.

Draw this shape into the supplied canvas

public void
drawContent(Graphics2D
the graphics to draw into
graphics
)

Implements org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

public AttributedString
public float

Returns:

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

public TextLayout
public float

Returns:

the leading height before/after a text line
getLeading
()

public String

Returns:

the string to be painted
getString
()

public float

Returns:

width if this text run
getWidth
()

private void
public void
setPosition(double x, double y)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

layoutback to summary
pack-priv final TextLayout layout
strback to summary
pack-priv final AttributedString str
xback to summary
pack-priv double x
yback to summary
pack-priv double y

Constructor Detail

DrawTextFragmentback to summary
public DrawTextFragment(TextLayout layout, AttributedString str)

Method Detail

applyTransformback to summary
public void applyTransform(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.applyTransform.

Doc from org.apache.poi.sl.draw.Drawable.applyTransform.

Apply 2-D transforms before drawing this shape. This includes rotation and flipping.

Parameters
graphics:Graphics2D

the graphics whose transform matrix will be modified

drawback to summary
public void draw(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.draw.

Doc from org.apache.poi.sl.draw.Drawable.draw.

Draw this shape into the supplied canvas

Parameters
graphics:Graphics2D

the graphics to draw into

drawContentback to summary
public void drawContent(Graphics2D graphics)

Implements org.apache.poi.sl.draw.Drawable.drawContent.

Doc from org.apache.poi.sl.draw.Drawable.drawContent.

draw any content within this shape (image, text, etc.).

Parameters
graphics:Graphics2D

the graphics to draw into

getAttributedStringback to summary
public AttributedString getAttributedString()
getHeightback to summary
public float getHeight()
Returns:float

full height of this text run which is sum of ascent, descent and leading

getLayoutback to summary
public TextLayout getLayout()
getLeadingback to summary
public float getLeading()
Returns:float

the leading height before/after a text line

getStringback to summary
public String getString()
Returns:String

the string to be painted

getWidthback to summary
public float getWidth()
Returns:float

width if this text run

replaceForgroundPaintWithBlackback to summary
private void replaceForgroundPaintWithBlack(AttributedString as)
setPositionback to summary
public void setPosition(double x, double y)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override