/** * This function creates a new 'sub' BridgeContext to associated * with 'newDoc' if one currently doesn't exist, otherwise it * returns the BridgeContext currently associated with the * document. * @param newDoc The document to get/create a BridgeContext for. */ public BridgeContext createSubBridgeContext(SVGOMDocument newDoc) { BridgeContext subCtx; CSSEngine eng = newDoc.getCSSEngine(); if (eng != null) { subCtx = (BridgeContext) newDoc.getCSSEngine().getCSSContext(); return subCtx; } subCtx = createBridgeContext(newDoc); subCtx.primaryContext = primaryContext != null ? primaryContext : this; subCtx.primaryContext.childContexts.add(new WeakReference(subCtx)); subCtx.dynamicStatus = dynamicStatus; subCtx.setGVTBuilder(getGVTBuilder()); subCtx.setTextPainter(getTextPainter()); subCtx.setDocument(newDoc); subCtx.initializeDocument(newDoc); if (isInteractive()) subCtx.addUIEventListeners(newDoc); return subCtx; }
/** * This function creates a new 'sub' BridgeContext to associated * with 'newDoc' if one currently doesn't exist, otherwise it * returns the BridgeContext currently associated with the * document. * @param newDoc The document to get/create a BridgeContext for. */ public BridgeContext createSubBridgeContext(SVGOMDocument newDoc) { BridgeContext subCtx; CSSEngine eng = newDoc.getCSSEngine(); if (eng != null) { subCtx = (BridgeContext) newDoc.getCSSEngine().getCSSContext(); return subCtx; } subCtx = createBridgeContext(newDoc); subCtx.primaryContext = primaryContext != null ? primaryContext : this; subCtx.primaryContext.childContexts.add(new WeakReference(subCtx)); subCtx.dynamicStatus = dynamicStatus; subCtx.setGVTBuilder(getGVTBuilder()); subCtx.setTextPainter(getTextPainter()); subCtx.setDocument(newDoc); subCtx.initializeDocument(newDoc); if (isInteractive()) subCtx.addUIEventListeners(newDoc); return subCtx; }
/** * This function creates a new 'sub' BridgeContext to associated * with 'newDoc' if one currently doesn't exist, otherwise it * returns the BridgeContext currently associated with the * document. * @param newDoc The document to get/create a BridgeContext for. */ public BridgeContext createSubBridgeContext(SVGOMDocument newDoc) { BridgeContext subCtx; CSSEngine eng = newDoc.getCSSEngine(); if (eng != null) { subCtx = (BridgeContext) newDoc.getCSSEngine().getCSSContext(); return subCtx; } subCtx = createBridgeContext(newDoc); subCtx.primaryContext = primaryContext != null ? primaryContext : this; subCtx.primaryContext.childContexts.add(new WeakReference(subCtx)); subCtx.dynamicStatus = dynamicStatus; subCtx.setGVTBuilder(getGVTBuilder()); subCtx.setTextPainter(getTextPainter()); subCtx.setDocument(newDoc); subCtx.initializeDocument(newDoc); if (isInteractive()) subCtx.addUIEventListeners(newDoc); return subCtx; }
ctx.addUIEventListeners(document);
subCtx.addUIEventListeners(imgDocument);
subCtx.addUIEventListeners(imgDocument);
subCtx.addUIEventListeners(imgDocument);