public class TextUtils extends Object
Constructor and Description |
---|
TextUtils() |
Modifier and Type | Method and Description |
---|---|
static Rectangle2D |
calcAlignedStringBounds(String text,
Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor anchor)
Returns the bounds of an aligned string.
|
static Rectangle2D |
drawAlignedString(String text,
Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor anchor)
Draws a string such that the specified anchor point is aligned to the
given
(x, y) location, and returns a bounding rectangle
for the text. |
static Rectangle2D |
getTextBounds(String text,
double x,
double y,
FontMetrics fm)
Returns the bounds for the specified text when it is drawn with the
left-baseline aligned to the point
(x, y) . |
static Rectangle2D |
getTextBounds(String text,
FontMetrics fm)
Returns the bounds for the specified text.
|
public static Rectangle2D drawAlignedString(String text, Graphics2D g2, float x, float y, org.jfree.ui.TextAnchor anchor)
(x, y)
location, and returns a bounding rectangle
for the text.text
- the text.g2
- the graphics device.x
- the x coordinate (Java 2D).y
- the y coordinate (Java 2D).anchor
- the anchor location.public static Rectangle2D calcAlignedStringBounds(String text, Graphics2D g2, float x, float y, org.jfree.ui.TextAnchor anchor)
text
- the string (null
not permitted).g2
- the graphics target (null
not permitted).x
- the x-coordinate.y
- the y-coordinate.anchor
- the anchor point that will be aligned to
(x, y)
(null
not permitted).null
).public static Rectangle2D getTextBounds(String text, FontMetrics fm)
text
- the text (null
not permitted).fm
- the font metrics (null
not permitted).public static Rectangle2D getTextBounds(String text, double x, double y, FontMetrics fm)
(x, y)
.text
- the text (null
not permitted).x
- the x-coordinate.y
- the y-coordinate.fm
- the font metrics (null
not permitted).null
).Jas4pp 1.5 © Java Analysis Studio for Particle Physics