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 Oscar Picasso <os...@yahoo.com> on 2006/01/23 03:46:13 UTC

Onload event and svg12

Hi,

I succeeded to dynamically get the computed lengths for text elements thanks to Thomas and Andreas explanations.

In order to get the 'onload' event fired, I set an onload attribute with a dummy value to the text element. 

Something like: <text onload="i=1">....

Not very elegant but it worked. Let me know if there a better way.

I have a more serious problem though when doing this with svg12. If there is element with an onload attribute, I get a ClassCastException (see trace below)

Any idea?

java.lang.ClassCastException: org.apache.batik.bridge.BridgeContext
    at org.apache.batik.bridge.svg12.SVG12TextElementBridge.addTextEventListeners(Unknown Source)
    at org.apache.batik.bridge.SVGTextElementBridge.initializeDynamicSupport(Unknown Source)
    at org.apache.batik.bridge.SVGTextElementBridge.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
    at org.apache.batik.bridge.SVGUseElementBridge.buildCompositeGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.SVGUseElementBridge.createGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildGraphicsNode(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.buildComposite(Unknown Source)
    at org.apache.batik.bridge.GVTBuilder.build(Unknown Source)
    at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
[...]

		
---------------------------------
 
 What are the most popular cars?  Find out at Yahoo! Autos