org.vectomatic.dom.svg.utils
Class OMSVGParser

java.lang.Object
  extended by org.vectomatic.dom.svg.utils.OMSVGParser

public class OMSVGParser
extends Object

Class to parse SVG documents and instantiate SVG documents

Author:
laaglu

Constructor Summary
OMSVGParser()
           
 
Method Summary
static OMSVGDocument createDocument()
          Creates a new empty SVG document
static OMSVGDocument currentDocument()
          Returns the current document, as an SVG document
static OMSVGSVGElement parse(String rawSvg)
          Parses the supplied SVG text into a document
static OMCSSValue parseDashArray(String cssText)
          Parses an SVG dasharray value
static OMSVGPaint parsePaint(String cssText)
          Parses an SVG paint value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OMSVGParser

public OMSVGParser()
Method Detail

createDocument

public static final OMSVGDocument createDocument()
Creates a new empty SVG document

Returns:
a new empty SVG document

currentDocument

public static final OMSVGDocument currentDocument()
Returns the current document, as an SVG document

Returns:
the current document, as an SVG document

parse

public static final OMSVGSVGElement parse(String rawSvg)
                                   throws ParserException
Parses the supplied SVG text into a document

Parameters:
rawSvg - raw xml to be parsed
Returns:
the document resulting from the parse
Throws:
ParserException - if the document is not well-formed or is not SVG

parsePaint

public static OMSVGPaint parsePaint(String cssText)
                             throws com.google.gwt.core.client.JavaScriptException
Parses an SVG paint value. SVG paint value are used for the 'fill' and the 'stroke' SVG attributes.

Parameters:
cssText - The value to parse
Returns:
The resulting paint object
Throws:
com.google.gwt.core.client.JavaScriptException - If the string to parse is not a valid paint value

parseDashArray

public static OMCSSValue parseDashArray(String cssText)
                                 throws com.google.gwt.core.client.JavaScriptException
Parses an SVG dasharray value

Parameters:
cssText - The dash array to parse
Returns:
The resulting dasharray
Throws:
com.google.gwt.core.client.JavaScriptException


Copyright © 2012. All Rights Reserved.