/** * Returns the URL of this location as a String. */ public String toString() { return bridgeContext.getDocument() .getDocumentURI(); } }
/** * Default implementation uses the root element of the document * associated with BridgeContext. This is useful for CSS case. */ protected Element getBaseElement(BridgeContext ctx) { SVGDocument d = (SVGDocument)ctx.getDocument(); return d.getRootElement(); }
/** * Returns the URL of this location as a String. */ public String toString() { return ((AbstractDocument) bridgeContext.getDocument()) .getDocumentURI(); } }
/** * Default implementation uses the root element of the document * associated with BridgeContext. This is useful for CSS case. */ protected Element getBaseElement(BridgeContext ctx) { SVGDocument d = (SVGDocument)ctx.getDocument(); return d.getRootElement(); }
/** * Returns the URL of this location as a String. */ public String toString() { return ((AbstractDocument) bridgeContext.getDocument()) .getDocumentURI(); } }
/** * Default implementation uses the root element of the document * associated with BridgeContext. This is useful for CSS case. */ protected Element getBaseElement(BridgeContext ctx) { SVGDocument d = (SVGDocument)ctx.getDocument(); return d.getRootElement(); }
/** * The user agent reloads the current document. */ public void reload() { String url = ((AbstractDocument) bridgeContext.getDocument()) .getDocumentURI(); ((UserAgent)bridgeContext.getUserAgent()).loadDocument(url); }
/** * Creates a new BaseScriptingEnvironment. * @param ctx the bridge context */ public BaseScriptingEnvironment(BridgeContext ctx) { bridgeContext = ctx; document = ctx.getDocument(); docPURL = new ParsedURL(((SVGDocument)document).getURL()); userAgent = bridgeContext.getUserAgent(); }
/** * Creates a new BaseScriptingEnvironment. * @param ctx the bridge context */ public BaseScriptingEnvironment(BridgeContext ctx) { bridgeContext = ctx; document = ctx.getDocument(); docPURL = new ParsedURL(((SVGDocument)document).getURL()); userAgent = bridgeContext.getUserAgent(); }
/** * Creates a new BaseScriptingEnvironment. * @param ctx the bridge context */ public BaseScriptingEnvironment(BridgeContext ctx) { bridgeContext = ctx; document = ctx.getDocument(); docPURL = new ParsedURL(((SVGDocument)document).getURL()); userAgent = bridgeContext.getUserAgent(); }
/** * The user agent reloads the current document. */ public void reload() { String url = ((AbstractDocument) bridgeContext.getDocument()) .getDocumentURI(); ((UserAgent)bridgeContext.getUserAgent()).loadDocument(url); }
/** * The user agent reloads the current document. */ public void reload() { String url = bridgeContext.getDocument() .getDocumentURI(); bridgeContext.getUserAgent().loadDocument(url); }
/** * 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; }
/** * 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; }
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt) { Document doc = context.getPrimaryBridgeContext().getDocument(); Element targetElement = doc.getDocumentElement(); DocumentEvent d = (DocumentEvent) doc; SVGOMWheelEvent wheelEvt = (SVGOMWheelEvent) d.createEvent("WheelEvent"); wheelEvt.initWheelEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI, "wheel", true, true, null, evt.getWheelDelta()); try { ((EventTarget)targetElement).dispatchEvent(wheelEvt); } catch (RuntimeException e) { ua.displayError(e); } }
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt) { Document doc = context.getPrimaryBridgeContext().getDocument(); Element targetElement = doc.getDocumentElement(); DocumentEvent d = (DocumentEvent) doc; SVGOMWheelEvent wheelEvt = (SVGOMWheelEvent) d.createEvent("WheelEvent"); wheelEvt.initWheelEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI, "wheel", true, true, null, evt.getWheelDelta()); try { ((EventTarget)targetElement).dispatchEvent(wheelEvt); } catch (RuntimeException e) { ua.displayError(e); } }
/** * 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; }
/** * 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; }
/** * 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; }