xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Neumann <neum...@karto.baug.ethz.ch>
Subject Re: Custom cursors problem
Date Fri, 05 May 2006 12:37:44 GMT
Hi Selva,

thats because you didn't use the xlink namespace but "null", which 
defaults to the SVG namespace and is wrong.

Try using the following:

cursor.setAttributeNS("http://www.w3.org/1999/xlink","href","zoomin.png");

Also note that gif might not be supported in all viewers, but png will 
be supported. Also I would recommend to use a relative URI and not an 
absolute. Otherwise you can't move your project to different machines.

Andreas

> Element cursor = doc.createElementNS(svgNS, "cursor");
> cursor.setAttributeNS(null, "id", "zoomin");
> cursor.setAttributeNS(null, "xlink:href", "file:///E:/zoomin.gif");
> defs.appendChild(cursor);
>                
> doc.getRootElement().appendChild(defs);
> doc.getRootElement().setAttributeNS(null, "style", "cursor:url
> (#zoomin),crosshair");
> 
> 
> org.apache.batik.bridge.BridgeException: null:0
> The attribute "xlink:href" of the element <cursor> is required
> at org.apache.batik.bridge.CursorManager.convertSVGCursorElement
> (CursorManager.java:333)
> at org.apache.batik.bridge.CursorManager.convertSVGCursor
> (CursorManager.java:303)
> at org.apache.batik.bridge.CursorManager.convertCursor(CursorManager.java:198)
> at org.apache.batik.bridge.CSSUtilities.convertCursor(CSSUtilities.java:254)
> at org.apache.batik.bridge.BridgeContext$DOMMouseOverEventListener.handleEvent
> (BridgeContext.java:1485)
> at org.apache.batik.dom.events.EventSupport.fireEventListeners
> (EventSupport.java:350)
> at org.apache.batik.dom.events.EventSupport.fireEventListeners
> (EventSupport.java:407)
> at org.apache.batik.dom.events.EventSupport.dispatchEvent
> (EventSupport.java:281)
> at org.apache.batik.dom.AbstractNode.dispatchEvent(AbstractNode.java:1010)
> .
> .
> .
> 
> Thanks,
> Selva
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
> 


-- 
----------------------------------------------
Andreas Neumann - Institute of Cartography
Swiss Federal Institute of Technology (ETH)
ETH Hoenggerberg
CH-8093  Zurich, Switzerland
Phone: ++41-1-633 3031, Fax: ++41-1-633 1153
e-mail: neumann@karto.baug.ethz.ch
www: http://www.carto.net/neumann/
SVG.Open: http://www.svgopen.org/
Carto.net: http://www.carto.net/

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


Mime
View raw message