public class AttrStringUtils
extends java.lang.Object
AttributedString utilities.| Modifier | Constructor and Description |
|---|---|
private |
AttrStringUtils() |
| Modifier and Type | Method and Description |
|---|---|
private static float[] |
deriveRotationAnchorOffsets(java.awt.Graphics2D g2,
java.text.AttributedString text,
org.jfree.ui.TextAnchor anchor)
A utility method that calculates the rotation anchor offsets for a
string.
|
private static float[] |
deriveTextBoundsAnchorOffsets(java.awt.Graphics2D g2,
java.text.AttributedString text,
org.jfree.ui.TextAnchor anchor,
java.awt.geom.Rectangle2D textBounds) |
static void |
drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
double angle,
float x,
float y)
Draws the attributed string at
(x, y), rotated by the
specified angle about (x, y). |
static void |
drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float textX,
float textY,
double angle,
float rotateX,
float rotateY)
Draws the attributed string at
(textX, textY), rotated by
the specified angle about (rotateX, rotateY). |
static void |
drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor textAnchor,
double angle,
float rotationX,
float rotationY)
Draws the string anchored to
(x, y), rotated by the
specified angle about (rotationX, rotationY). |
static void |
drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor textAnchor,
double angle,
org.jfree.ui.TextAnchor rotationAnchor)
Draws a rotated string.
|
static java.awt.geom.Rectangle2D |
getTextBounds(java.text.AttributedString text,
java.awt.Graphics2D g2)
Returns the bounds for the attributed string.
|
private static boolean |
isBaseline(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isBottom(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isHalfAscent(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isHalfHeight(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isHorizontalCenter(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isHorizontalLeft(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isHorizontalRight(org.jfree.ui.TextAnchor anchor) |
private static boolean |
isTop(org.jfree.ui.TextAnchor anchor) |
public static java.awt.geom.Rectangle2D getTextBounds(java.text.AttributedString text,
java.awt.Graphics2D g2)
text - the attributed string (null not permitted).g2 - the graphics target (null not permitted).null).public static void drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
double angle,
float x,
float y)
(x, y), rotated by the
specified angle about (x, y).text - the attributed string (null not permitted).g2 - the graphics output target.angle - the angle.x - the x-coordinate.y - the y-coordinate.public static void drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float textX,
float textY,
double angle,
float rotateX,
float rotateY)
(textX, textY), rotated by
the specified angle about (rotateX, rotateY).text - the attributed string (null not permitted).g2 - the graphics output target.textX - the x-coordinate for the text.textY - the y-coordinate for the text.angle - the rotation angle (in radians).rotateX - the x-coordinate for the rotation point.rotateY - the y-coordinate for the rotation point.public static void drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor textAnchor,
double angle,
float rotationX,
float rotationY)
(x, y), rotated by the
specified angle about (rotationX, rotationY).text - the text (null not permitted).g2 - the graphics target.x - the x-coordinate for the text location.y - the y-coordinate for the text location.textAnchor - the text anchor point.angle - the rotation (in radians).rotationX - the x-coordinate for the rotation point.rotationY - the y-coordinate for the rotation point.public static void drawRotatedString(java.text.AttributedString text,
java.awt.Graphics2D g2,
float x,
float y,
org.jfree.ui.TextAnchor textAnchor,
double angle,
org.jfree.ui.TextAnchor rotationAnchor)
text - the text to draw.g2 - the graphics target.x - the x-coordinate for the text location.y - the y-coordinate for the text location.textAnchor - the text anchor point.angle - the rotation (in radians).rotationAnchor - the rotation anchor point.private static float[] deriveTextBoundsAnchorOffsets(java.awt.Graphics2D g2,
java.text.AttributedString text,
org.jfree.ui.TextAnchor anchor,
java.awt.geom.Rectangle2D textBounds)
private static float[] deriveRotationAnchorOffsets(java.awt.Graphics2D g2,
java.text.AttributedString text,
org.jfree.ui.TextAnchor anchor)
g2 - the graphics device.text - the text.anchor - the anchor point.private static boolean isTop(org.jfree.ui.TextAnchor anchor)
private static boolean isBaseline(org.jfree.ui.TextAnchor anchor)
private static boolean isHalfAscent(org.jfree.ui.TextAnchor anchor)
private static boolean isHalfHeight(org.jfree.ui.TextAnchor anchor)
private static boolean isBottom(org.jfree.ui.TextAnchor anchor)
private static boolean isHorizontalLeft(org.jfree.ui.TextAnchor anchor)
private static boolean isHorizontalCenter(org.jfree.ui.TextAnchor anchor)
private static boolean isHorizontalRight(org.jfree.ui.TextAnchor anchor)