1 18 package org.apache.batik.css.engine; 19 20 import java.net.URL ; 21 22 import org.apache.batik.css.engine.value.ShorthandManager; 23 import org.apache.batik.css.engine.value.ValueConstants; 24 import org.apache.batik.css.engine.value.ValueManager; 25 import org.apache.batik.css.engine.value.svg.SVGColorManager; 26 import org.apache.batik.css.engine.value.svg.OpacityManager; 27 import org.apache.batik.css.engine.value.svg12.LineHeightManager; 28 import org.apache.batik.css.engine.value.svg12.MarginLengthManager; 29 import org.apache.batik.css.engine.value.svg12.MarginShorthandManager; 30 import org.apache.batik.css.engine.value.svg12.TextAlignManager; 31 import org.apache.batik.css.parser.ExtendedParser; 32 import org.apache.batik.util.SVG12CSSConstants; 33 import org.w3c.dom.Document ; 34 35 41 public class SVG12CSSEngine extends SVGCSSEngine { 42 43 50 public SVG12CSSEngine(Document doc, 51 URL uri, 52 ExtendedParser p, 53 CSSContext ctx) { 54 super(doc, uri, p, 55 SVG_VALUE_MANAGERS, 56 SVG_SHORTHAND_MANAGERS, 57 ctx); 58 lineHeightIndex = LINE_HEIGHT_INDEX; 59 } 60 61 70 public SVG12CSSEngine(Document doc, 71 URL uri, 72 ExtendedParser p, 73 ValueManager[] vms, 74 ShorthandManager[] sms, 75 CSSContext ctx) { 76 super(doc, uri, p, 77 mergeArrays(SVG_VALUE_MANAGERS, vms), 78 mergeArrays(SVG_SHORTHAND_MANAGERS, sms), 79 ctx); 80 lineHeightIndex = LINE_HEIGHT_INDEX; 81 } 82 83 86 public final static ValueManager[] SVG_VALUE_MANAGERS = { 87 new LineHeightManager (), 88 new MarginLengthManager(SVG12CSSConstants.CSS_INDENT_PROPERTY), 89 new MarginLengthManager(SVG12CSSConstants.CSS_MARGIN_BOTTOM_PROPERTY), 90 new MarginLengthManager(SVG12CSSConstants.CSS_MARGIN_LEFT_PROPERTY), 91 new MarginLengthManager(SVG12CSSConstants.CSS_MARGIN_RIGHT_PROPERTY), 92 new MarginLengthManager(SVG12CSSConstants.CSS_MARGIN_TOP_PROPERTY), 93 new SVGColorManager (SVG12CSSConstants.CSS_SOLID_COLOR_PROPERTY), 94 new OpacityManager (SVG12CSSConstants.CSS_SOLID_OPACITY_PROPERTY, 95 true), 96 new TextAlignManager (), 97 }; 98 99 102 public final static ShorthandManager[] SVG_SHORTHAND_MANAGERS = { 103 new MarginShorthandManager(), 104 }; 105 106 public final static int LINE_HEIGHT_INDEX = SVGCSSEngine.FINAL_INDEX+1; 110 public final static int INDENT_INDEX = LINE_HEIGHT_INDEX+1; 111 public final static int MARGIN_BOTTOM_INDEX = INDENT_INDEX+1; 112 public final static int MARGIN_LEFT_INDEX = MARGIN_BOTTOM_INDEX+1; 113 public final static int MARGIN_RIGHT_INDEX = MARGIN_LEFT_INDEX+1; 114 public final static int MARGIN_TOP_INDEX = MARGIN_RIGHT_INDEX+1; 115 public final static int SOLID_COLOR_INDEX = MARGIN_TOP_INDEX+1; 116 public final static int SOLID_OPACITY_INDEX = SOLID_COLOR_INDEX+1; 117 public final static int TEXT_ALIGN_INDEX = SOLID_OPACITY_INDEX+1; 118 public final static int FINAL_INDEX = TEXT_ALIGN_INDEX; 119 } 120 | Popular Tags |