org.apache.fop.svg
Class SVGUtilities

java.lang.Object
  |
  +--org.apache.fop.svg.SVGUtilities

public class SVGUtilities
extends java.lang.Object

Some utilities for creating svg DOM documents and elements.


Constructor Summary
SVGUtilities()
           
 
Method Summary
static org.w3c.dom.Element createClip(org.w3c.dom.Document doc, org.w3c.dom.Element els, java.lang.String id)
          Create an SVG Clip.
static org.w3c.dom.Element createEllipse(org.w3c.dom.Document doc, float cx, float cy, float rx, float ry)
          Create an SVG Ellipse
static org.w3c.dom.Element createG(org.w3c.dom.Document doc)
          Create an SVG G.
static org.w3c.dom.Element createImage(org.w3c.dom.Document doc, java.lang.String ref, float width, float height)
           
static org.w3c.dom.Element createLine(org.w3c.dom.Document doc, float x, float y, float x2, float y2)
          Create an SVG Line
static org.w3c.dom.Element createPath(org.w3c.dom.Document doc, java.lang.String str)
          Create an SVG Path.
static org.w3c.dom.Element createRect(org.w3c.dom.Document doc, float x, float y, float width, float height)
          Create an SVG Rectangle.
static org.w3c.dom.Document createSVGDocument(float width, float height)
           
static org.w3c.dom.Element createText(org.w3c.dom.Document doc, float x, float y, java.lang.String str)
          Create an SVG Text object.
static java.awt.geom.Rectangle2D getStringBounds(java.lang.String str, java.awt.Font font)
          Get the string bounds for a particular string given the font.
static float getStringHeight(java.lang.String str, java.awt.Font font)
          Get the string height for a particular string given the font.
static float getStringWidth(java.lang.String str, java.awt.Font font)
          Get the string width for a particular string given the font.
static org.w3c.dom.Element wrapText(org.w3c.dom.Document doc, java.lang.String str, java.awt.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 org.w3c.dom.Document createSVGDocument(float width,
                                                           float height)

getStringWidth

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

getStringHeight

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

getStringBounds

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

createLine

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

createEllipse

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

createPath

public static final org.w3c.dom.Element createPath(org.w3c.dom.Document doc,
                                                   java.lang.String str)
Create an SVG Path.

createText

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

createRect

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

createG

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

createClip

public static final org.w3c.dom.Element createClip(org.w3c.dom.Document doc,
                                                   org.w3c.dom.Element els,
                                                   java.lang.String id)
Create an SVG Clip.

createImage

public static final org.w3c.dom.Element createImage(org.w3c.dom.Document doc,
                                                    java.lang.String ref,
                                                    float width,
                                                    float height)

wrapText

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


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.