1 18 package org.apache.batik.css.engine.value.svg; 19 20 import org.apache.batik.css.engine.CSSEngine; 21 import org.apache.batik.css.engine.value.Value; 22 import org.apache.batik.css.engine.value.ValueManager; 23 import org.apache.batik.util.CSSConstants; 24 import org.w3c.css.sac.LexicalUnit; 25 import org.w3c.dom.DOMException ; 26 import org.w3c.dom.css.CSSPrimitiveValue; 27 28 35 public class GlyphOrientationVerticalManager 36 extends GlyphOrientationManager { 37 38 41 public String getPropertyName() { 42 return CSSConstants.CSS_GLYPH_ORIENTATION_VERTICAL_PROPERTY; 43 } 44 45 48 public Value getDefaultValue() { 49 return SVGValueConstants.AUTO_VALUE; 50 } 51 52 55 public Value createValue(LexicalUnit lu, CSSEngine engine) 56 throws DOMException { 57 if (lu.getLexicalUnitType() == LexicalUnit.SAC_IDENT) { 58 if (lu.getStringValue().equalsIgnoreCase 59 (CSSConstants.CSS_AUTO_VALUE)) { 60 return SVGValueConstants.AUTO_VALUE; 61 } 62 throw createInvalidIdentifierDOMException(lu.getStringValue()); 63 } 64 return super.createValue(lu, engine); 65 } 66 67 71 public Value createStringValue(short type, String value, CSSEngine engine) 72 throws DOMException { 73 if (type != CSSPrimitiveValue.CSS_IDENT) { 74 throw createInvalidStringTypeDOMException(type); 75 } 76 if (value.equalsIgnoreCase(CSSConstants.CSS_AUTO_VALUE)) { 77 return SVGValueConstants.AUTO_VALUE; 78 } 79 throw createInvalidIdentifierDOMException(value); 80 } 81 } 82 | Popular Tags |