|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.text.TextFragment
A text item, with an associated font, that fits on a single line (see TextLine
).
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
The default font. |
Constructor Summary | |
TextFragment(java.lang.String text)
Creates a new text fragment. |
|
TextFragment(java.lang.String text,
java.awt.Font font)
Creates a new text fragment. |
Method Summary | |
float |
calculateBaselineOffset(java.awt.Graphics2D g2,
TextAnchor anchor)
Calculates the vertical offset between the baseline and the specified text anchor. |
java.awt.Dimension |
calculateDimensions(java.awt.Graphics2D g2)
Calculates the dimensions of the text fragment. |
void |
draw(java.awt.Graphics2D g2,
float anchorX,
float anchorY,
TextAnchor anchor,
float rotateX,
float rotateY,
double angle)
Draws the text fragment. |
java.awt.Font |
getFont()
Returns the font. |
java.lang.String |
getText()
Returns the text. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Font DEFAULT_FONT
Constructor Detail |
public TextFragment(java.lang.String text)
text
- the text.public TextFragment(java.lang.String text, java.awt.Font font)
text
- the text.font
- the font.Method Detail |
public java.lang.String getText()
public java.awt.Font getFont()
public java.awt.Dimension calculateDimensions(java.awt.Graphics2D g2)
g2
- the graphics device.
public void draw(java.awt.Graphics2D g2, float anchorX, float anchorY, TextAnchor anchor, float rotateX, float rotateY, double angle)
g2
- the graphics device.anchorX
- the x-coordinate of the anchor point.anchorY
- the y-coordinate of the anchor point.anchor
- the location of the text that is aligned to the anchor point.rotateX
- the x-coordinate of the rotation point.rotateY
- the y-coordinate of the rotation point.angle
- the angle.public float calculateBaselineOffset(java.awt.Graphics2D g2, TextAnchor anchor)
g2
- the graphics device.anchor
- the anchor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |