1 18 19 package org.apache.batik.dom; 20 21 import org.apache.batik.css.engine.CSSEngine; 22 23 import org.w3c.dom.css.DocumentCSS; 24 import org.w3c.dom.css.CSSStyleDeclaration; 25 import org.w3c.dom.DocumentType ; 26 import org.w3c.dom.DOMImplementation ; 27 import org.w3c.dom.Element ; 28 import org.w3c.dom.stylesheets.StyleSheetList; 29 import org.w3c.dom.views.DocumentView; 30 import org.w3c.dom.views.AbstractView; 31 32 38 public abstract class AbstractStylableDocument extends AbstractDocument 39 implements DocumentCSS, 40 DocumentView { 41 42 45 protected transient AbstractView defaultView; 46 47 50 protected transient CSSEngine cssEngine; 51 52 53 protected AbstractStylableDocument() { 54 } 55 56 59 protected AbstractStylableDocument(DocumentType dt, 60 DOMImplementation impl) { 61 super(dt, impl); 62 } 63 64 67 public void setCSSEngine(CSSEngine ctx) { 68 cssEngine = ctx; 69 } 70 71 74 public CSSEngine getCSSEngine() { 75 return cssEngine; 76 } 77 78 80 84 public StyleSheetList getStyleSheets() { 85 throw new RuntimeException (" !!! Not implemented"); 86 } 87 88 90 94 public AbstractView getDefaultView() { 95 if (defaultView == null) { 96 ExtensibleDOMImplementation impl; 97 impl = (ExtensibleDOMImplementation)implementation; 98 defaultView = impl.createViewCSS(this); 99 } 100 return defaultView; 101 } 102 103 106 public void clearViewCSS() { 107 defaultView = null; 108 if (cssEngine != null) { 109 cssEngine.dispose(); 110 } 111 cssEngine = null; 112 } 113 114 116 120 public CSSStyleDeclaration getOverrideStyle(Element elt, 121 String pseudoElt) { 122 throw new RuntimeException (" !!! Not implemented"); 123 } 124 125 }; 126 | Popular Tags |