List Info

Thread: Re: invoke ECMAScript-Function




Re: invoke ECMAScript-Function
country flaguser name
Germany
2007-05-10 11:22:13
Hello Thomas,

thanks for the hint.
But how do I lay my hands on the  BridgeContext? Or may I
not use
JSVGCanvas or JSVGComponent if I intend to use the Bridge?
All fields
and methods that seem helpful to access the BridgeContext I
found
protected (as createBridgeContext, userAgent or
documentLoader).
Is there another way?
TIA,

     Robert

> Hi Robert,
> 
> Robert Lummert <robertlummert.net> wrote on
05/09/2007 01:57:28 PM:
> 
>> How can I invoke the execution of an ECMA-Script
Function from within a
>> Java method? My JSVGCanvas loads correctly an
SVG-Document, executing
>> all scripts and functions on their respective
internal events. I have an
>> update function there, that I would like to run
after setting some data
>> from outside, as well. Any idea?
> 
>    Get a reference to the script Interpreter from the
BridgeContext;
> Interpreter interp =
getInterpreter("application/javascript");
> interp.evaluate(yourEcmaScriptCodeStringHere);
> 
>    If you need to reference Java Objects you might also
use:
> interp.bindObject(ecmaScriptVarName, javaObject);
> 
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
> For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org
> 
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org


Re: invoke ECMAScript-Function
user name
2007-05-10 10:29:38
Hi Robert,

Robert Lummert <robertlummert.net> wrote on
05/10/2007 12:22:13 PM:

> thanks for the hint.
> But how do I lay my hands on the  BridgeContext?

   Get it from the UpdateManager.

 Or may I not use
> JSVGCanvas or JSVGComponent if I intend to use the
Bridge? All fields
> and methods that seem helpful to access the
BridgeContext I found
> protected (as createBridgeContext, userAgent or
documentLoader).
> Is there another way?
> TIA,
> 
>      Robert
> 
> > Hi Robert,
> > 
> > Robert Lummert <robertlummert.net> wrote on
05/09/2007 01:57:28 PM:
> > 
> >> How can I invoke the execution of an
ECMA-Script Function from within 
a
> >> Java method? My JSVGCanvas loads correctly an
SVG-Document, executing
> >> all scripts and functions on their respective
internal events. I have 
an
> >> update function there, that I would like to
run after setting some 
data
> >> from outside, as well. Any idea?
> > 
> >    Get a reference to the script Interpreter from
the BridgeContext;
> > Interpreter interp =
getInterpreter("application/javascript");
> > interp.evaluate(yourEcmaScriptCodeStringHere);
> > 
> >    If you need to reference Java Objects you might
also use:
> > interp.bindObject(ecmaScriptVarName, javaObject);
> > 
> > 
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail:
batik-users-unsubscribexmlgraphics.apache.org
> > For additional commands, e-mail: 
batik-users-helpxmlgraphics.apache.org
> > 
> > 
> 
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
> For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org
> 


------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribexmlgraphics.apache.org
For additional commands, e-mail: batik-users-helpxmlgraphics.apache.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )