xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From J Aaron Farr <jaaronf...@yahoo.com>
Subject Re: Accessing my own Java classes from ECMAScript
Date Thu, 19 Sep 2002 18:46:45 GMT

Check out the Mozilla Rhino project documentation, for example:

http://www.mozilla.org/rhino/scriptjava.html

might be some help.

Specifically, your javascript for your example would have to look like:

importPackage(Packages.MyUsefulClass);
var muc = new Packages.MyUsefulClass();

You _MUST_ use the "Packages." prefix for any java classes outside the normal
jdk libaries.

Hope this helps.
jaaron

--- "Barbisch, Martin" <barbisch@sony.de> wrote:
> Hello Batik users,
> 
> I know that it is possible to use the standard Java classes from within the
> scripting part of an SVG file. E.g.:
> 
>   var url = new java.net.URL("file:///c:/somefile.txt");
> 
> The question now is: Is it possible to use selfmade classes? E.g.:
> 
>   var muc = new MyUsefulClass();
> 
> I already copied the 'MyUsefulClass.class' file to different directories and
> set the CLASSPATH accordingly. Then I started Squiggle (with java -jar
> batik.jar) and loaded the SVG file. Result: SVG Error: "MyUsefulClass" is
> not defined.
> 
> Any ideas?
> 
> 
> Cheers,
> 
> Martin
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

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


Mime
View raw message