private static SAXSVGDocumentFactory createFactory() { return new SAXSVGDocumentFactory( PARSER ); }
/** * Load SVG from file. */ public static SvgImage loadSvgImage( InputStream in ) throws Exception { Document document = getSvgFactory().createDocument( null, in ); return new SvgImage( document ); }
protected RenderableSVG toRenderableSVG(String svgfile, URL svgUrl) throws SAXException, IOException { RenderableSVG svg; String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); String svgUri = svgfile; // Remove parameters from file URLs, as it is not supported by Windows if ("file".equals(svgUrl.getProtocol()) && svgUrl.getQuery() != null) { int idx = svgfile.indexOf('?'); if (idx > -1) { svgUri = svgfile.substring(0, idx); } } Document doc = f.createDocument(svgUri); Map<String, String> parameters = getParametersFromUrl(svgfile); if (!parameters.isEmpty() || hasParameters(doc.getDocumentElement())) { replaceParameters(doc.getDocumentElement(), parameters); } svg = new RenderableSVG(doc); return svg; }
protected void attrChanged() { super.attrChanged(); AbstractSVGAnimatedLength ry = (AbstractSVGAnimatedLength) getRy(); if (isSpecified() && !ry.isSpecified()) { ry.attrChanged(); } } };
/** * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}. */ public CSSStyleDeclaration getStyle() { if (style == null) { CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); style = new StyleDeclaration(eng); putLiveAttributeValue(null, SVG_STYLE_ATTRIBUTE, style); } return style; }
protected void attrChanged() { super.attrChanged(); AbstractSVGAnimatedLength rx = (AbstractSVGAnimatedLength) getRx(); if (isSpecified() && !rx.isSpecified()) { rx.attrChanged(); } } };
/** * Returns the override style declaration for this element. */ public CSSStyleDeclaration getOverrideStyle() { if (overrideStyleDeclaration == null) { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); overrideStyleDeclaration = new OverrideStyleDeclaration(eng); } return overrideStyleDeclaration; }
try { context.dispose(); document.setURLObject(new URL(transcoderInput.getURI())); transcode(document, transcoderInput.getURI(), null); SVGSVGElement root = document.getRootElement();
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
/** * Initializes all live attributes for this element. */ protected void initializeAllLiveAttributes() { super.initializeAllLiveAttributes(); initializeLiveAttributes(); }
try { URL url = new URL(uri); ((SVGOMDocument) document).setURLObject(url);
if (svg == null) { String parser = XMLResourceDescriptor.getXMLParserClassName(); SAXSVGDocumentFactory f = new SAXSVGDocumentFactory(parser); Document doc; int queryIdx = svgfile.indexOf("?"); if (svgfile.startsWith("file:/") && queryIdx > 0) { String localPath = svgfile.substring(0, queryIdx); doc = f.createDocument(localPath); } else { doc = f.createDocument(svgfile);
protected void attrChanged() { super.attrChanged(); AbstractSVGAnimatedLength ry = (AbstractSVGAnimatedLength) getRy(); if (isSpecified() && !ry.isSpecified()) { ry.attrChanged(); } } };
/** * <b>DOM</b>: Implements {@link org.w3c.dom.svg.SVGStylable#getStyle()}. */ public CSSStyleDeclaration getStyle() { if (style == null) { CSSEngine eng = ((SVGOMDocument)getOwnerDocument()).getCSSEngine(); style = new StyleDeclaration(eng); putLiveAttributeValue(null, SVG_STYLE_ATTRIBUTE, style); } return style; }
/** * Returns the override style declaration for this element. */ public CSSStyleDeclaration getOverrideStyle() { if (overrideStyleDeclaration == null) { CSSEngine eng = ((SVGOMDocument) getOwnerDocument()).getCSSEngine(); overrideStyleDeclaration = new OverrideStyleDeclaration(eng); } return overrideStyleDeclaration; }