/** * Sets the document this bridge context is dedicated to, to the * specified document. * @param document the document */ protected void setDocument(Document document) { if (this.document != document){ fontFamilyMap = null; } this.document = document; this.isSVG12 = ((SVGOMDocument) document).isSVG12(); registerSVGBridges(); }
/** * Factory method for constructing an configuring a * BridgeContext so subclasses can insert new/modified * bridges in the context. * @param doc the SVG document to create the BridgeContext for * @return the newly instantiated BridgeContext */ protected BridgeContext createBridgeContext(SVGOMDocument doc) { return createBridgeContext(doc.isSVG12() ? "1.2" : "1.x"); }
/** * Factory method for constructing an configuring a * BridgeContext so subclasses can insert new/modified * bridges in the context. * @param doc the SVG document to create the BridgeContext for * @return the newly instantiated BridgeContext */ protected BridgeContext createBridgeContext(SVGOMDocument doc) { return createBridgeContext(doc.isSVG12() ? "1.2" : "1.x"); }
/** * Sets the document this bridge context is dedicated to, to the * specified document. * @param document the document */ protected void setDocument(Document document) { if (this.document != document){ fontFamilyMap = null; } this.document = document; this.isSVG12 = ((SVGOMDocument) document).isSVG12(); registerSVGBridges(); }
/** * Sets the document this bridge context is dedicated to, to the * specified document. * @param document the document */ protected void setDocument(Document document) { if (this.document != document){ fontFamilyMap = null; } this.document = document; this.isSVG12 = ((SVGOMDocument) document).isSVG12(); registerSVGBridges(); }
/** * Creates a new SVGAnimationEngine. */ public SVGAnimationEngine(Document doc, BridgeContext ctx) { super(doc); this.ctx = ctx; SVGOMDocument d = (SVGOMDocument) doc; cssEngine = d.getCSSEngine(); dummyStyleMap = new StyleMap(cssEngine.getNumberOfProperties()); isSVG12 = d.isSVG12(); }
/** * Creates a new SVGAnimationEngine. */ public SVGAnimationEngine(Document doc, BridgeContext ctx) { super(doc); this.ctx = ctx; SVGOMDocument d = (SVGOMDocument) doc; cssEngine = d.getCSSEngine(); dummyStyleMap = new StyleMap(cssEngine.getNumberOfProperties()); isSVG12 = d.isSVG12(); }
/** * Creates a new SVGAnimationEngine. */ public SVGAnimationEngine(Document doc, BridgeContext ctx) { super(doc); this.ctx = ctx; SVGOMDocument d = (SVGOMDocument) doc; cssEngine = d.getCSSEngine(); dummyStyleMap = new StyleMap(cssEngine.getNumberOfProperties()); isSVG12 = d.isSVG12(); }
/** * Creates a new bridge context. */ protected BridgeContext createBridgeContext(SVGOMDocument doc) { if (loader == null) { loader = new DocumentLoader(userAgent); } BridgeContext result; if (doc.isSVG12()) { result = new SVG12BridgeContext(userAgent, loader); } else { result = new BridgeContext(userAgent, loader); } return result; }
/** * Dispatches an 'SVGLoad' event to the document. */ public synchronized void dispatchSVGLoadEvent() throws InterruptedException { dispatchSVGLoadEvent(bridgeContext, scriptingEnvironment); for (int i = 0; i < secondaryScriptingEnvironments.length; i++) { BridgeContext ctx = secondaryBridgeContexts[i]; if (!((SVGOMDocument) ctx.getDocument()).isSVG12()) { continue; } ScriptingEnvironment se = secondaryScriptingEnvironments[i]; dispatchSVGLoadEvent(ctx, se); } secondaryBridgeContexts = null; secondaryScriptingEnvironments = null; }
/** * Creates a new bridge context. */ protected BridgeContext createBridgeContext(SVGOMDocument doc) { if (loader == null) { loader = new DocumentLoader(userAgent); } BridgeContext result; if (doc.isSVG12()) { result = new SVG12BridgeContext(userAgent, loader); } else { result = new BridgeContext(userAgent, loader); } return result; }
/** * Creates a new bridge context. */ protected BridgeContext createBridgeContext(SVGOMDocument doc) { if (loader == null) { loader = new DocumentLoader(userAgent); } BridgeContext result; if (doc.isSVG12()) { result = new SVG12BridgeContext(userAgent, loader); } else { result = new BridgeContext(userAgent, loader); } return result; }
/** * Dispatches an 'SVGLoad' event to the document. */ public synchronized void dispatchSVGLoadEvent() throws InterruptedException { dispatchSVGLoadEvent(bridgeContext, scriptingEnvironment); for (int i = 0; i < secondaryScriptingEnvironments.length; i++) { BridgeContext ctx = secondaryBridgeContexts[i]; if (!((SVGOMDocument) ctx.getDocument()).isSVG12()) { continue; } ScriptingEnvironment se = secondaryScriptingEnvironments[i]; dispatchSVGLoadEvent(ctx, se); } secondaryBridgeContexts = null; secondaryScriptingEnvironments = null; }
/** * Dispatches an 'SVGLoad' event to the document. */ public synchronized void dispatchSVGLoadEvent() throws InterruptedException { dispatchSVGLoadEvent(bridgeContext, scriptingEnvironment); for (int i = 0; i < secondaryScriptingEnvironments.length; i++) { BridgeContext ctx = secondaryBridgeContexts[i]; if (!((SVGOMDocument) ctx.getDocument()).isSVG12()) { continue; } ScriptingEnvironment se = secondaryScriptingEnvironments[i]; dispatchSVGLoadEvent(ctx, se); } secondaryBridgeContexts = null; secondaryScriptingEnvironments = null; }
/** * Creates an appropriate ScriptingEnvironment and XBL manager for * the given document. */ protected ScriptingEnvironment initializeScriptingEnvironment (BridgeContext ctx) { SVGOMDocument d = (SVGOMDocument) ctx.getDocument(); ScriptingEnvironment se; if (d.isSVG12()) { se = new SVG12ScriptingEnvironment(ctx); ctx.xblManager = new DefaultXBLManager(d, ctx); d.setXBLManager(ctx.xblManager); } else { se = new ScriptingEnvironment(ctx); } return se; }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * Creates an appropriate ScriptingEnvironment and XBL manager for * the given document. */ protected ScriptingEnvironment initializeScriptingEnvironment (BridgeContext ctx) { SVGOMDocument d = (SVGOMDocument) ctx.getDocument(); ScriptingEnvironment se; if (d.isSVG12()) { se = new SVG12ScriptingEnvironment(ctx); ctx.xblManager = new DefaultXBLManager(d, ctx); d.setXBLManager(ctx.xblManager); } else { se = new ScriptingEnvironment(ctx); } return se; }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * This function creates a new BridgeContext, it mostly * exists so subclasses can provide an instance of * themselves when a sub BridgeContext is needed. */ public BridgeContext createBridgeContext(SVGOMDocument doc) { if (doc.isSVG12()) { return new SVG12BridgeContext(getUserAgent(), getDocumentLoader()); } return new BridgeContext(getUserAgent(), getDocumentLoader()); }
/** * Creates an appropriate ScriptingEnvironment and XBL manager for * the given document. */ protected ScriptingEnvironment initializeScriptingEnvironment (BridgeContext ctx) { SVGOMDocument d = (SVGOMDocument) ctx.getDocument(); ScriptingEnvironment se; if (d.isSVG12()) { se = new SVG12ScriptingEnvironment(ctx); ctx.xblManager = new DefaultXBLManager(d, ctx); d.setXBLManager(ctx.xblManager); } else { se = new ScriptingEnvironment(ctx); } return se; }