xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ACE91 <adamleg...@hotmail.com>
Subject Re: How to send event from embedded Javascript to Java
Date Fri, 09 Nov 2007 12:47:57 GMT



thomas.deweese wrote:
> 
> Where do you get BridgeContext from?
> Are you getting it from the canvas after the document is loaded?
> 

Because I don't know how to get it any other way, and Batik isn't
well-documented enough for me to find out the right way without scouring the
Javadoc pages for hours, I followed the Batik Wiki's BootSvgAndCssDom
Tutorial. The code that I used is as follows:

UserAgent      userAgent;
DocumentLoader loader;
BridgeContext ctx;

userAgent = new UserAgentAdapter();
loader    = new DocumentLoader(userAgent);
ctx       = new BridgeContext(userAgent, loader);
ctx.setDynamicState(BridgeContext.DYNAMIC);
GVTBuilder     builder;
GraphicsNode   rootGN;
        
builder   = new GVTBuilder();
rootGN    = builder.build(ctx, interfaceDoc);

This is all contained in the JApplet's init() method. Note that interfaceDoc
is the SVGDocument object that contains the scripts that I want to use. This
document has been loaded from a file when the code is executed, but it is
not being displayed in the JSVGCanvas at that moment. It is displayed later,
in another method.

So is there another way to get a BridgeContext object? I tried as hard as I
could, but I couldn't find one. If you could point me to a tutorial or
something, or at least show me how to get the right BridgeContext, that
would be helpful.

-- 
View this message in context: http://www.nabble.com/How-to-send-event-from-embedded-Javascript-to-Java-tf4754551.html#a13666389
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Mime
View raw message