xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cameron McCormack <cam-batik-us...@aka.mcc.id.au>
Subject Re: Calling java methods from ECMASCRIPT (not solved at the list)
Date Tue, 15 Jun 2004 13:00:33 GMT
Hi Gorka.

Gorka Garay:
> Ok, the thing is to call a Java method from the ECMAScript. I have
> searched the list and found out some examples that helped me to make
> this work:
> importPackage(Packages.myPackage);
> var myvar = (new MyObject()).myMethod(ECMAScript_vble1); // non-static method from "MyObject"
> var myvar2 = MyClass.myMethod(ECMAScript_vble2); // static method from "MyClass"
> alert(myvar+" - "+myvar2);
> As shown, I can call static methods from any class I hava and
> non-static methods if I create a new Object. I can give ECMAScript
> variables to them and get the returning values perfectly.
> But what I want is to access the TabbedPane to make it change to
> another TabbedPane to show some information related to the SVG element
> that was clicked on. I cannot call it statically because the method
> "setSelectedIndex(int)" is not static and I cannot call it by creating
> a new object, I need to call the method of the previously created
> object where the JSVGCanvas, and the ECMAScript, are inserted.
> I hope anybody of you can help me, any answer would be really
> appreciated.

You could have a static method of one of your classes that returns a
reference to the TabbedPane you want to manipulate.  Then you could call
methods on it from your JavaScript.

> P.D: I would like to make a special mention to Thomas DeWeese, who I
> have realized makes a great job at this list. I hope he can help me as
> much as he has helped so much people.

I hope he sorts out his problems with working on Batik!

> P.D.2: Excuse me for my awfull english, I guess it is a little bit
> rusty... :S

It's fine. :-)


Cameron McCormack
|  Web: http://mcc.id.au/
|  ICQ: 26955922

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

View raw message