org.vectomatic.dom.svg.impl
Class SVGPaintParser

java.lang.Object
  extended by org.vectomatic.dom.svg.impl.SVGPaintParser

public class SVGPaintParser
extends Object

Class to parse SVG paint values. Do not call this class directly, it will be removed when browser provide good native support for it. Following is the BNF grammar of the expression supported.

  paint ::=  none 
    | currentColor 
    | color [icccolor] 
    | funciri [ none | currentColor | color [icccolor] ] 
    | inherit
    
  color ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)? 
    | "rgb(" wsp* integer comma integer comma integer wsp* ")" 
    | "rgb(" wsp* integer "%" comma integer "%" comma integer "%" wsp* ")" 
    | color-keyword 
  
  hexdigit ::= [0-9A-Fa-f] 
  
  comma ::= wsp* "," wsp* 
  
  icccolor ::= "icc-color(" name (comma-wsp number)+ ")" 
  
  name ::= [^,()#x20#x9#xD#xA]* 
 

Author:
laaglu

Field Summary
static OMSVGPaint CURRENT_COLOR
           
static OMSVGPaint INHERIT
           
static SVGPaintParser INSTANCE
           
static OMSVGPaint NONE
           
 
Constructor Summary
SVGPaintParser()
           
 
Method Summary
 String getNamedColor(String str)
           
 OMSVGICCColor iccColor(String str)
           
 OMSVGPaint parse(String cssText)
           
 OMRGBColor rgbColor(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NONE

public static final OMSVGPaint NONE

INHERIT

public static final OMSVGPaint INHERIT

CURRENT_COLOR

public static final OMSVGPaint CURRENT_COLOR

INSTANCE

public static final SVGPaintParser INSTANCE
Constructor Detail

SVGPaintParser

public SVGPaintParser()
Method Detail

parse

public OMSVGPaint parse(String cssText)

iccColor

public OMSVGICCColor iccColor(String str)

rgbColor

public OMRGBColor rgbColor(String str)

getNamedColor

public String getNamedColor(String str)


Copyright © 2012. All Rights Reserved.