/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. * @param dd Whether a document descriptor must be generated. */ public SAXSVGDocumentFactory(String parser, boolean dd) { super(SVGDOMImplementation.getDOMImplementation(), parser, dd); }
/** * <b>DOM</b>: Implements {@link Document#createElementNS(String,String)}. */ public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { SVGDOMImplementation impl = (SVGDOMImplementation)implementation; return impl.createElementNS(this, namespaceURI, qualifiedName); }
/** * Creates a new SVGDOMImplementation object. */ public SVGDOMImplementation() { factories = svg11Factories; registerFeature("CSS", "2.0"); registerFeature("StyleSheets", "2.0"); registerFeature("SVG", new String[] {"1.0", "1.1"}); registerFeature("SVGEvents", new String[] {"1.0", "1.1"}); }
/** * Creates an DocumentEventSupport object suitable for use with * this implementation. */ public DocumentEventSupport createDocumentEventSupport() { DocumentEventSupport result = super.createDocumentEventSupport(); result.registerEventFactory("WheelEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new SVGOMWheelEvent(); } }); result.registerEventFactory("ShadowTreeEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new XBLOMShadowTreeEvent(); } }); return result; }
/** * Initializes the given document. */ protected void initializeDocument(Document document) { SVGOMDocument doc = (SVGOMDocument)document; CSSEngine eng = doc.getCSSEngine(); if (eng == null) { SVGDOMImplementation impl; impl = (SVGDOMImplementation)doc.getImplementation(); eng = impl.createCSSEngine(doc, this); eng.setCSSEngineUserAgent(new CSSEngineUserAgentWrapper(userAgent)); doc.setCSSEngine(eng); eng.setMedia(userAgent.getMedia()); String uri = userAgent.getUserStyleSheetURI(); if (uri != null) { try { ParsedURL url = new ParsedURL(uri); eng.setUserAgentStyleSheet (eng.parseStyleSheet(url, "all")); } catch (Exception e) { userAgent.displayError(e); } } eng.setAlternateStyleSheet(userAgent.getAlternateStyleSheet()); } }
/** * Creates an DocumentEventSupport object suitable for use with * this implementation. */ public DocumentEventSupport createDocumentEventSupport() { DocumentEventSupport result = super.createDocumentEventSupport(); result.registerEventFactory("WheelEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new SVGOMWheelEvent(); } }); result.registerEventFactory("ShadowTreeEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new XBLOMShadowTreeEvent(); } }); return result; }
/** * Initializes the given document. */ protected void initializeDocument(Document document) { SVGOMDocument doc = (SVGOMDocument)document; CSSEngine eng = doc.getCSSEngine(); if (eng == null) { SVGDOMImplementation impl; impl = (SVGDOMImplementation)doc.getImplementation(); eng = impl.createCSSEngine(doc, this); eng.setCSSEngineUserAgent(new CSSEngineUserAgentWrapper(userAgent)); doc.setCSSEngine(eng); eng.setMedia(userAgent.getMedia()); String uri = userAgent.getUserStyleSheetURI(); if (uri != null) { try { ParsedURL url = new ParsedURL(uri); eng.setUserAgentStyleSheet (eng.parseStyleSheet(url, "all")); } catch (Exception e) { userAgent.displayError(e); } } eng.setAlternateStyleSheet(userAgent.getAlternateStyleSheet()); } }
/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. */ public SAXSVGDocumentFactory(String parser) { super(SVGDOMImplementation.getDOMImplementation(), parser); }
/** * <b>DOM</b>: Implements {@link Document#createElementNS(String,String)}. */ public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { SVGDOMImplementation impl = (SVGDOMImplementation)implementation; return impl.createElementNS(this, namespaceURI, qualifiedName); }
/** * Creates a new SVGDOMImplementation object. */ public SVGDOMImplementation() { factories = svg11Factories; registerFeature("CSS", "2.0"); registerFeature("StyleSheets", "2.0"); registerFeature("SVG", new String[] {"1.0", "1.1"}); registerFeature("SVGEvents", new String[] {"1.0", "1.1"}); }
/** * Creates an DocumentEventSupport object suitable for use with * this implementation. */ public DocumentEventSupport createDocumentEventSupport() { DocumentEventSupport result = super.createDocumentEventSupport(); result.registerEventFactory("WheelEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new SVGOMWheelEvent(); } }); result.registerEventFactory("ShadowTreeEvent", new DocumentEventSupport.EventFactory() { public Event createEvent() { return new XBLOMShadowTreeEvent(); } }); return result; }
/** * Initializes the given document. */ protected void initializeDocument(Document document) { SVGOMDocument doc = (SVGOMDocument)document; CSSEngine eng = doc.getCSSEngine(); if (eng == null) { SVGDOMImplementation impl; impl = (SVGDOMImplementation)doc.getImplementation(); eng = impl.createCSSEngine(doc, this); eng.setCSSEngineUserAgent(new CSSEngineUserAgentWrapper(userAgent)); doc.setCSSEngine(eng); eng.setMedia(userAgent.getMedia()); String uri = userAgent.getUserStyleSheetURI(); if (uri != null) { try { ParsedURL url = new ParsedURL(uri); eng.setUserAgentStyleSheet (eng.parseStyleSheet(url, "all")); } catch (Exception e) { userAgent.displayError(e); } } eng.setAlternateStyleSheet(userAgent.getAlternateStyleSheet()); } }
/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. * @param dd Whether a document descriptor must be generated. */ public SAXSVGDocumentFactory(String parser, boolean dd) { super(SVGDOMImplementation.getDOMImplementation(), parser, dd); }
/** * <b>DOM</b>: Implements {@link Document#createElementNS(String,String)}. */ public Element createElementNS(String namespaceURI, String qualifiedName) throws DOMException { SVGDOMImplementation impl = (SVGDOMImplementation)implementation; return impl.createElementNS(this, namespaceURI, qualifiedName); }
/** * Creates a new SVGDOMImplementation object. */ public SVGDOMImplementation() { factories = svg11Factories; registerFeature("CSS", "2.0"); registerFeature("StyleSheets", "2.0"); registerFeature("SVG", new String[] {"1.0", "1.1"}); registerFeature("SVGEvents", new String[] {"1.0", "1.1"}); }
/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. */ public SAXSVGDocumentFactory(String parser) { super(SVGDOMImplementation.getDOMImplementation(), parser); }
/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. * @param dd Whether a document descriptor must be generated. */ public SAXSVGDocumentFactory(String parser, boolean dd) { super(SVGDOMImplementation.getDOMImplementation(), parser, dd); }
/** * Creates a new SVGDocumentFactory object. * @param parser The SAX2 parser classname. */ public SAXSVGDocumentFactory(String parser) { super(SVGDOMImplementation.getDOMImplementation(), parser); }
/** {@inheritDoc} */ public DOMImplementation getDOMImplementation() { return SVGDOMImplementation.getDOMImplementation(); }
/** * Create a new svg document with batik. * @param width the width of the root svg element * @param height the height of the root svg element * @return a new SVG Document */ public static Document createSVGDocument(float width, float height) { DOMImplementation impl = SVGDOMImplementation.getDOMImplementation(); Document doc = impl.createDocument(SVG_NS, "svg", null); Element svgRoot = doc.getDocumentElement(); svgRoot.setAttributeNS(null, "width", "" + width); svgRoot.setAttributeNS(null, "height", "" + height); return doc; }