I had the same project 2 years ago, .... after hours or works ... I was only able to view static SVG in a applet.
I was told recently in this list that things have change since, therefore, I tryed again 2 months ago!
Things have changed.
And it's always the same : - you have to add "ALL" batik's jar with your applet
This is mostly true, you can in fact omit a few depending on what you want to do with your applet (see the jar file dependency graph on the Batik web site). In the end IMHO the applet will probably be too large to use across the Internet, however for a fast LAN it shouldn't be too much of an issue (however Web Start is still better since it caches the Jar files the first time - why the Applet plugin doesn't do this is beyond me - this is supposed to be fixed in 1.5 I think).
- you have to sign the jar
- you have to give special permissions to your applet (modify java policy on the client !)
If done properly you do _not_ need to sign the applet (or give special permissions) There are a few tweaks you need to make to get this to work. In particular you will want to either switch to the crimson SAX parser (or for 1.4 clients just rely on the JDK parser). Additionally you will need to 'strip down' the js.jar file (right now it includes stuff you wouldn't want to send - like the JavaScript Debugger), in particular you need to strip the org/mozilla/javascript/optimizer package - this package 'compiles' the javascript to bytecode and then loads it - which is something an applet is not allowed to do - but the dependencies are all runtime, if the package is missing Rhino won't use it.
and at the end .... only static SVG works ... I still had the famous "ecma/script" error.
If someone has ever succeed, I thing this would be a tremendously good idea to post a fully operational sample/demo somewhere, and describe precisely what have to be done.
I believe Java Web Start could be great.
Thanks, Christophe.
Selon Jamie <[EMAIL PROTECTED]>:
Don wrote:
> So I would like use Batik as an applet to download svg files to java
enabled
> web browsers and view them with interactive scaling and zooming embedded
> on a web page. I've seen mention of java applets using the Batik viewer
canvas, but I haven't > been able to find any tutorials or sample code to do that. Is there a file
or a web
> site I should look at, or does it require a bit of Java programming to hook
Batik up
> in an applet, supporting simple pan/zoom/url navigation? Implementing an applet to display SVG is relatively simple: use the JSVGCanvas
component.
The first problem you are going to quickly discover is that Batik is dependent
on Java 1.3 (and thus requires a JRE plug-in on the client side). The second
problem is the large amount of dependencies for JSVGCanvas, requiring you to
include practically the whole batik/lib directory in the download.
None of this invalidates your decision though, using a Java is still
infinitely preferrable to ActiveX (a la Adobe SVG Viewer). However, if there
is no issue with installation Java 1.3+ why not look at Java Web Start ...
--------------------------------------------------------------------- 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]