diff options
Diffstat (limited to 'src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java')
-rw-r--r-- | src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java b/src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java index cd341be16..9e0f97699 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractXMLWritingIFPainter.java @@ -120,7 +120,7 @@ public abstract class AbstractXMLWritingIFPainter extends AbstractIFPainter { * @param sb the StringBuffer to write the transform method to * @return the StringBuffer passed to this method */ - protected StringBuffer toString(AffineTransform transform, StringBuffer sb) { + public static StringBuffer toString(AffineTransform transform, StringBuffer sb) { if (transform.isIdentity()) { return sb; } @@ -146,6 +146,40 @@ public abstract class AbstractXMLWritingIFPainter extends AbstractIFPainter { } /** + * Converts an {@code AffineTransform} array to an SVG style transform method sequence. + * @param transforms the transformation matrix array + * @param sb the StringBuffer to write the transform method sequence to + * @return the StringBuffer passed to this method + */ + public static StringBuffer toString(AffineTransform[] transforms, StringBuffer sb) { + for (int i = 0, c = transforms.length; i < c; i++) { + if (i > 0) { + sb.append(' '); + } + toString(transforms[i], sb); + } + return sb; + } + + /** + * Converts an {@code AffineTransform} array to an SVG style transform method sequence. + * @param transforms the transformation matrix array + * @return the formatted array + */ + public static String toString(AffineTransform[] transforms) { + return toString(transforms, new StringBuffer()).toString(); + } + + /** + * Converts an {@code AffineTransform} instance to an SVG style transform method. + * @param transform the transformation matrix + * @return the formatted array + */ + public static String toString(AffineTransform transform) { + return toString(transform, new StringBuffer()).toString(); + } + + /** * Convenience method to generate a startElement SAX event. * @param localName the local name of the element * @param atts the attributes |