We should probably expose more directly but:
BridgeContext ctx;
ctx = canvas.getUpdateManager().getBridgeContext();Chimera wrote:
This is a stab in the dark, as I am a programming novice.
But learning comes from trying, so here goes:
The Constructors all expect a UserAgent parameter, except for the default constructor, which is 'protected'. Since protected methods require scope to execute, and the JavaDocs for BridgeContext show that it extends java.lang.Object... then you need an object first.
JSVGCanvas canvas = new JSVGCanvas(); BridgeContext context = new canvas.BridgeContext();
This won't work (it isn't valid Java).
My guess is that this is done exactly like a GraphicsContext, which is obtained for use with a particular component (our JSVGCanvas, in this case).
Then again, there is the method in Class JSVGComponent, which JSVGCanvas is a subclass of: protected BridgeContext createBridgeContext();
You are correct that this is a little like a GraphicsContext, so this is the factory method, so subclasses can create alternate implementations.
Again, I am a novice, but this is my stab at it.
Chimera
----- Original Message ----- From: "Ken Larson" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
Sent: Thursday, January 29, 2004 7:33 AM
Subject: Re: scripting from Java question
thanks. I'm new to batik, so maybe you could give me some pointers as to how to get the BridgeContext from the JSVGCanvas...
"You can get the BridgeContext from the JSVGCanvas. Of course you need to make sure you do this from the UpdateManager thread."
Thomas DeWeese wrote:
Ken Larson wrote:
I am using a JSVGCanvas to display an svg. In the svg I have some custom, top-level (global) script functions defined. I know how I can manipulate the SVG DOM from the java code, but how do I call my functions that are defined in the SVG?
If the SVG is embedded in an html document, then it is possible for the HTML to call these functions. But how do I do it from within
Swing?
See message:
http://nagoya.apache.org/eyebrowse/[EMAIL PROTECTED]&msgId=1322271
In your case the 'script' should be the call to the function to run.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
