1 18 19 package org.apache.batik.css.engine.value.svg12; 20 21 import org.apache.batik.css.engine.CSSEngine; 22 import org.apache.batik.css.engine.value.LengthManager; 23 import org.apache.batik.css.engine.value.Value; 24 import org.apache.batik.css.engine.value.ValueManager; 25 import org.apache.batik.css.engine.value.svg.SVGValueConstants; 26 import org.w3c.css.sac.LexicalUnit; 27 import org.w3c.dom.DOMException ; 28 29 35 public class MarginLengthManager extends LengthManager { 36 37 protected String prop; 38 39 public MarginLengthManager(String prop) { 40 this.prop = prop; 41 } 42 43 46 public boolean isInheritedProperty() { 47 return true; 48 } 49 50 53 public String getPropertyName() { 54 return prop; 55 } 56 57 60 public Value getDefaultValue() { 61 return SVGValueConstants.NUMBER_0; 62 } 63 64 67 public Value createValue(LexicalUnit lu, CSSEngine engine) 68 throws DOMException { 69 if (lu.getLexicalUnitType() == LexicalUnit.SAC_INHERIT) { 70 return SVGValueConstants.INHERIT_VALUE; 71 } 72 return super.createValue(lu, engine); 73 } 74 75 76 80 protected int getOrientation() { 81 return HORIZONTAL_ORIENTATION; 83 } 84 } 85 | Popular Tags |