xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Bohm" <de...@fireflydesign.com>
Subject Re: Scripting with Java Error
Date Wed, 01 Oct 2003 21:32:03 GMT
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" <denis@fireflydesign.com>
To: "Batik Users" <batik-users@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" <denis@fireflydesign.com>
> To: "Batik Users" <batik-users@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


Mime
View raw message