The experienced guys might be able to pin down something more specific, but
my next step here would be to try putting the same JSVGCanvas code on top of
a regular component like JFrame, to make sure that the file is actually
being read ok (I've had trouble in the past with file locations on windows,
I don't know if it would make any difference but substituting "d:/img1.svg"
might be worth a try). Maybe even just try inserting
System.out.println(f.exists());
Cheers,
Danny.
>I try to display SVGs as JTree nodes. Therefore I wrote a TreeRenderer like
>this:
>
>public class SVGTreeRenderer extends JSVGCanvas implements TreeCellRenderer
>{
>
> public SVGTreeRenderer() {
> File f = new File("d:\\img1.svg");
> try {
> this.setURI(f.toURL().toString());
> } catch (Exception ex) {
> //...
> }
> }
> public Component getTreeCellRendererComponent(JTree tree, ...) {
> return this;
> }
>}
>
>Running this Code I get the following Exception:
>
>java.awt.geom.NoninvertibleTransformException: Determinant is 0
>
> at
>java.awt.geom.AffineTransform.createInverse(AffineTransform.java:1898)
>
> at
>org.apache.batik.swing.gvt.JGVTComponent.setRenderingTransform(Unknown
>Source)
>
> at
>org.apache.batik.swing.svg.JSVGComponent.computeRenderingTransform(Unknown
>Source)
>
> at org.apache.batik.swing.gvt.JGVTComponent.setGraphicsNode(Unknown
>Source)
>
> at org.apache.batik.swing.svg.JSVGComponent.access$601(Unknown Source)
>
> at
>org.apache.batik.swing.svg.JSVGComponent$SVGListener.gvtBuildComple
>ted(Unknown
>
>Source)
>
> at org.apache.batik.swing.svg.GVTTreeBuilder$2.run(Unknown Source)
>
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
>
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
>
> at
>java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatch
>Thread.java:131)
>
> at
>java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchTh
>read.java:98)
>
> at
>java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
>
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
>
>
>At the end, there are no SVGs displayed in the JTree. Does anyone has a
>solution for this problem?
>
>cheers,
>
>Thomas
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]