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 Denis Bohm <de...@fireflydesign.com> on 2003/10/01 04:59:33 UTC

Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

I'm having a problem reloading a document.  The first time I try to reload I
just get a blank page, on the second try to reload it seems to work.  But
sometimes on the second reload I get:

java.lang.IllegalStateException: RunnableQueue not started or has exited
        at
org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
        at
com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)

and things don't function anymore.

I assume that I need to shut somethings down before changing the document?
Is that what you are referring to when you say "don't load new SVG documents
until pending DOM updates"?

Thanks,
  Denis

----- Original Message ----- 
From: "George Armhold" <ar...@cs.rutgers.edu>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Monday, September 29, 2003 12:29 PM
Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue


> Sorry for the late reply to this thread; I was travelling when your
> reply came in.
>
> Thomas DeWeese wrote:
>
>  >> So now my question is: how can I know when it's safe to call
>  >>    UpdateManager um = getUpdateManager();
>  >>    RunnableQueue rq = um.getUpdateRunnableQueue();
>  >>
>  >> and add things to the RunnableQueue?
>  >
>  >
>  >   It is safe after the first GVT rendering completes.  This is
>  > _before_ the managerStarted call back, so this shouldn't be the
>  > problem.  You should have enough instrumentation in your code now to
>  > figure out what the sequence of events is that leads to the Null
>  > UpdateManager is.
>
> Indeed, thanks to your help.  It seems there were two key issues in my
> code:
>
> - make sure sure UpdateManager is available (wait until
>    gvtRenderingCompleted event) before starting DOM updates.
>
> - don't load new SVG documents until pending DOM updates
>    (UpdateManager's RunnableQueue) to the currently loaded doc have
>    completed.
>
>
> Although I need to complete more testing, I have not seen any more
> crashes since applying these two fixes.  Thanks!
>
>
> --
> George Armhold
> Rutgers University
> eLearning Grant, DCIS
>
>
>
> ---------------------------------------------------------------------
> 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


Re: Batik Plugin?

Posted by Vincent Hardy <Vi...@Sun.COM>.

Thomas DeWeese wrote:

> Denis Bohm wrote:
>
>> Can Batik be run as an Internet Explorer Plugin?  In the same way as the
>> Adobe SVG Viewer?
>
>
>   Not that I am aware of.  Some people have played with using Batik
> as an applet.  You can also start it from a web page using Java Web 
> Start,
> but AFAIK you can't use java to handle a particular mime type in IE,
> apparently this _is_ possible in Mozilla (I think they were/are called
> pluglets) this was done for a _very_ early version of Batik but I
> don't know where that code is (I don't think it was ever actually
> contributed- and it probably wouldn't be all that useful at this point). 


Thomas,

Your recollection is correct: we did a proof of concept using a Mozilla 
project called Blackwood. This was over two years ago. See:

http://www.mozilla.org/projects/blackwood/overview.html

Vincent.



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


Re: Batik Plugin?

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

> Can Batik be run as an Internet Explorer Plugin?  In the same way as the
> Adobe SVG Viewer?

   Not that I am aware of.  Some people have played with using Batik
as an applet.  You can also start it from a web page using Java Web Start,
but AFAIK you can't use java to handle a particular mime type in IE,
apparently this _is_ possible in Mozilla (I think they were/are called
pluglets) this was done for a _very_ early version of Batik but I
don't know where that code is (I don't think it was ever actually
contributed- and it probably wouldn't be all that useful at this point).





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


Batik Plugin?

Posted by Denis Bohm <de...@fireflydesign.com>.
Can Batik be run as an Internet Explorer Plugin?  In the same way as the
Adobe SVG Viewer?


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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Denis Bohm <de...@fireflydesign.com>.
That did it!  Thanks!

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 11:34 AM
Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue


> Denis Bohm wrote:
>
> > I shut down my animation timer and I no longer see the exception.  I
still
> > have to reload twice to get the document to appear.  I'm doing:
> >
> > animationTimer_.shutdown(); // and waits for thread to stop
> > canvas_.setSVGDocument(null);
> > // create a new document
> > canvas_.setSVGDocument(newDocument);
> >
> > Do you see any problem with that?
>
>    Yes (and this is something I've been meaning to fix but haven't).
> When you call setSVGDocument(null), it start the processes of 'shutting
down'
> the current document (canceling repaints, stopping scripts etc),  Since
> this could take a while I call a number of quick methods to tell
everything
> to shut down and register a number of event listeners and just return.
>
>    When the event listeners are called (because the document is shut down)
> I call 'install document' with the document to be installed.
>
>     The above code will in most cases register these listeners twice -
once for
> the 'install' of the null document, once for the install of 'newDocument'.
This
> probably isn't fatal but as you seem to have discovered don't have a
strong notion
> of which document (null or new) will in the end be installed.
>
>     I would suggest skipping the setSVGDocument(null).
>
>     Now that this is likely a 'real problem' as opposed to a theoretical
one I
> will bump the priority on fixing this issue.
>
> >
> > Thanks,
> >   Denis
> >
> > ----- Original Message ----- 
> > From: "Thomas DeWeese" <Th...@Kodak.com>
> > To: "Batik Users" <ba...@xml.apache.org>
> > Sent: Wednesday, October 01, 2003 11:01 AM
> > Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
issue
> >
> >
> >
> >>Denis Bohm wrote:
> >>
> >>
> >>>Hi Thomas,
> >>>
> >>>My animation timer doesn't cache anything (including the runnable
> >
> > queue) -
> >
> >>>it get's it from the canvas each time an animation is activated.  So it
> >>>appears that during a reload a canvas can have a runnable queue still
> >>>around - but one that has exited?  I don't think I understand which
> >
> > canvas
> >
> >>>objects are shutdown, recreated, etc and the timing of all that.  I'll
> >
> > take
> >
> >>>a look at the Batik source in those areas...
> >>
> >>    Yes during document loading there is a time where the UpdateManager
> >
> > from
> >
> >>the previous document is still available but shut down, and the
> >
> > UpdateManager
> >
> >>from the new document has yet to be installed.
> >>
> >>    The UpdateManager does have a 'isRunning()' member, however I would
> >
> > strongly
> >
> >>suggest shutting down your animation engine while a document is being
> >
> > loaded.
> >
> >> From the time you call setDocument/URI to the completion of the first
GVT
> >
> > rendering
> >
> >>you should really just leave the canvas alone! :)
> >>
> >>
> >>>Thanks,
> >>>  Denis
> >>>
> >>>----- Original Message ----- 
> >>>From: "Thomas DeWeese" <Th...@Kodak.com>
> >>>To: "Batik Users" <ba...@xml.apache.org>
> >>>Sent: Wednesday, October 01, 2003 2:38 AM
> >>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
> >
> > issue
> >
> >>>
> >>>
> >>>>Hi Denis.
> >>>>
> >>>>   It looks to me like you need to shut down your
> >>>>SVGStage.AnimationTimer before you 'unload' the current
> >>>>document (or load a new document). Since this class appears
> >>>>to be 'outside' of Batik there is no way for us to shut it
> >>>>down for you.
> >>>>
> >>>>   If it is really on a Java Timer I believe you can cancel
> >>>>them.
> >>>>
> >>>>Denis Bohm wrote:
> >>>>
> >>>>
> >>>>
> >>>>>I'm having a problem reloading a document.  The first time I try to
> >>>
> >>>reload I
> >>>
> >>>
> >>>>>just get a blank page, on the second try to reload it seems to work.
> >>>
> >>>But
> >>>
> >>>
> >>>>>sometimes on the second reload I get:
> >>>>>
> >>>>>java.lang.IllegalStateException: RunnableQueue not started or has
> >
> > exited
> >
> >>>>>       at
> >>>>>
> >>>
> >>>
> >
org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
> >
> >>>>>       at
> >>>>>com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
> >>>>>
> >>>>>and things don't function anymore.
> >>>>>
> >>>>>I assume that I need to shut somethings down before changing the
> >>>
> >>>document?
> >>>
> >>>
> >>>>>Is that what you are referring to when you say "don't load new SVG
> >>>
> >>>documents
> >>>
> >>>
> >>>>>until pending DOM updates"?
> >>>>>
> >>>>>Thanks,
> >>>>> Denis
> >>>>>
> >>>>>----- Original Message ----- 
> >>>>>From: "George Armhold" <ar...@cs.rutgers.edu>
> >>>>>To: "Batik Users" <ba...@xml.apache.org>
> >>>>>Sent: Monday, September 29, 2003 12:29 PM
> >>>>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait
threading
> >>>
> >>>issue
> >>>
> >>>
> >>>>>
> >>>>>>Sorry for the late reply to this thread; I was travelling when your
> >>>>>>reply came in.
> >>>>>>
> >>>>>>Thomas DeWeese wrote:
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>>>So now my question is: how can I know when it's safe to call
> >>>>>>>>  UpdateManager um = getUpdateManager();
> >>>>>>>>  RunnableQueue rq = um.getUpdateRunnableQueue();
> >>>>>>>>
> >>>>>>>>and add things to the RunnableQueue?
> >>>>>>>
> >>>>>>>
> >>>>>>> It is safe after the first GVT rendering completes.  This is
> >>>>>>>_before_ the managerStarted call back, so this shouldn't be the
> >>>>>>>problem.  You should have enough instrumentation in your code now
to
> >>>>>>>figure out what the sequence of events is that leads to the Null
> >>>>>>>UpdateManager is.
> >>>>>>
> >>>>>>Indeed, thanks to your help.  It seems there were two key issues in
my
> >>>>>>code:
> >>>>>>
> >>>>>>- make sure sure UpdateManager is available (wait until
> >>>>>> gvtRenderingCompleted event) before starting DOM updates.
> >>>>>>
> >>>>>>- don't load new SVG documents until pending DOM updates
> >>>>>> (UpdateManager's RunnableQueue) to the currently loaded doc have
> >>>>>> completed.
> >>>>>>
> >>>>>>
> >>>>>>Although I need to complete more testing, I have not seen any more
> >>>>>>crashes since applying these two fixes.  Thanks!
> >>>>>>
> >>>>>>
> >>>>>>--
> >>>>>>George Armhold
> >>>>>>Rutgers University
> >>>>>>eLearning Grant, DCIS
> >>>>>>
> >>>>>>
> >>>>>>
>
>>>>>>---------------------------------------------------------------------
> >>>>>>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
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>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
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> 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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

> I shut down my animation timer and I no longer see the exception.  I still
> have to reload twice to get the document to appear.  I'm doing:
> 
> animationTimer_.shutdown(); // and waits for thread to stop
> canvas_.setSVGDocument(null);
> // create a new document
> canvas_.setSVGDocument(newDocument);
> 
> Do you see any problem with that?

   Yes (and this is something I've been meaning to fix but haven't).
When you call setSVGDocument(null), it start the processes of 'shutting down'
the current document (canceling repaints, stopping scripts etc),  Since
this could take a while I call a number of quick methods to tell everything
to shut down and register a number of event listeners and just return.

   When the event listeners are called (because the document is shut down)
I call 'install document' with the document to be installed.

    The above code will in most cases register these listeners twice - once for
the 'install' of the null document, once for the install of 'newDocument'.  This
probably isn't fatal but as you seem to have discovered don't have a strong notion
of which document (null or new) will in the end be installed.

    I would suggest skipping the setSVGDocument(null).

    Now that this is likely a 'real problem' as opposed to a theoretical one I
will bump the priority on fixing this issue.

> 
> Thanks,
>   Denis
> 
> ----- Original Message ----- 
> From: "Thomas DeWeese" <Th...@Kodak.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, October 01, 2003 11:01 AM
> Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue
> 
> 
> 
>>Denis Bohm wrote:
>>
>>
>>>Hi Thomas,
>>>
>>>My animation timer doesn't cache anything (including the runnable
> 
> queue) -
> 
>>>it get's it from the canvas each time an animation is activated.  So it
>>>appears that during a reload a canvas can have a runnable queue still
>>>around - but one that has exited?  I don't think I understand which
> 
> canvas
> 
>>>objects are shutdown, recreated, etc and the timing of all that.  I'll
> 
> take
> 
>>>a look at the Batik source in those areas...
>>
>>    Yes during document loading there is a time where the UpdateManager
> 
> from
> 
>>the previous document is still available but shut down, and the
> 
> UpdateManager
> 
>>from the new document has yet to be installed.
>>
>>    The UpdateManager does have a 'isRunning()' member, however I would
> 
> strongly
> 
>>suggest shutting down your animation engine while a document is being
> 
> loaded.
> 
>> From the time you call setDocument/URI to the completion of the first GVT
> 
> rendering
> 
>>you should really just leave the canvas alone! :)
>>
>>
>>>Thanks,
>>>  Denis
>>>
>>>----- Original Message ----- 
>>>From: "Thomas DeWeese" <Th...@Kodak.com>
>>>To: "Batik Users" <ba...@xml.apache.org>
>>>Sent: Wednesday, October 01, 2003 2:38 AM
>>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
> 
> issue
> 
>>>
>>>
>>>>Hi Denis.
>>>>
>>>>   It looks to me like you need to shut down your
>>>>SVGStage.AnimationTimer before you 'unload' the current
>>>>document (or load a new document). Since this class appears
>>>>to be 'outside' of Batik there is no way for us to shut it
>>>>down for you.
>>>>
>>>>   If it is really on a Java Timer I believe you can cancel
>>>>them.
>>>>
>>>>Denis Bohm wrote:
>>>>
>>>>
>>>>
>>>>>I'm having a problem reloading a document.  The first time I try to
>>>
>>>reload I
>>>
>>>
>>>>>just get a blank page, on the second try to reload it seems to work.
>>>
>>>But
>>>
>>>
>>>>>sometimes on the second reload I get:
>>>>>
>>>>>java.lang.IllegalStateException: RunnableQueue not started or has
> 
> exited
> 
>>>>>       at
>>>>>
>>>
>>>
> org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
> 
>>>>>       at
>>>>>com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
>>>>>
>>>>>and things don't function anymore.
>>>>>
>>>>>I assume that I need to shut somethings down before changing the
>>>
>>>document?
>>>
>>>
>>>>>Is that what you are referring to when you say "don't load new SVG
>>>
>>>documents
>>>
>>>
>>>>>until pending DOM updates"?
>>>>>
>>>>>Thanks,
>>>>> Denis
>>>>>
>>>>>----- Original Message ----- 
>>>>>From: "George Armhold" <ar...@cs.rutgers.edu>
>>>>>To: "Batik Users" <ba...@xml.apache.org>
>>>>>Sent: Monday, September 29, 2003 12:29 PM
>>>>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
>>>
>>>issue
>>>
>>>
>>>>>
>>>>>>Sorry for the late reply to this thread; I was travelling when your
>>>>>>reply came in.
>>>>>>
>>>>>>Thomas DeWeese wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>So now my question is: how can I know when it's safe to call
>>>>>>>>  UpdateManager um = getUpdateManager();
>>>>>>>>  RunnableQueue rq = um.getUpdateRunnableQueue();
>>>>>>>>
>>>>>>>>and add things to the RunnableQueue?
>>>>>>>
>>>>>>>
>>>>>>> It is safe after the first GVT rendering completes.  This is
>>>>>>>_before_ the managerStarted call back, so this shouldn't be the
>>>>>>>problem.  You should have enough instrumentation in your code now to
>>>>>>>figure out what the sequence of events is that leads to the Null
>>>>>>>UpdateManager is.
>>>>>>
>>>>>>Indeed, thanks to your help.  It seems there were two key issues in my
>>>>>>code:
>>>>>>
>>>>>>- make sure sure UpdateManager is available (wait until
>>>>>> gvtRenderingCompleted event) before starting DOM updates.
>>>>>>
>>>>>>- don't load new SVG documents until pending DOM updates
>>>>>> (UpdateManager's RunnableQueue) to the currently loaded doc have
>>>>>> completed.
>>>>>>
>>>>>>
>>>>>>Although I need to complete more testing, I have not seen any more
>>>>>>crashes since applying these two fixes.  Thanks!
>>>>>>
>>>>>>
>>>>>>--
>>>>>>George Armhold
>>>>>>Rutgers University
>>>>>>eLearning Grant, DCIS
>>>>>>
>>>>>>
>>>>>>
>>>>>>---------------------------------------------------------------------
>>>>>>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
>>>>
>>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>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
> 
> 




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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Denis Bohm <de...@fireflydesign.com>.
Hi Thomas,

I shut down my animation timer and I no longer see the exception.  I still
have to reload twice to get the document to appear.  I'm doing:

animationTimer_.shutdown(); // and waits for thread to stop
canvas_.setSVGDocument(null);
// create a new document
canvas_.setSVGDocument(newDocument);

Do you see any problem with that?

Thanks,
  Denis

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 11:01 AM
Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue


> Denis Bohm wrote:
>
> > Hi Thomas,
> >
> > My animation timer doesn't cache anything (including the runnable
queue) -
> > it get's it from the canvas each time an animation is activated.  So it
> > appears that during a reload a canvas can have a runnable queue still
> > around - but one that has exited?  I don't think I understand which
canvas
> > objects are shutdown, recreated, etc and the timing of all that.  I'll
take
> > a look at the Batik source in those areas...
>
>     Yes during document loading there is a time where the UpdateManager
from
> the previous document is still available but shut down, and the
UpdateManager
> from the new document has yet to be installed.
>
>     The UpdateManager does have a 'isRunning()' member, however I would
strongly
> suggest shutting down your animation engine while a document is being
loaded.
>  From the time you call setDocument/URI to the completion of the first GVT
rendering
> you should really just leave the canvas alone! :)
>
> >
> > Thanks,
> >   Denis
> >
> > ----- Original Message ----- 
> > From: "Thomas DeWeese" <Th...@Kodak.com>
> > To: "Batik Users" <ba...@xml.apache.org>
> > Sent: Wednesday, October 01, 2003 2:38 AM
> > Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
issue
> >
> >
> >
> >>Hi Denis.
> >>
> >>    It looks to me like you need to shut down your
> >>SVGStage.AnimationTimer before you 'unload' the current
> >>document (or load a new document). Since this class appears
> >>to be 'outside' of Batik there is no way for us to shut it
> >>down for you.
> >>
> >>    If it is really on a Java Timer I believe you can cancel
> >>them.
> >>
> >>Denis Bohm wrote:
> >>
> >>
> >>>I'm having a problem reloading a document.  The first time I try to
> >
> > reload I
> >
> >>>just get a blank page, on the second try to reload it seems to work.
> >
> > But
> >
> >>>sometimes on the second reload I get:
> >>>
> >>>java.lang.IllegalStateException: RunnableQueue not started or has
exited
> >>>        at
> >>>
> >
> >
org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
> >
> >>>        at
> >>>com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
> >>>
> >>>and things don't function anymore.
> >>>
> >>>I assume that I need to shut somethings down before changing the
> >
> > document?
> >
> >>>Is that what you are referring to when you say "don't load new SVG
> >
> > documents
> >
> >>>until pending DOM updates"?
> >>>
> >>>Thanks,
> >>>  Denis
> >>>
> >>>----- Original Message ----- 
> >>>From: "George Armhold" <ar...@cs.rutgers.edu>
> >>>To: "Batik Users" <ba...@xml.apache.org>
> >>>Sent: Monday, September 29, 2003 12:29 PM
> >>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
> >
> > issue
> >
> >>>
> >>>
> >>>>Sorry for the late reply to this thread; I was travelling when your
> >>>>reply came in.
> >>>>
> >>>>Thomas DeWeese wrote:
> >>>>
> >>>>
> >>>>>>So now my question is: how can I know when it's safe to call
> >>>>>>   UpdateManager um = getUpdateManager();
> >>>>>>   RunnableQueue rq = um.getUpdateRunnableQueue();
> >>>>>>
> >>>>>>and add things to the RunnableQueue?
> >>>>>
> >>>>>
> >>>>>  It is safe after the first GVT rendering completes.  This is
> >>>>>_before_ the managerStarted call back, so this shouldn't be the
> >>>>>problem.  You should have enough instrumentation in your code now to
> >>>>>figure out what the sequence of events is that leads to the Null
> >>>>>UpdateManager is.
> >>>>
> >>>>Indeed, thanks to your help.  It seems there were two key issues in my
> >>>>code:
> >>>>
> >>>>- make sure sure UpdateManager is available (wait until
> >>>>  gvtRenderingCompleted event) before starting DOM updates.
> >>>>
> >>>>- don't load new SVG documents until pending DOM updates
> >>>>  (UpdateManager's RunnableQueue) to the currently loaded doc have
> >>>>  completed.
> >>>>
> >>>>
> >>>>Although I need to complete more testing, I have not seen any more
> >>>>crashes since applying these two fixes.  Thanks!
> >>>>
> >>>>
> >>>>--
> >>>>George Armhold
> >>>>Rutgers University
> >>>>eLearning Grant, DCIS
> >>>>
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>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
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

> Hi Thomas,
> 
> My animation timer doesn't cache anything (including the runnable queue) -
> it get's it from the canvas each time an animation is activated.  So it
> appears that during a reload a canvas can have a runnable queue still
> around - but one that has exited?  I don't think I understand which canvas
> objects are shutdown, recreated, etc and the timing of all that.  I'll take
> a look at the Batik source in those areas...

    Yes during document loading there is a time where the UpdateManager from
the previous document is still available but shut down, and the UpdateManager
from the new document has yet to be installed.

    The UpdateManager does have a 'isRunning()' member, however I would strongly
suggest shutting down your animation engine while a document is being loaded.
 From the time you call setDocument/URI to the completion of the first GVT rendering
you should really just leave the canvas alone! :)

> 
> Thanks,
>   Denis
> 
> ----- Original Message ----- 
> From: "Thomas DeWeese" <Th...@Kodak.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, October 01, 2003 2:38 AM
> Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue
> 
> 
> 
>>Hi Denis.
>>
>>    It looks to me like you need to shut down your
>>SVGStage.AnimationTimer before you 'unload' the current
>>document (or load a new document). Since this class appears
>>to be 'outside' of Batik there is no way for us to shut it
>>down for you.
>>
>>    If it is really on a Java Timer I believe you can cancel
>>them.
>>
>>Denis Bohm wrote:
>>
>>
>>>I'm having a problem reloading a document.  The first time I try to
> 
> reload I
> 
>>>just get a blank page, on the second try to reload it seems to work.
> 
> But
> 
>>>sometimes on the second reload I get:
>>>
>>>java.lang.IllegalStateException: RunnableQueue not started or has exited
>>>        at
>>>
> 
> org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
> 
>>>        at
>>>com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
>>>
>>>and things don't function anymore.
>>>
>>>I assume that I need to shut somethings down before changing the
> 
> document?
> 
>>>Is that what you are referring to when you say "don't load new SVG
> 
> documents
> 
>>>until pending DOM updates"?
>>>
>>>Thanks,
>>>  Denis
>>>
>>>----- Original Message ----- 
>>>From: "George Armhold" <ar...@cs.rutgers.edu>
>>>To: "Batik Users" <ba...@xml.apache.org>
>>>Sent: Monday, September 29, 2003 12:29 PM
>>>Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
> 
> issue
> 
>>>
>>>
>>>>Sorry for the late reply to this thread; I was travelling when your
>>>>reply came in.
>>>>
>>>>Thomas DeWeese wrote:
>>>>
>>>>
>>>>>>So now my question is: how can I know when it's safe to call
>>>>>>   UpdateManager um = getUpdateManager();
>>>>>>   RunnableQueue rq = um.getUpdateRunnableQueue();
>>>>>>
>>>>>>and add things to the RunnableQueue?
>>>>>
>>>>>
>>>>>  It is safe after the first GVT rendering completes.  This is
>>>>>_before_ the managerStarted call back, so this shouldn't be the
>>>>>problem.  You should have enough instrumentation in your code now to
>>>>>figure out what the sequence of events is that leads to the Null
>>>>>UpdateManager is.
>>>>
>>>>Indeed, thanks to your help.  It seems there were two key issues in my
>>>>code:
>>>>
>>>>- make sure sure UpdateManager is available (wait until
>>>>  gvtRenderingCompleted event) before starting DOM updates.
>>>>
>>>>- don't load new SVG documents until pending DOM updates
>>>>  (UpdateManager's RunnableQueue) to the currently loaded doc have
>>>>  completed.
>>>>
>>>>
>>>>Although I need to complete more testing, I have not seen any more
>>>>crashes since applying these two fixes.  Thanks!
>>>>
>>>>
>>>>--
>>>>George Armhold
>>>>Rutgers University
>>>>eLearning Grant, DCIS
>>>>
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Denis Bohm <de...@fireflydesign.com>.
Hi Thomas,

My animation timer doesn't cache anything (including the runnable queue) -
it get's it from the canvas each time an animation is activated.  So it
appears that during a reload a canvas can have a runnable queue still
around - but one that has exited?  I don't think I understand which canvas
objects are shutdown, recreated, etc and the timing of all that.  I'll take
a look at the Batik source in those areas...

Thanks,
  Denis

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 2:38 AM
Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue


> Hi Denis.
>
>     It looks to me like you need to shut down your
> SVGStage.AnimationTimer before you 'unload' the current
> document (or load a new document). Since this class appears
> to be 'outside' of Batik there is no way for us to shut it
> down for you.
>
>     If it is really on a Java Timer I believe you can cancel
> them.
>
> Denis Bohm wrote:
>
> > I'm having a problem reloading a document.  The first time I try to
reload I
> > just get a blank page, on the second try to reload it seems to work.
But
> > sometimes on the second reload I get:
> >
> > java.lang.IllegalStateException: RunnableQueue not started or has exited
> >         at
> >
org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
> >         at
> > com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
> >
> > and things don't function anymore.
> >
> > I assume that I need to shut somethings down before changing the
document?
> > Is that what you are referring to when you say "don't load new SVG
documents
> > until pending DOM updates"?
> >
> > Thanks,
> >   Denis
> >
> > ----- Original Message ----- 
> > From: "George Armhold" <ar...@cs.rutgers.edu>
> > To: "Batik Users" <ba...@xml.apache.org>
> > Sent: Monday, September 29, 2003 12:29 PM
> > Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading
issue
> >
> >
> >
> >>Sorry for the late reply to this thread; I was travelling when your
> >>reply came in.
> >>
> >>Thomas DeWeese wrote:
> >>
> >> >> So now my question is: how can I know when it's safe to call
> >> >>    UpdateManager um = getUpdateManager();
> >> >>    RunnableQueue rq = um.getUpdateRunnableQueue();
> >> >>
> >> >> and add things to the RunnableQueue?
> >> >
> >> >
> >> >   It is safe after the first GVT rendering completes.  This is
> >> > _before_ the managerStarted call back, so this shouldn't be the
> >> > problem.  You should have enough instrumentation in your code now to
> >> > figure out what the sequence of events is that leads to the Null
> >> > UpdateManager is.
> >>
> >>Indeed, thanks to your help.  It seems there were two key issues in my
> >>code:
> >>
> >>- make sure sure UpdateManager is available (wait until
> >>   gvtRenderingCompleted event) before starting DOM updates.
> >>
> >>- don't load new SVG documents until pending DOM updates
> >>   (UpdateManager's RunnableQueue) to the currently loaded doc have
> >>   completed.
> >>
> >>
> >>Although I need to complete more testing, I have not seen any more
> >>crashes since applying these two fixes.  Thanks!
> >>
> >>
> >>--
> >>George Armhold
> >>Rutgers University
> >>eLearning Grant, DCIS
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
>
>


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


Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Denis.

    It looks to me like you need to shut down your
SVGStage.AnimationTimer before you 'unload' the current
document (or load a new document). Since this class appears
to be 'outside' of Batik there is no way for us to shut it
down for you.

    If it is really on a Java Timer I believe you can cancel
them.

Denis Bohm wrote:

> I'm having a problem reloading a document.  The first time I try to reload I
> just get a blank page, on the second try to reload it seems to work.  But
> sometimes on the second reload I get:
> 
> java.lang.IllegalStateException: RunnableQueue not started or has exited
>         at
> org.apache.batik.util.RunnableQueue.invokeAndWait(RunnableQueue.java:257)
>         at
> com.fireflydesign.svg.SVGStage$AnimationTimer.run(SVGStage.java:639)
> 
> and things don't function anymore.
> 
> I assume that I need to shut somethings down before changing the document?
> Is that what you are referring to when you say "don't load new SVG documents
> until pending DOM updates"?
> 
> Thanks,
>   Denis
> 
> ----- Original Message ----- 
> From: "George Armhold" <ar...@cs.rutgers.edu>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Monday, September 29, 2003 12:29 PM
> Subject: Re: JSVGComponent dynamic DOM update, invokeAndWait threading issue
> 
> 
> 
>>Sorry for the late reply to this thread; I was travelling when your
>>reply came in.
>>
>>Thomas DeWeese wrote:
>>
>> >> So now my question is: how can I know when it's safe to call
>> >>    UpdateManager um = getUpdateManager();
>> >>    RunnableQueue rq = um.getUpdateRunnableQueue();
>> >>
>> >> and add things to the RunnableQueue?
>> >
>> >
>> >   It is safe after the first GVT rendering completes.  This is
>> > _before_ the managerStarted call back, so this shouldn't be the
>> > problem.  You should have enough instrumentation in your code now to
>> > figure out what the sequence of events is that leads to the Null
>> > UpdateManager is.
>>
>>Indeed, thanks to your help.  It seems there were two key issues in my
>>code:
>>
>>- make sure sure UpdateManager is available (wait until
>>   gvtRenderingCompleted event) before starting DOM updates.
>>
>>- don't load new SVG documents until pending DOM updates
>>   (UpdateManager's RunnableQueue) to the currently loaded doc have
>>   completed.
>>
>>
>>Although I need to complete more testing, I have not seen any more
>>crashes since applying these two fixes.  Thanks!
>>
>>
>>--
>>George Armhold
>>Rutgers University
>>eLearning Grant, DCIS
>>
>>
>>
>>---------------------------------------------------------------------
>>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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
Looks like my other problem was using "onload" rather than "SVGLoad".
Confusing since "onload" seemed to work from JavaScript...

So I'm running now.

----- Original Message ----- 
From: "Denis Bohm" <de...@fireflydesign.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 2:22 PM
Subject: Re: Scripting with Java Error


> I think the problem was that there was trailing whie space after the class
> name.  I removed that and now the Java class is loaded.
>
> However, the onload event listener doesn't seem to be getting called...
>
> ----- Original Message ----- 
> From: "Denis Bohm" <de...@fireflydesign.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Tuesday, September 30, 2003 9:25 PM
> Subject: Scripting with Java Error
>
>
> > I'm trying to script using Java according to the SVG 1.1 specification:
> >
> > http://www.w3.org/TR/SVG11/java.html
> >
> > But when I try to load my demo.svg file into Squiggle I get:
> >
> > "SVG Error: com.fireflydesign.svg.SVGHandler
> >
> > java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> > ..."
> >
> > I checked the archive and it seems to contain the handler class.  Anyone
> > have any idea why the class can't be found?
> >
> > Thanks,
> >   Denis
> >
> >
> > Here is my SVG (demo.svg):
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> > ]>
> > <svg width="600" height="800" viewBox="0 0 600 800"
> >     xmlns:xlink="http://www.w3.org/1999/xlink">
> >     <script type="application/java-archive" xlink:href="demo.jar"/>
> >     <text x="10" y="20" fill="black">Hello</text>
> > </svg>
> >
> > Here is my manifest:
> >
> > Manifest-Version: 1.0
> > SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> >
> >
> > And my Java source:
> >
> > package com.fireflydesign.svg;
> >
> > import org.w3c.dom.events.Event;
> > import org.w3c.dom.events.EventListener;
> >
> > import org.w3c.dom.svg.EventListenerInitializer;
> > import org.w3c.dom.svg.SVGDocument;
> > import org.w3c.dom.svg.SVGSVGElement;
> >
> > public class SVGHandler implements EventListenerInitializer {
> >
> >     public SVGHandler() {
> >     }
> >
> >     public void initializeEventListeners(SVGDocument document) {
> >         SVGSVGElement root = document.getRootElement();
> >         EventListener listener = new EventListener() {
> >             public void handleEvent(Event event) {
> >                 System.out.println("onload");
> >             }
> >         };
> >         root.addEventListener("onload", listener, false);
> >     }
> >
> > }
> >
> >
>
>
> --------------------------------------------------------------------------
--
> ----
>
>
> > ---------------------------------------------------------------------
> > 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


Re: SVG & Batik - RunnableQueue

Posted by Christophe Jolif <cj...@ilog.fr>.

Thomas DeWeese wrote:

>>>   Well the Window object we provide has a method 'getBridgeContext' and
>>> the BridgeContext can provide you with the UpdateManager (if there is 
>>> one).
>>
>>
>> I can't seem to find a way to get the Window from the SVGDocument in 
>> Java.
> 
> 
>   This does appear to be a hole in the current Java binding, as I had
> suggested I think this area of the specification is under review.

http://www.w3.org/TR/SVG12/#WindowObject

"A method will be added to the SVGDocument interface to enable access to the 
SVGWindow interface."

So Thomas is right, this method will be aded.

-- 
Christophe


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


Re: SVG & Batik - RunnableQueue

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

>>>I would like to sping off a thread that creates a socket connection and
>>>listens for data.  When the data arrives I would like to update the SVG DOM.
>>>To do that I need to ask the Batik canvas for the update manager and ask
>>>that for the runnable queue then queue up a runnable to do the update.
>>>However, I don't have a reference to the canvas.  Is there some way to
>>>get one from the document?
>>
>>   Well the Window object we provide has a method 'getBridgeContext' and
>>the BridgeContext can provide you with the UpdateManager (if there is one).
> 
> I can't seem to find a way to get the Window from the SVGDocument in Java.

   This does appear to be a hole in the current Java binding, as I had
suggested I think this area of the specification is under review.

   In Batik there is a method called 'getSVGContext' that you could
call on the DOM nodes this returns one of the Bridges, and they
all have a '.ctx' member that is the BridgeContext.  But this is
all _very_ non-standard (I'm also not sure if all the needed methods
and members are public).



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


Re: SVG & Batik - RunnableQueue

Posted by Denis Bohm <de...@fireflydesign.com>.
> > I have an application that I would like to implement using SVG and the
Java
> > Language Binding Scripting.  I have an SVG document and a Java
> > EventListenerInitializer that is working in Squiggle.  So far, so good.
Now
> > I would like to sping off a thread that creates a socket connection and
> > listens for data.  When the data arrives I would like to update the SVG
DOM.
> > To do that I need to ask the Batik canvas for the update manager and ask
> > that for the runnable queue then queue up a runnable to do the update.
> > However, I don't have a reference to the canvas.  Is there some way to
get
> > one from the document?
>
>    Well the Window object we provide has a method 'getBridgeContext' and
> the BridgeContext can provide you with the UpdateManager (if there is
one).

I can't seem to find a way to get the Window from the SVGDocument in Java.


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


Re: SVG & Batik - RunnableQueue

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

> I have an application that I would like to implement using SVG and the Java
> Language Binding Scripting.  I have an SVG document and a Java
> EventListenerInitializer that is working in Squiggle.  So far, so good.  Now
> I would like to sping off a thread that creates a socket connection and
> listens for data.  When the data arrives I would like to update the SVG DOM.
> To do that I need to ask the Batik canvas for the update manager and ask
> that for the runnable queue then queue up a runnable to do the update.
> However, I don't have a reference to the canvas.  Is there some way to get
> one from the document?

   Well the Window object we provide has a method 'getBridgeContext' and
the BridgeContext can provide you with the UpdateManager (if there is one).

> I would also like my code to not use any Batik implementation specific stuff
> (in the hope that other browsers will also support SVG with Java scripting).

   The above is 100% pure Batik :)

> So I took a look at the SVG 1.2 spec to see if there was some upcoming
> standard way to do this.  Section 11 talks about adding a SVGWindow
> interface with a way to create SVGTimer objects that can run a set of
> SVGRunnable objects.  So it sounds like the following:

[...]

> but it could potentially run in other implementations.  Does that sound
> right?

   This might be a route to go.  I suspect they WG is trying to
standardize on how to access the DOM in a multi-threaded environment,
so it may provide a less 'hacky' way to do this in the future.

> BTW: It looks like adding these interfaces and an implementation that just
> routes the calls the existing Batik code would be fairly straight forward.
> Is there any interest in that?

    Contributions are always welcome!

> 
> Thanks,
>   Denis
> 
> 
> ---------------------------------------------------------------------
> 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


SVG & Batik - RunnableQueue

Posted by Denis Bohm <de...@fireflydesign.com>.
I have an application that I would like to implement using SVG and the Java
Language Binding Scripting.  I have an SVG document and a Java
EventListenerInitializer that is working in Squiggle.  So far, so good.  Now
I would like to sping off a thread that creates a socket connection and
listens for data.  When the data arrives I would like to update the SVG DOM.
To do that I need to ask the Batik canvas for the update manager and ask
that for the runnable queue then queue up a runnable to do the update.
However, I don't have a reference to the canvas.  Is there some way to get
one from the document?

I would also like my code to not use any Batik implementation specific stuff
(in the hope that other browsers will also support SVG with Java scripting).
So I took a look at the SVG 1.2 spec to see if there was some upcoming
standard way to do this.  Section 11 talks about adding a SVGWindow
interface with a way to create SVGTimer objects that can run a set of
SVGRunnable objects.  So it sounds like the following:

SVGDocument document = ?:
SVGWindow window = document.getSVGWindow();
SVGTimer timer = window.createTimer(0, false);
timer.addHandler(new SVGRunnable() {
    public void run() {
    }
});
timer.start();

will have the same effect as:

SVGCanvas canvas = ?;
UpdateManager updateManager = canvas.getUpdateManager();
RunnableQueue runnableQueue = updateManager.getRunnableQueue();
runnableQueue.invokeLater(new Runnable() {
    public void run() {
    }
});

but it could potentially run in other implementations.  Does that sound
right?

BTW: It looks like adding these interfaces and an implementation that just
routes the calls the existing Batik code would be fairly straight forward.
Is there any interest in that?

Thanks,
  Denis


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


Re: Scripting with Java Error

Posted by Thomas DeWeese <Th...@Kodak.com>.
Denis Bohm wrote:

> I think the problem was that there was trailing whie space after the class
> name.  I removed that and now the Java class is loaded.

Good!

> However, the onload event listener doesn't seem to be getting called...

    Check the spec, the DOM event names are not the same as the event attributes.
'onload' == 'SVGLoad' There is a table in an appendix that lists them all.




> 
> ----- Original Message ----- 
> From: "Denis Bohm" <de...@fireflydesign.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Tuesday, September 30, 2003 9:25 PM
> Subject: Scripting with Java Error
> 
> 
> 
>>I'm trying to script using Java according to the SVG 1.1 specification:
>>
>>http://www.w3.org/TR/SVG11/java.html
>>
>>But when I try to load my demo.svg file into Squiggle I get:
>>
>>"SVG Error: com.fireflydesign.svg.SVGHandler
>>
>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
>>..."
>>
>>I checked the archive and it seems to contain the handler class.  Anyone
>>have any idea why the class can't be found?
>>
>>Thanks,
>>  Denis
>>
>>
>>Here is my SVG (demo.svg):
>>
>><?xml version="1.0" encoding="utf-8"?>
>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
>>]>
>><svg width="600" height="800" viewBox="0 0 600 800"
>>    xmlns:xlink="http://www.w3.org/1999/xlink">
>>    <script type="application/java-archive" xlink:href="demo.jar"/>
>>    <text x="10" y="20" fill="black">Hello</text>
>></svg>
>>
>>Here is my manifest:
>>
>>Manifest-Version: 1.0
>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
>>
>>
>>And my Java source:
>>
>>package com.fireflydesign.svg;
>>
>>import org.w3c.dom.events.Event;
>>import org.w3c.dom.events.EventListener;
>>
>>import org.w3c.dom.svg.EventListenerInitializer;
>>import org.w3c.dom.svg.SVGDocument;
>>import org.w3c.dom.svg.SVGSVGElement;
>>
>>public class SVGHandler implements EventListenerInitializer {
>>
>>    public SVGHandler() {
>>    }
>>
>>    public void initializeEventListeners(SVGDocument document) {
>>        SVGSVGElement root = document.getRootElement();
>>        EventListener listener = new EventListener() {
>>            public void handleEvent(Event event) {
>>                System.out.println("onload");
>>            }
>>        };
>>        root.addEventListener("onload", listener, false);
>>    }
>>
>>}
>>
>>
> 
> 
> 
> ----------------------------------------------------------------------------
> ----
> 
> 
> 
>>---------------------------------------------------------------------
>>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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
I think the problem was that there was trailing whie space after the class
name.  I removed that and now the Java class is loaded.

However, the onload event listener doesn't seem to be getting called...

----- Original Message ----- 
From: "Denis Bohm" <de...@fireflydesign.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Tuesday, September 30, 2003 9:25 PM
Subject: Scripting with Java Error


> I'm trying to script using Java according to the SVG 1.1 specification:
>
> http://www.w3.org/TR/SVG11/java.html
>
> But when I try to load my demo.svg file into Squiggle I get:
>
> "SVG Error: com.fireflydesign.svg.SVGHandler
>
> java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> ..."
>
> I checked the archive and it seems to contain the handler class.  Anyone
> have any idea why the class can't be found?
>
> Thanks,
>   Denis
>
>
> Here is my SVG (demo.svg):
>
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> ]>
> <svg width="600" height="800" viewBox="0 0 600 800"
>     xmlns:xlink="http://www.w3.org/1999/xlink">
>     <script type="application/java-archive" xlink:href="demo.jar"/>
>     <text x="10" y="20" fill="black">Hello</text>
> </svg>
>
> Here is my manifest:
>
> Manifest-Version: 1.0
> SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
>
>
> And my Java source:
>
> package com.fireflydesign.svg;
>
> import org.w3c.dom.events.Event;
> import org.w3c.dom.events.EventListener;
>
> import org.w3c.dom.svg.EventListenerInitializer;
> import org.w3c.dom.svg.SVGDocument;
> import org.w3c.dom.svg.SVGSVGElement;
>
> public class SVGHandler implements EventListenerInitializer {
>
>     public SVGHandler() {
>     }
>
>     public void initializeEventListeners(SVGDocument document) {
>         SVGSVGElement root = document.getRootElement();
>         EventListener listener = new EventListener() {
>             public void handleEvent(Event event) {
>                 System.out.println("onload");
>             }
>         };
>         root.addEventListener("onload", listener, false);
>     }
>
> }
>
>


----------------------------------------------------------------------------
----


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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
Sorry - this was due to a build problem on my part.  I have squiggle running
in the Forte debugger now.

----- Original Message ----- 
From: "Denis Bohm" <de...@fireflydesign.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 1:34 PM
Subject: Re: Scripting with Java Error


> The default with my setup is that the clases go into the sources tree, so
I
> added another check for that in setDevBase and added a new permission
entry
> for sources.  Now it gets farther and I see the error shown below.  Any
idea
> why that one is happening?
>
> java.lang.NoSuchFieldError: OPACITY
>         at
>
org.apache.batik.bridge.SVGTextElementBridge.addPaintAttributes(SVGTextEleme
> ntBridge.java:1264)
>         at
>
org.apache.batik.bridge.SVGTextElementBridge.computeLayoutedText(SVGTextElem
> entBridge.java:524)
>         at
>
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(SVGTextElemen
> tBridge.java:222)
>         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:160)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
> eElementBridge.java:209)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
> Bridge.java:118)
>         at
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
>         at
> org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
>         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:158)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
> eElementBridge.java:209)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
> Bridge.java:118)
>         at
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
>         at
> org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
>         at
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:226)
>         at
> org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
>         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:158)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
> eElementBridge.java:209)
>         at
>
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
> Bridge.java:118)
>         at
> org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
>         at
> org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
>         at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:108)
>         at
> org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:136)
>
> ----- Original Message ----- 
> From: "Thomas DeWeese" <Th...@Kodak.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, October 01, 2003 12:25 PM
> Subject: Re: Scripting with Java Error
>
>
> > Actually I think the problem may be with forte.
> > The batik security policy needs to know the root
> > of the Batik 'distribution' so it can grant appropriate
> > permissions.
> >
> > The way it does this when running from class files
> > (it does something different for jar files) is
> > it get's the URL to one of the class files and
> > looks for 'classes/org/apache/batik/...' in that path
> > it then makes the parent of 'classes' the root of the
> > distribution.
> >
> > When running in Forte it appears that either this URL is strange
> > or it doesn't include 'classes'.
> >
> >
> > Denis Bohm wrote:
> >
> > > I tried all the different settings and don't see any difference -
still
> the
> > > same error.
> > >
> > > I tried to run squiggle from Forte in the debugger, but I get:
> > >
> > > java.lang.Error
> > >         at
> > >
>
org.apache.batik.util.ApplicationSecurityEnforcer.setDevBase(ApplicationSecu
> > > rityEnforcer.java:345)
> > >         at
> > >
>
org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityManager(App
> > > licationSecurityEnforcer.java:276)
> > >         at
> > >
>
org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Applicatio
> > > nSecurityEnforcer.java:203)
> > >         at
> > > org.apache.batik.apps.svgbrowser.Main.setPreferences(Main.java:709)
> > >         at org.apache.batik.apps.svgbrowser.Main.<init>(Main.java:347)
> > >         at org.apache.batik.apps.svgbrowser.Main.main(Main.java:190)
> > > Exception in thread "main"
> > >
> > > Do I need to specify some command line args to squiggle so that it can
> be
> > > run from the debugger?
> > >
> > > ----- Original Message ----- 
> > > From: "Thomas DeWeese" <Th...@Kodak.com>
> > > To: "Batik Users" <ba...@xml.apache.org>
> > > Sent: Wednesday, October 01, 2003 10:52 AM
> > > Subject: Re: Scripting with Java Error
> > >
> > >
> > >
> > >>Hi,
> > >>
> > >>    Perhaps you have security settings set differently in Squiggle.
> > >>Preferences->Browser Options->Security Settings
> > >>
> > >>
> > >>
> > >>Denis Bohm wrote:
> > >>
> > >>
> > >>>Hi,
> > >>>
> > >>>Glad to hear that it works for someone.  I'm running out of a fresh
CVS
> > >>>checkout using 'ant squiggle'.  Still not working for me... :^(
> > >>>
> > >>>Denis
> > >>>
> > >>>----- Original Message ----- 
> > >>>From: "Christophe Jolif" <cj...@ilog.fr>
> > >>>To: "Batik Users" <ba...@xml.apache.org>
> > >>>Sent: Wednesday, October 01, 2003 2:10 AM
> > >>>Subject: Re: Scripting with Java Error
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>>Denis,
> > >>>>
> > >>>>This is working fine for me. Which version of Batik are you using?
You
> > >>>
> > >>>need at
> > >>>
> > >>>
> > >>>>least 1.5 (not a beta).
> > >>>>
> > >>>>Denis Bohm wrote:
> > >>>>
> > >>>>
> > >>>>>I'm trying to script using Java according to the SVG 1.1
> specification:
> > >>>>>
> > >>>>>http://www.w3.org/TR/SVG11/java.html
> > >>>>>
> > >>>>>But when I try to load my demo.svg file into Squiggle I get:
> > >>>>>
> > >>>>>"SVG Error: com.fireflydesign.svg.SVGHandler
> > >>>>>
> > >>>>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> > >>>>>..."
> > >>>>>
> > >>>>>I checked the archive and it seems to contain the handler class.
> > >
> > > Anyone
> > >
> > >>>>>have any idea why the class can't be found?
> > >>>>>
> > >>>>>Thanks,
> > >>>>> Denis
> > >>>>>
> > >>>>>
> > >>>>>Here is my SVG (demo.svg):
> > >>>>>
> > >>>>><?xml version="1.0" encoding="utf-8"?>
> > >>>>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> > >>>>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> > >>>>>]>
> > >>>>><svg width="600" height="800" viewBox="0 0 600 800"
> > >>>>>   xmlns:xlink="http://www.w3.org/1999/xlink">
> > >>>>>   <script type="application/java-archive" xlink:href="demo.jar"/>
> > >>>>>   <text x="10" y="20" fill="black">Hello</text>
> > >>>>></svg>
> > >>>>>
> > >>>>>Here is my manifest:
> > >>>>>
> > >>>>>Manifest-Version: 1.0
> > >>>>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> > >>>>>
> > >>>>>
> > >>>>>And my Java source:
> > >>>>>
> > >>>>>package com.fireflydesign.svg;
> > >>>>>
> > >>>>>import org.w3c.dom.events.Event;
> > >>>>>import org.w3c.dom.events.EventListener;
> > >>>>>
> > >>>>>import org.w3c.dom.svg.EventListenerInitializer;
> > >>>>>import org.w3c.dom.svg.SVGDocument;
> > >>>>>import org.w3c.dom.svg.SVGSVGElement;
> > >>>>>
> > >>>>>public class SVGHandler implements EventListenerInitializer {
> > >>>>>
> > >>>>>   public SVGHandler() {
> > >>>>>   }
> > >>>>>
> > >>>>>   public void initializeEventListeners(SVGDocument document) {
> > >>>>>       SVGSVGElement root = document.getRootElement();
> > >>>>>       EventListener listener = new EventListener() {
> > >>>>>           public void handleEvent(Event event) {
> > >>>>>               System.out.println("onload");
> > >>>>>           }
> > >>>>>       };
> > >>>>>       root.addEventListener("onload", listener, false);
> > >>>>>   }
> > >>>>>
> > >>>>>}
> > >>>>>
> > >>>>>
> > >>>>>
> > >>
> >
>
>>>>------------------------------------------------------------------------
> > >>>>
> >
>>>>>---------------------------------------------------------------------
> > >>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > >>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
> > >>>>
> > >>>>
> > >>>>-- 
> > >>>>Christophe
> > >>>>
> > >>>>
> >
>>>>---------------------------------------------------------------------
> > >>>>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
> > >>
> > >>
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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
>
>


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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
The default with my setup is that the clases go into the sources tree, so I
added another check for that in setDevBase and added a new permission entry
for sources.  Now it gets farther and I see the error shown below.  Any idea
why that one is happening?

java.lang.NoSuchFieldError: OPACITY
        at
org.apache.batik.bridge.SVGTextElementBridge.addPaintAttributes(SVGTextEleme
ntBridge.java:1264)
        at
org.apache.batik.bridge.SVGTextElementBridge.computeLayoutedText(SVGTextElem
entBridge.java:524)
        at
org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(SVGTextElemen
tBridge.java:222)
        at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:160)
        at
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
eElementBridge.java:209)
        at
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
Bridge.java:118)
        at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
        at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
        at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:158)
        at
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
eElementBridge.java:209)
        at
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
Bridge.java:118)
        at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
        at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
        at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:226)
        at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
        at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:158)
        at
org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(SVGUs
eElementBridge.java:209)
        at
org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(SVGUseElement
Bridge.java:118)
        at
org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(GVTBuilder.java:220)
        at
org.apache.batik.bridge.GVTBuilder.buildComposite(GVTBuilder.java:186)
        at org.apache.batik.bridge.GVTBuilder.build(GVTBuilder.java:108)
        at
org.apache.batik.swing.svg.GVTTreeBuilder.run(GVTTreeBuilder.java:136)

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 12:25 PM
Subject: Re: Scripting with Java Error


> Actually I think the problem may be with forte.
> The batik security policy needs to know the root
> of the Batik 'distribution' so it can grant appropriate
> permissions.
>
> The way it does this when running from class files
> (it does something different for jar files) is
> it get's the URL to one of the class files and
> looks for 'classes/org/apache/batik/...' in that path
> it then makes the parent of 'classes' the root of the
> distribution.
>
> When running in Forte it appears that either this URL is strange
> or it doesn't include 'classes'.
>
>
> Denis Bohm wrote:
>
> > I tried all the different settings and don't see any difference - still
the
> > same error.
> >
> > I tried to run squiggle from Forte in the debugger, but I get:
> >
> > java.lang.Error
> >         at
> >
org.apache.batik.util.ApplicationSecurityEnforcer.setDevBase(ApplicationSecu
> > rityEnforcer.java:345)
> >         at
> >
org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityManager(App
> > licationSecurityEnforcer.java:276)
> >         at
> >
org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Applicatio
> > nSecurityEnforcer.java:203)
> >         at
> > org.apache.batik.apps.svgbrowser.Main.setPreferences(Main.java:709)
> >         at org.apache.batik.apps.svgbrowser.Main.<init>(Main.java:347)
> >         at org.apache.batik.apps.svgbrowser.Main.main(Main.java:190)
> > Exception in thread "main"
> >
> > Do I need to specify some command line args to squiggle so that it can
be
> > run from the debugger?
> >
> > ----- Original Message ----- 
> > From: "Thomas DeWeese" <Th...@Kodak.com>
> > To: "Batik Users" <ba...@xml.apache.org>
> > Sent: Wednesday, October 01, 2003 10:52 AM
> > Subject: Re: Scripting with Java Error
> >
> >
> >
> >>Hi,
> >>
> >>    Perhaps you have security settings set differently in Squiggle.
> >>Preferences->Browser Options->Security Settings
> >>
> >>
> >>
> >>Denis Bohm wrote:
> >>
> >>
> >>>Hi,
> >>>
> >>>Glad to hear that it works for someone.  I'm running out of a fresh CVS
> >>>checkout using 'ant squiggle'.  Still not working for me... :^(
> >>>
> >>>Denis
> >>>
> >>>----- Original Message ----- 
> >>>From: "Christophe Jolif" <cj...@ilog.fr>
> >>>To: "Batik Users" <ba...@xml.apache.org>
> >>>Sent: Wednesday, October 01, 2003 2:10 AM
> >>>Subject: Re: Scripting with Java Error
> >>>
> >>>
> >>>
> >>>
> >>>>Denis,
> >>>>
> >>>>This is working fine for me. Which version of Batik are you using? You
> >>>
> >>>need at
> >>>
> >>>
> >>>>least 1.5 (not a beta).
> >>>>
> >>>>Denis Bohm wrote:
> >>>>
> >>>>
> >>>>>I'm trying to script using Java according to the SVG 1.1
specification:
> >>>>>
> >>>>>http://www.w3.org/TR/SVG11/java.html
> >>>>>
> >>>>>But when I try to load my demo.svg file into Squiggle I get:
> >>>>>
> >>>>>"SVG Error: com.fireflydesign.svg.SVGHandler
> >>>>>
> >>>>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> >>>>>..."
> >>>>>
> >>>>>I checked the archive and it seems to contain the handler class.
> >
> > Anyone
> >
> >>>>>have any idea why the class can't be found?
> >>>>>
> >>>>>Thanks,
> >>>>> Denis
> >>>>>
> >>>>>
> >>>>>Here is my SVG (demo.svg):
> >>>>>
> >>>>><?xml version="1.0" encoding="utf-8"?>
> >>>>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> >>>>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> >>>>>]>
> >>>>><svg width="600" height="800" viewBox="0 0 600 800"
> >>>>>   xmlns:xlink="http://www.w3.org/1999/xlink">
> >>>>>   <script type="application/java-archive" xlink:href="demo.jar"/>
> >>>>>   <text x="10" y="20" fill="black">Hello</text>
> >>>>></svg>
> >>>>>
> >>>>>Here is my manifest:
> >>>>>
> >>>>>Manifest-Version: 1.0
> >>>>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> >>>>>
> >>>>>
> >>>>>And my Java source:
> >>>>>
> >>>>>package com.fireflydesign.svg;
> >>>>>
> >>>>>import org.w3c.dom.events.Event;
> >>>>>import org.w3c.dom.events.EventListener;
> >>>>>
> >>>>>import org.w3c.dom.svg.EventListenerInitializer;
> >>>>>import org.w3c.dom.svg.SVGDocument;
> >>>>>import org.w3c.dom.svg.SVGSVGElement;
> >>>>>
> >>>>>public class SVGHandler implements EventListenerInitializer {
> >>>>>
> >>>>>   public SVGHandler() {
> >>>>>   }
> >>>>>
> >>>>>   public void initializeEventListeners(SVGDocument document) {
> >>>>>       SVGSVGElement root = document.getRootElement();
> >>>>>       EventListener listener = new EventListener() {
> >>>>>           public void handleEvent(Event event) {
> >>>>>               System.out.println("onload");
> >>>>>           }
> >>>>>       };
> >>>>>       root.addEventListener("onload", listener, false);
> >>>>>   }
> >>>>>
> >>>>>}
> >>>>>
> >>>>>
> >>>>>
> >>
>
>>>>------------------------------------------------------------------------
> >>>>
> >>>>>---------------------------------------------------------------------
> >>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> >>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
> >>>>
> >>>>
> >>>>-- 
> >>>>Christophe
> >>>>
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>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
> >>
> >>
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Scripting with Java Error

Posted by Thomas DeWeese <Th...@Kodak.com>.
Actually I think the problem may be with forte.
The batik security policy needs to know the root
of the Batik 'distribution' so it can grant appropriate
permissions.

The way it does this when running from class files
(it does something different for jar files) is
it get's the URL to one of the class files and
looks for 'classes/org/apache/batik/...' in that path
it then makes the parent of 'classes' the root of the
distribution.

When running in Forte it appears that either this URL is strange
or it doesn't include 'classes'.


Denis Bohm wrote:

> I tried all the different settings and don't see any difference - still the
> same error.
> 
> I tried to run squiggle from Forte in the debugger, but I get:
> 
> java.lang.Error
>         at
> org.apache.batik.util.ApplicationSecurityEnforcer.setDevBase(ApplicationSecu
> rityEnforcer.java:345)
>         at
> org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityManager(App
> licationSecurityEnforcer.java:276)
>         at
> org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Applicatio
> nSecurityEnforcer.java:203)
>         at
> org.apache.batik.apps.svgbrowser.Main.setPreferences(Main.java:709)
>         at org.apache.batik.apps.svgbrowser.Main.<init>(Main.java:347)
>         at org.apache.batik.apps.svgbrowser.Main.main(Main.java:190)
> Exception in thread "main"
> 
> Do I need to specify some command line args to squiggle so that it can be
> run from the debugger?
> 
> ----- Original Message ----- 
> From: "Thomas DeWeese" <Th...@Kodak.com>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, October 01, 2003 10:52 AM
> Subject: Re: Scripting with Java Error
> 
> 
> 
>>Hi,
>>
>>    Perhaps you have security settings set differently in Squiggle.
>>Preferences->Browser Options->Security Settings
>>
>>
>>
>>Denis Bohm wrote:
>>
>>
>>>Hi,
>>>
>>>Glad to hear that it works for someone.  I'm running out of a fresh CVS
>>>checkout using 'ant squiggle'.  Still not working for me... :^(
>>>
>>>Denis
>>>
>>>----- Original Message ----- 
>>>From: "Christophe Jolif" <cj...@ilog.fr>
>>>To: "Batik Users" <ba...@xml.apache.org>
>>>Sent: Wednesday, October 01, 2003 2:10 AM
>>>Subject: Re: Scripting with Java Error
>>>
>>>
>>>
>>>
>>>>Denis,
>>>>
>>>>This is working fine for me. Which version of Batik are you using? You
>>>
>>>need at
>>>
>>>
>>>>least 1.5 (not a beta).
>>>>
>>>>Denis Bohm wrote:
>>>>
>>>>
>>>>>I'm trying to script using Java according to the SVG 1.1 specification:
>>>>>
>>>>>http://www.w3.org/TR/SVG11/java.html
>>>>>
>>>>>But when I try to load my demo.svg file into Squiggle I get:
>>>>>
>>>>>"SVG Error: com.fireflydesign.svg.SVGHandler
>>>>>
>>>>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
>>>>>..."
>>>>>
>>>>>I checked the archive and it seems to contain the handler class.
> 
> Anyone
> 
>>>>>have any idea why the class can't be found?
>>>>>
>>>>>Thanks,
>>>>> Denis
>>>>>
>>>>>
>>>>>Here is my SVG (demo.svg):
>>>>>
>>>>><?xml version="1.0" encoding="utf-8"?>
>>>>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
>>>>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
>>>>>]>
>>>>><svg width="600" height="800" viewBox="0 0 600 800"
>>>>>   xmlns:xlink="http://www.w3.org/1999/xlink">
>>>>>   <script type="application/java-archive" xlink:href="demo.jar"/>
>>>>>   <text x="10" y="20" fill="black">Hello</text>
>>>>></svg>
>>>>>
>>>>>Here is my manifest:
>>>>>
>>>>>Manifest-Version: 1.0
>>>>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
>>>>>
>>>>>
>>>>>And my Java source:
>>>>>
>>>>>package com.fireflydesign.svg;
>>>>>
>>>>>import org.w3c.dom.events.Event;
>>>>>import org.w3c.dom.events.EventListener;
>>>>>
>>>>>import org.w3c.dom.svg.EventListenerInitializer;
>>>>>import org.w3c.dom.svg.SVGDocument;
>>>>>import org.w3c.dom.svg.SVGSVGElement;
>>>>>
>>>>>public class SVGHandler implements EventListenerInitializer {
>>>>>
>>>>>   public SVGHandler() {
>>>>>   }
>>>>>
>>>>>   public void initializeEventListeners(SVGDocument document) {
>>>>>       SVGSVGElement root = document.getRootElement();
>>>>>       EventListener listener = new EventListener() {
>>>>>           public void handleEvent(Event event) {
>>>>>               System.out.println("onload");
>>>>>           }
>>>>>       };
>>>>>       root.addEventListener("onload", listener, false);
>>>>>   }
>>>>>
>>>>>}
>>>>>
>>>>>
>>>>>
>>
>>>>------------------------------------------------------------------------
>>>>
>>>>>---------------------------------------------------------------------
>>>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>>>
>>>>
>>>>-- 
>>>>Christophe
>>>>
>>>>
>>>>---------------------------------------------------------------------
>>>>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
>>
>>
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
I tried all the different settings and don't see any difference - still the
same error.

I tried to run squiggle from Forte in the debugger, but I get:

java.lang.Error
        at
org.apache.batik.util.ApplicationSecurityEnforcer.setDevBase(ApplicationSecu
rityEnforcer.java:345)
        at
org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityManager(App
licationSecurityEnforcer.java:276)
        at
org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Applicatio
nSecurityEnforcer.java:203)
        at
org.apache.batik.apps.svgbrowser.Main.setPreferences(Main.java:709)
        at org.apache.batik.apps.svgbrowser.Main.<init>(Main.java:347)
        at org.apache.batik.apps.svgbrowser.Main.main(Main.java:190)
Exception in thread "main"

Do I need to specify some command line args to squiggle so that it can be
run from the debugger?

----- Original Message ----- 
From: "Thomas DeWeese" <Th...@Kodak.com>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 10:52 AM
Subject: Re: Scripting with Java Error


> Hi,
>
>     Perhaps you have security settings set differently in Squiggle.
> Preferences->Browser Options->Security Settings
>
>
>
> Denis Bohm wrote:
>
> > Hi,
> >
> > Glad to hear that it works for someone.  I'm running out of a fresh CVS
> > checkout using 'ant squiggle'.  Still not working for me... :^(
> >
> > Denis
> >
> > ----- Original Message ----- 
> > From: "Christophe Jolif" <cj...@ilog.fr>
> > To: "Batik Users" <ba...@xml.apache.org>
> > Sent: Wednesday, October 01, 2003 2:10 AM
> > Subject: Re: Scripting with Java Error
> >
> >
> >
> >>Denis,
> >>
> >>This is working fine for me. Which version of Batik are you using? You
> >
> > need at
> >
> >>least 1.5 (not a beta).
> >>
> >>Denis Bohm wrote:
> >>
> >>>I'm trying to script using Java according to the SVG 1.1 specification:
> >>>
> >>>http://www.w3.org/TR/SVG11/java.html
> >>>
> >>>But when I try to load my demo.svg file into Squiggle I get:
> >>>
> >>>"SVG Error: com.fireflydesign.svg.SVGHandler
> >>>
> >>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> >>>..."
> >>>
> >>>I checked the archive and it seems to contain the handler class.
Anyone
> >>>have any idea why the class can't be found?
> >>>
> >>>Thanks,
> >>>  Denis
> >>>
> >>>
> >>>Here is my SVG (demo.svg):
> >>>
> >>><?xml version="1.0" encoding="utf-8"?>
> >>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> >>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> >>>]>
> >>><svg width="600" height="800" viewBox="0 0 600 800"
> >>>    xmlns:xlink="http://www.w3.org/1999/xlink">
> >>>    <script type="application/java-archive" xlink:href="demo.jar"/>
> >>>    <text x="10" y="20" fill="black">Hello</text>
> >>></svg>
> >>>
> >>>Here is my manifest:
> >>>
> >>>Manifest-Version: 1.0
> >>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> >>>
> >>>
> >>>And my Java source:
> >>>
> >>>package com.fireflydesign.svg;
> >>>
> >>>import org.w3c.dom.events.Event;
> >>>import org.w3c.dom.events.EventListener;
> >>>
> >>>import org.w3c.dom.svg.EventListenerInitializer;
> >>>import org.w3c.dom.svg.SVGDocument;
> >>>import org.w3c.dom.svg.SVGSVGElement;
> >>>
> >>>public class SVGHandler implements EventListenerInitializer {
> >>>
> >>>    public SVGHandler() {
> >>>    }
> >>>
> >>>    public void initializeEventListeners(SVGDocument document) {
> >>>        SVGSVGElement root = document.getRootElement();
> >>>        EventListener listener = new EventListener() {
> >>>            public void handleEvent(Event event) {
> >>>                System.out.println("onload");
> >>>            }
> >>>        };
> >>>        root.addEventListener("onload", listener, false);
> >>>    }
> >>>
> >>>}
> >>>
> >>>
> >>>
>
>>>------------------------------------------------------------------------
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> >>>For additional commands, e-mail: batik-users-help@xml.apache.org
> >>
> >>
> >>-- 
> >>Christophe
> >>
> >>
> >>---------------------------------------------------------------------
> >>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
>
>


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


Re: Scripting with Java Error

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi,

    Perhaps you have security settings set differently in Squiggle.
Preferences->Browser Options->Security Settings



Denis Bohm wrote:

> Hi,
> 
> Glad to hear that it works for someone.  I'm running out of a fresh CVS
> checkout using 'ant squiggle'.  Still not working for me... :^(
> 
> Denis
> 
> ----- Original Message ----- 
> From: "Christophe Jolif" <cj...@ilog.fr>
> To: "Batik Users" <ba...@xml.apache.org>
> Sent: Wednesday, October 01, 2003 2:10 AM
> Subject: Re: Scripting with Java Error
> 
> 
> 
>>Denis,
>>
>>This is working fine for me. Which version of Batik are you using? You
> 
> need at
> 
>>least 1.5 (not a beta).
>>
>>Denis Bohm wrote:
>>
>>>I'm trying to script using Java according to the SVG 1.1 specification:
>>>
>>>http://www.w3.org/TR/SVG11/java.html
>>>
>>>But when I try to load my demo.svg file into Squiggle I get:
>>>
>>>"SVG Error: com.fireflydesign.svg.SVGHandler
>>>
>>>java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
>>>..."
>>>
>>>I checked the archive and it seems to contain the handler class.  Anyone
>>>have any idea why the class can't be found?
>>>
>>>Thanks,
>>>  Denis
>>>
>>>
>>>Here is my SVG (demo.svg):
>>>
>>><?xml version="1.0" encoding="utf-8"?>
>>><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
>>>"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
>>>]>
>>><svg width="600" height="800" viewBox="0 0 600 800"
>>>    xmlns:xlink="http://www.w3.org/1999/xlink">
>>>    <script type="application/java-archive" xlink:href="demo.jar"/>
>>>    <text x="10" y="20" fill="black">Hello</text>
>>></svg>
>>>
>>>Here is my manifest:
>>>
>>>Manifest-Version: 1.0
>>>SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
>>>
>>>
>>>And my Java source:
>>>
>>>package com.fireflydesign.svg;
>>>
>>>import org.w3c.dom.events.Event;
>>>import org.w3c.dom.events.EventListener;
>>>
>>>import org.w3c.dom.svg.EventListenerInitializer;
>>>import org.w3c.dom.svg.SVGDocument;
>>>import org.w3c.dom.svg.SVGSVGElement;
>>>
>>>public class SVGHandler implements EventListenerInitializer {
>>>
>>>    public SVGHandler() {
>>>    }
>>>
>>>    public void initializeEventListeners(SVGDocument document) {
>>>        SVGSVGElement root = document.getRootElement();
>>>        EventListener listener = new EventListener() {
>>>            public void handleEvent(Event event) {
>>>                System.out.println("onload");
>>>            }
>>>        };
>>>        root.addEventListener("onload", listener, false);
>>>    }
>>>
>>>}
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>>>For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>-- 
>>Christophe
>>
>>
>>---------------------------------------------------------------------
>>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


Re: Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
Hi,

Glad to hear that it works for someone.  I'm running out of a fresh CVS
checkout using 'ant squiggle'.  Still not working for me... :^(

Denis

----- Original Message ----- 
From: "Christophe Jolif" <cj...@ilog.fr>
To: "Batik Users" <ba...@xml.apache.org>
Sent: Wednesday, October 01, 2003 2:10 AM
Subject: Re: Scripting with Java Error


> Denis,
>
> This is working fine for me. Which version of Batik are you using? You
need at
> least 1.5 (not a beta).
>
> Denis Bohm wrote:
> > I'm trying to script using Java according to the SVG 1.1 specification:
> >
> > http://www.w3.org/TR/SVG11/java.html
> >
> > But when I try to load my demo.svg file into Squiggle I get:
> >
> > "SVG Error: com.fireflydesign.svg.SVGHandler
> >
> > java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> > ..."
> >
> > I checked the archive and it seems to contain the handler class.  Anyone
> > have any idea why the class can't be found?
> >
> > Thanks,
> >   Denis
> >
> >
> > Here is my SVG (demo.svg):
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> > "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> > ]>
> > <svg width="600" height="800" viewBox="0 0 600 800"
> >     xmlns:xlink="http://www.w3.org/1999/xlink">
> >     <script type="application/java-archive" xlink:href="demo.jar"/>
> >     <text x="10" y="20" fill="black">Hello</text>
> > </svg>
> >
> > Here is my manifest:
> >
> > Manifest-Version: 1.0
> > SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> >
> >
> > And my Java source:
> >
> > package com.fireflydesign.svg;
> >
> > import org.w3c.dom.events.Event;
> > import org.w3c.dom.events.EventListener;
> >
> > import org.w3c.dom.svg.EventListenerInitializer;
> > import org.w3c.dom.svg.SVGDocument;
> > import org.w3c.dom.svg.SVGSVGElement;
> >
> > public class SVGHandler implements EventListenerInitializer {
> >
> >     public SVGHandler() {
> >     }
> >
> >     public void initializeEventListeners(SVGDocument document) {
> >         SVGSVGElement root = document.getRootElement();
> >         EventListener listener = new EventListener() {
> >             public void handleEvent(Event event) {
> >                 System.out.println("onload");
> >             }
> >         };
> >         root.addEventListener("onload", listener, false);
> >     }
> >
> > }
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
> -- 
> Christophe
>
>
> ---------------------------------------------------------------------
> 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


Re: Scripting with Java Error

Posted by Christophe Jolif <cj...@ilog.fr>.
Denis,

This is working fine for me. Which version of Batik are you using? You need at 
least 1.5 (not a beta).

Denis Bohm wrote:
> I'm trying to script using Java according to the SVG 1.1 specification:
> 
> http://www.w3.org/TR/SVG11/java.html
> 
> But when I try to load my demo.svg file into Squiggle I get:
> 
> "SVG Error: com.fireflydesign.svg.SVGHandler
> 
> java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
> ..."
> 
> I checked the archive and it seems to contain the handler class.  Anyone
> have any idea why the class can't be found?
> 
> Thanks,
>   Denis
> 
> 
> Here is my SVG (demo.svg):
> 
> <?xml version="1.0" encoding="utf-8"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
> "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
> ]>
> <svg width="600" height="800" viewBox="0 0 600 800"
>     xmlns:xlink="http://www.w3.org/1999/xlink">
>     <script type="application/java-archive" xlink:href="demo.jar"/>
>     <text x="10" y="20" fill="black">Hello</text>
> </svg>
> 
> Here is my manifest:
> 
> Manifest-Version: 1.0
> SVG-Handler-Class: com.fireflydesign.svg.SVGHandler
> 
> 
> And my Java source:
> 
> package com.fireflydesign.svg;
> 
> import org.w3c.dom.events.Event;
> import org.w3c.dom.events.EventListener;
> 
> import org.w3c.dom.svg.EventListenerInitializer;
> import org.w3c.dom.svg.SVGDocument;
> import org.w3c.dom.svg.SVGSVGElement;
> 
> public class SVGHandler implements EventListenerInitializer {
> 
>     public SVGHandler() {
>     }
> 
>     public void initializeEventListeners(SVGDocument document) {
>         SVGSVGElement root = document.getRootElement();
>         EventListener listener = new EventListener() {
>             public void handleEvent(Event event) {
>                 System.out.println("onload");
>             }
>         };
>         root.addEventListener("onload", listener, false);
>     }
> 
> }
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org


-- 
Christophe


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


Scripting with Java Error

Posted by Denis Bohm <de...@fireflydesign.com>.
I'm trying to script using Java according to the SVG 1.1 specification:

http://www.w3.org/TR/SVG11/java.html

But when I try to load my demo.svg file into Squiggle I get:

"SVG Error: com.fireflydesign.svg.SVGHandler

java.lang.ClassNotFoundException: com.fireflydesign.svg.SVGHandler
..."

I checked the archive and it seems to contain the handler class.  Anyone
have any idea why the class can't be found?

Thanks,
  Denis


Here is my SVG (demo.svg):

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.0//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd" [
]>
<svg width="600" height="800" viewBox="0 0 600 800"
    xmlns:xlink="http://www.w3.org/1999/xlink">
    <script type="application/java-archive" xlink:href="demo.jar"/>
    <text x="10" y="20" fill="black">Hello</text>
</svg>

Here is my manifest:

Manifest-Version: 1.0
SVG-Handler-Class: com.fireflydesign.svg.SVGHandler


And my Java source:

package com.fireflydesign.svg;

import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;

import org.w3c.dom.svg.EventListenerInitializer;
import org.w3c.dom.svg.SVGDocument;
import org.w3c.dom.svg.SVGSVGElement;

public class SVGHandler implements EventListenerInitializer {

    public SVGHandler() {
    }

    public void initializeEventListeners(SVGDocument document) {
        SVGSVGElement root = document.getRootElement();
        EventListener listener = new EventListener() {
            public void handleEvent(Event event) {
                System.out.println("onload");
            }
        };
        root.addEventListener("onload", listener, false);
    }

}