xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gorka Garay" <go...@sistemasjudo.com>
Subject Re: Calling java methods from ECMASCRIPT (not solved at the list)
Date Tue, 15 Jun 2004 14:13:17 GMT
Hi Cameron,

Thanks a lot for your so fast response.

I think you cannot call a non-static method from the TabbedPane in an static
context, so I cannot do what you say : (

The method I have to call is non-static, and must be the method of the
previously instantiated TabbedPane.

Another way of making the same question:

I can reach the TabbedPane from the Panel I have inside it with
myPane.getParent(), is there anyhing I can do to get out of the javascript
environment? Maybe something similar to this example I give?

May be this helps:

--------------------------------------------
|    ----------------------                            |                From
the code of the MyPanel (extending Panel) I can reach the
|    |                                |                            |
TabbedPane by this.getParent()
|    |        MyPanel          |    TabbedPane     |
|    |                                |                            |
|    ----------------------                            |
--------------------------------------------


----------------------------------------------------------------------------
--------------------------------
|    -----------------------------------------------------------------------
--------------                             |
|    |    ------------------------------------------------------------------ 
|                            |
|    |    |    ----------------------------------------- 
|                        |                            |            How do I
reach the TabbedPane
|    |    |    |
|                                |                        |
|            from the javascript (ECMAScript)
|    |    |    |     Javascript in SVGDocument            |    MyJSVGCanvas
|     MyPanel     |    TabbedPane     |            code?
|    |    |    |
|                                |                        |
|            I need to give the method I call
|    |    |    ----------------------------------------- 
|                        |                            |            a
parameter from javascript.
|    |    ------------------------------------------------------------------ 
|                            |
|    -----------------------------------------------------------------------
---------------                            |
----------------------------------------------------------------------------
--------------------------------

Thank you all.



----- Original Message ----- 
From: "Cameron McCormack" <cam-batik-users@aka.mcc.id.au>
To: <batik-users@xml.apache.org>
Sent: Tuesday, June 15, 2004 3:00 PM
Subject: Re: Calling java methods from ECMASCRIPT (not solved at the list)


> 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
>
> -- 
> 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
>


---------------------------------------------------------------------
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