xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Kelly <Chris.ke...@advent-comm.co.uk>
Subject RE: Loading an SVG from a jar file
Date Mon, 10 Sep 2001 16:08:58 GMT
Thanks for that Vincent

The previous trace no longer appears but I still don't get any SVG loaded
onto the canvas

I added the following listeners from the JSVGCanvas sample on the Batik site
but I only ever get "Document Loading..." displayed  

// Set the JSVGCanvas listeners.
svgCanvas.addSVGDocumentLoaderListener(new SVGDocumentLoaderAdapter()
{
	public void documentLoadingStarted(SVGDocumentLoaderEvent e)
      {
       	label.setText("Document Loading...");
      }
      public void documentLoadingCompleted(SVGDocumentLoaderEvent e)
      {
      	label.setText("Document Loaded.");
      }
      });

svgCanvas.addGVTTreeBuilderListener(new GVTTreeBuilderAdapter()
{
	public void gvtBuildStarted(GVTTreeBuilderEvent e)
      {
      	label.setText("Build Started...");
      }
      public void gvtBuildCompleted(GVTTreeBuilderEvent e)
      {
      	label.setText("Build Done.");
            frame.pack();
      }
      });

svgCanvas.addGVTTreeRendererListener(new GVTTreeRendererAdapter()
{
	public void gvtRenderingPrepare(GVTTreeRendererEvent e)
      {
        label.setText("Rendering Started...");
      }

Any more ideas?

Chris

-----Original Message-----
From: Vincent Hardy [mailto:vincent.hardy@sun.com]
Sent: 10 September 2001 15:44
To: Batik Users
Subject: Re: Loading an SVG from a jar file


Chris,



> Chris Kelly wrote:
> 
> This looks a bit strange to me since I've never seen a jar URL before
> but I'm guessing the SVG has been found. Right?

We cannot know with the trace below.

> 
> Line 3, however, still seems to give me problems (line 3 is
> SVGApplication.java:98 below):-
> 
> Exception occurred during event dispatching:
> java.lang.NoClassDefFoundError: org.apache.batik.css.parser.Parser

Right: this means that you do not have
org.apache.batik.css.parser.Parser
in your classpath. My guess is that there are a couple .class files
missing in your applet.jar file. In other words, try to add
org.apache.batik.css to your applet.jar for example and see if you
still have the error.

I hope this helps,
Vincent.

>  at
> org.apache.batik.css.CSSDocumentHandler.class$(CSSDocumentHandler.java:35)
>  at
>
org.apache.batik.css.CSSDocumentHandler.<clinit>(CSSDocumentHandler.java:39)
>  at
>
org.apache.batik.dom.svg.SVGDOMImplementation.<init>(SVGDOMImplementation.ja
va:88)
>  at
>
org.apache.batik.dom.svg.SVGDOMImplementation.<clinit>(SVGDOMImplementation.
java:59)
>  at
>
org.apache.batik.dom.svg.SAXSVGDocumentFactory.<init>(SAXSVGDocumentFactory.
java:68)
>  at
> org.apache.batik.bridge.DocumentLoader.<init>(DocumentLoader.java:67)
>  at
>
org.apache.batik.swing.svg.JSVGComponent.loadSVGDocument(JSVGComponent.java:
203)
>  at org.apache.batik.swing.JSVGCanvas.setURI(JSVGCanvas.java:354)
>  at batik.SVGApplication$2.actionPerformed(SVGApplication.java:98)
>  at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>  at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> Source)
>  at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
>  at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
>  at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
> Source)
>  at java.awt.Component.processMouseEvent(Unknown Source)
>  at java.awt.Component.processEvent(Unknown Source)
>  at java.awt.Container.processEvent(Unknown Source)
>  at java.awt.Component.dispatchEventImpl(Unknown Source)
>  at java.awt.Container.dispatchEventImpl(Unknown Source)
>  at java.awt.Component.dispatchEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
>  at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>  at java.awt.Container.dispatchEventImpl(Unknown Source)
>  at java.awt.Window.dispatchEventImpl(Unknown Source)
>  at java.awt.Component.dispatchEvent(Unknown Source)
>  at java.awt.EventQueue.dispatchEvent(Unknown Source)
>  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown
> Source)
>  at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
>  at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>  at java.awt.EventDispatchThread.run(Unknown Source)
> 
> I'm using java 1.3.1 and Batik 1.0
> 
> I've absolutely no idea what I can do to get around this. Any
> suggestions?
> 
> Chris
> 
This message is intended for the addressee only. It must not be disclosed
to, altered, copied or used by anyone other than the addressee(s). If you
have received this message in error, please notify our email administrator
at   postmaster@advent-comm.co.uk <mailto:postmaster@advent-comm.co.uk> and
destroy the message, removing it completely from your computer system. 
Thank you for your assistance. 

Mail Virus Warning
-------------------------------

This email and any attachment are believed to be free from viruses which
might affect any system into which they are received or opened, it is the
responsibility of the recipient to ensure that they are virus free.
 Advent Communications ltd accepts no liability whatsoever for any direct,
indirect or consequential loss or damage arising in any way from receipt,
opening or use.


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