Hi Keywan, Keywan Najafi Tonekaboni <[EMAIL PROTECTED]> wrote on 04/22/2008 10:29:05 PM:
> I have a small Question: I want to change the mouse-cursor, when the > user chose a tool to draw shapes/lines in the JSVGCanvas. I use > > myCanvas.setCursor(canvasCursor); > > In canvasCursor I store e.g a awt.Cursor.CROSSHAIR_CURSOR > > I use setCursor also in the mouseEntered method of my canvas-mouse > listener. And everything works fine unless I move the cursor over a > drawn shape. Then the cursor switch back to the default-cursor. > > How I can stop this behaviour The easiest way is to subclass the BridgeUserAgent (see createUserAgent in AbstractJSVGComponent), so that the setSVGCursor method does nothing. > What I don't understand. My document has as lowest layer a <g> with and > <image> inside. The image has the same size like the svg-document. So > the mouse is every-time over this image, when its over the canvas. but > in this case, the cursor doesn't change back. We don't set the cursor all the time we only set the cursor when you move from one object to another (when the SVG cursor could change), so until you move across an object boundary we don't notice that you have changed the cursor on us. You might consider if it would be helpful to leverage the cursor capabilities of SVG instead of disabling them. As Helder says it's fairly easy to manipulate the cursor with the SVG document.
