org.apache.fop.svg
Class SVGUtilities

java.lang.Object
  extended by org.apache.fop.svg.SVGUtilities

public class SVGUtilities
extends Object

Some utilities for creating svg DOM documents and elements.


Constructor Summary
SVGUtilities()
           
 
Method Summary
static Element createClip(Document doc, Element els, String id)
          Create an SVG Clip.
static Element createEllipse(Document doc, float cx, float cy, float rx, float ry)
          Create an SVG Ellipse
static Element createG(Document doc)
          Create an SVG G.
static Element createImage(Document doc, String ref, float width, float height)
           
static Element createLine(Document doc, float x, float y, float x2, float y2)
          Create an SVG Line
static Element createPath(Document doc, String str)
          Create an SVG Path.
static Element createRect(Document doc, float x, float y, float width, float height)
          Create an SVG Rectangle.
static Document createSVGDocument(float width, float height)
           
static Element createText(Document doc, float x, float y, String str)
          Create an SVG Text object.
static Rectangle2D getStringBounds(String str, Font font)
          Get the string bounds for a particular string given the font.
static float getStringHeight(String str, Font font)
          Get the string height for a particular string given the font.
static float getStringWidth(String str, Font font)
          Get the string width for a particular string given the font.
static Element wrapText(Document doc, String str, Font font, float width)
          Create some SVG text that is wrapped into a specified width..
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SVGUtilities

public SVGUtilities()
Method Detail

createSVGDocument

public static final Document createSVGDocument(float width,
                                               float height)

getStringWidth

public static final float getStringWidth(String str,
                                         Font font)
Get the string width for a particular string given the font.


getStringHeight

public static final float getStringHeight(String str,
                                          Font font)
Get the string height for a particular string given the font.


getStringBounds

public static final Rectangle2D getStringBounds(String str,
                                                Font font)
Get the string bounds for a particular string given the font.


createLine

public static final Element createLine(Document doc,
                                       float x,
                                       float y,
                                       float x2,
                                       float y2)
Create an SVG Line


createEllipse

public static final Element createEllipse(Document doc,
                                          float cx,
                                          float cy,
                                          float rx,
                                          float ry)
Create an SVG Ellipse


createPath

public static final Element createPath(Document doc,
                                       String str)
Create an SVG Path.


createText

public static final Element createText(Document doc,
                                       float x,
                                       float y,
                                       String str)
Create an SVG Text object.


createRect

public static final Element createRect(Document doc,
                                       float x,
                                       float y,
                                       float width,
                                       float height)
Create an SVG Rectangle.


createG

public static final Element createG(Document doc)
Create an SVG G.


createClip

public static final Element createClip(Document doc,
                                       Element els,
                                       String id)
Create an SVG Clip.


createImage

public static final Element createImage(Document doc,
                                        String ref,
                                        float width,
                                        float height)

wrapText

public static final Element wrapText(Document doc,
                                     String str,
                                     Font font,
                                     float width)
Create some SVG text that is wrapped into a specified width..



Copyright ? 1999-2003 Apache Software Foundation. All Rights Reserved.