afreechart/src/main/java/org/afree/chart/text/TextUtilities.java
/**
     * Returns a shape that represents the bounds of the string after the
     * specified rotation has been applied.
     *
     * @param text  the text (<code>null</code> permitted).
     * @param textX  the x coordinate for the text.
     * @param textY  the y coordinate for the text.
     * @param angle  the angle.
     * @param rotateX  the x coordinate for the rotation point.
     * @param rotateY  the y coordinate for the rotation point.
     *
     * @return The bounds (<code>null</code> if <code>text</code> is
     *         </code>null</code> or has zero length).
     */
Returns a shape that represents the bounds of the string after the
specified rotation has been applied.

@param text  the text (null permitted).
@param textX  the x coordinate for the text.
@param textY  the y coordinate for the text.
@param angle  the angle.
@param rotateX  the x coordinate for the rotation point.
@param rotateY  the y coordinate for the rotation point.

@return The bounds (null if text is
null or has zero length).
Returns a shape that represents the bounds of the string after the specified rotation has been applied . @param text the text ( null permitted ) . @param textX the x coordinate for the text . @param textY the y coordinate for the text . @param angle the angle . @param rotateX the x coordinate for the rotation point . @param rotateY the y coordinate for the rotation point . @return The bounds ( null if text is null or has zero length ) .
public static RectShape calculateRotatedStringBounds(final String text,
            final Paint paint, final float textX, final float textY,
            final double angle, final float rotateX, final float rotateY) {
        if ((text == null) || (text.equals(""))) {
            return null;
        }
        final RectShape bounds = TextUtilities.getTextBounds(text, paint);
        bounds.translate(textX, textY);
        Matrix rotate = new Matrix();
        rotate.postRotate((float)angle, rotateX, rotateY);
        Path path = new Path(bounds.getPath());
        path.transform(rotate);
        RectF rect = new RectF();
        path.computeBounds(rect, false);
        PathShape pathShape = new PathShape(path);
        RectShape rectShape = new RectShape();
        pathShape.getBounds(rectShape);
        return rectShape;
    }
public static RectShape calculateRotatedStringBounds ( final String text , final Paint paint , final float textX , final float textY , final double angle , final float rotateX , final float rotateY ) { if ( ( text == null ) || ( text . equals ( "" ) ) ) { return null ; } final RectShape bounds = TextUtilities . getTextBounds ( text , paint ) ; bounds . translate ( textX , textY ) ; Matrix rotate = new Matrix ( ) ; rotate . postRotate ( ( float ) angle , rotateX , rotateY ) ; Path path = new Path ( bounds . getPath ( ) ) ; path . transform ( rotate ) ; RectF rect = new RectF ( ) ; path . computeBounds ( rect , false ) ; PathShape pathShape = new PathShape ( path ) ; RectShape rectShape = new RectShape ( ) ; pathShape . getBounds ( rectShape ) ; return rectShape ; }
Returns a shape that represents the bounds of the string after the
 specified rotation has been applied.
Returns a shape that represents the bounds of the string after the specified rotation has been applied .