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 Gold Martin <Ma...@blva.bayern.de> on 2004/02/17 13:04:46 UTC

how to switch scripting on/off - found 2 exceptions

hello,

I have a SVG file with ECMA script to show text when the mouse is over areas
(there are some thousand areas to show the name of the area).
How can I switch off/on mouse over effects with the Batik Java classes.
My problem is that the mouse over effects sometimes annoy.
So I want that the user can switch scripting on and off in our SVG browser.
Can I do this with the 'pointer-events' property? I want to set it for the
whole group of areas - not for every <text> tag 

When I worked with the browser I found 2 exceptions:

1.) I have implemented the JSVGScrollPane (version 1.4). Fine thing and very
fast.
But when I load an SVG document without the viewbox attribute and I change
the transformation (e.g. zoom), I get a NullPointerException and it is not
any longer possible to change the transformation in the canvas:
java.lang.NullPointerException
        at
org.apache.batik.swing.JSVGScrollPane.checkAndSetViewBoxRect(Unknown Source)
        at org.apache.batik.swing.JSVGScrollPane.resizeScrollBars(Unknown
Source)
        at
org.apache.batik.swing.JSVGScrollPane$ScrollListener.componentResized
(Unknown Source)
        ....

2.) When I zoom in the JSVGCanvas with a zoom factor more than 1000 or 1500
(OK it's not usual) I get the following exception:
sun.dc.pr.PRException: endPath: bad path
        at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)
        at
sun.java2d.pipe.DuctusRenderer.createShapeRasterizer(DuctusRenderer.java:374
)
        at
sun.java2d.pipe.DuctusShapeRenderer.renderPath(DuctusShapeRenderer.java:57)
        ...

best regards,
Martin

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


Re: how to switch scripting on/off - found 2 exceptions

Posted by Thomas DeWeese <Th...@Kodak.com>.
Gold Martin wrote:

> I have a SVG file with ECMA script to show text when the mouse is over areas
> (there are some thousand areas to show the name of the area).
> How can I switch off/on mouse over effects with the Batik Java classes.
> My problem is that the mouse over effects sometimes annoy.
> So I want that the user can switch scripting on and off in our SVG browser.
> Can I do this with the 'pointer-events' property? I want to set it for the
> whole group of areas - not for every <text> tag 

    If you set 'pointer-events' on the group it will inherit down
the tree, unless another element set's pointer-events as well.

> When I worked with the browser I found 2 exceptions:
> 
> 1.) I have implemented the JSVGScrollPane (version 1.4). Fine thing and very
> fast.
> But when I load an SVG document without the viewbox attribute and I change
> the transformation (e.g. zoom), I get a NullPointerException and it is not
> any longer possible to change the transformation in the canvas:

    Well the scroll pane requires a viewbox otherwise it doesn't know
what it should scroll over.  I suppose I could modify it so no viewbox
just means that the scrollbars never show up.

> java.lang.NullPointerException
>         at
> org.apache.batik.swing.JSVGScrollPane.checkAndSetViewBoxRect(Unknown Source)

> 2.) When I zoom in the JSVGCanvas with a zoom factor more than 1000 or 1500
> (OK it's not usual) I get the following exception:
> sun.dc.pr.PRException: endPath: bad path
>         at sun.dc.pr.Rasterizer.endPath(Rasterizer.java:537)

    This is a longstanding 'bug' in Java2D I suppose we could 'clamp'
zooming but when/if this happens really depends on the path data so
it would be hard for us to do this well.



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