You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Gorka Garay <go...@sistemasjudo.com> on 2004/06/16 16:17:39 UTC

Re: Calling java methods from ECMASCRIPT (not solved at the list) (SOLVED!!!)

Hi,

It worked!

I added an static field to MyJSVCanvas which I reference to "this" at the
constructor so I can statically access that static field and call non-static
methods through it.

Thanks a lot Cameron.

I guess it won´t happen frequently, but I´ll try to help you all as you have
helped me.

You´re really great.


----- Original Message ----- 
From: "Gorka Garay" <go...@sistemasjudo.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, June 16, 2004 10:24 AM
Subject: Re: Calling java methods from ECMASCRIPT (not solved at the list)


> Ok, I think I see what you mean.
>
> Thanks a lot, I will try and tell you the results.
>
>
>
>
> ----- Original Message ----- 
> From: "Cameron McCormack" <ca...@aka.mcc.id.au>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, June 16, 2004 12:41 AM
> Subject: Re: Calling java methods from ECMASCRIPT (not solved at the list)
>
>
> > Gorka Garay:
> > > 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 : (
> >
> > But you just need to call the non-static method on the reference that
> > you return to JavaScript.  One way of doing it would be to add a static
> > method to your MyJSVGCanvas class and have it pass in the current SVG
> > document as an argument.  Your MyJSVGCanvas could keep a track of the
> > MyJSVGCanvas instances that have been created so that it can then call
> > getSVGDocument on each one to find out which MyJSVGCanvas contains the
> > current document.  You can then return that object to the JavaScript,
> > which can call the non-static methods on it.
> >
> > Hope this helps,
> >
> > 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
>


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