That all looks correct.  I notice you set the SVGDocument to the
JSVGCanvas BEFORE you register the GVT listeners.  Could that be part of
the problem?

Michael Bishop

-----Original Message-----
From: hardc0d3r [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 25, 2007 3:30 PM
To: batik-users@xmlgraphics.apache.org
Subject: RE: how to update SVGCanvas without moving mouse on canvas?


sorry..

    private void initCanvas() throws DOMException {
        try {
            doc = svgCanvas.getSVGDocument();
            svgRoot = doc.getRootElement();
            
            Element rect = doc.createElementNS(svgNS, "rect");
            rect.setAttributeNS(null, "id", "mapBG");
            rect.setAttributeNS(null, "x", "0");
            rect.setAttributeNS(null, "y", "0");
            rect.setAttributeNS(null, "width", "800");
            rect.setAttributeNS(null, "height", "600");
            rect.setAttributeNS(null, "pointer-events", "fill");
            rect.setAttributeNS(null, "style",
"fill:white;stroke:black;fill-opacity:.01");
            
            tempLine = doc.createElementNS(svgNS, "line");
            tempLine.setAttributeNS(null, "x1", "0");
            tempLine.setAttributeNS(null, "y1", "0");
            tempLine.setAttributeNS(null, "x2", "0");
            tempLine.setAttributeNS(null, "y2", "0");
            tempLine.setAttributeNS(null, "style", "stroke:red;
stroke-width:1.5; stroke-dasharray:3.3;");
            tempLine.setAttributeNS(null, "display", "none");

            Element g1 = doc.createElementNS(svgNS, "g");
            g1.setAttributeNS(null, "id", "street");
            
            Element g2 = doc.createElementNS(svgNS, "g");
            g2.setAttributeNS(null, "id", "marker");

            Element g3 = doc.createElementNS(svgNS, "g");
            g3.setAttributeNS(null, "id", "structure");
            
            Element g4 = doc.createElementNS(svgNS, "g");
            g4.setAttributeNS(null, "id", "cell");
            
            svgRoot.appendChild(g1);
            svgRoot.appendChild(g2);
            svgRoot.appendChild(g3);
            svgRoot.appendChild(g4);
            svgRoot.appendChild(rect);
            svgRoot.appendChild(tempLine);
           
            EventTarget t = (EventTarget)svgRoot;
            t.addEventListener("mousemove", new OnMoveAction(), false);
            t.addEventListener("mousedown", new OnDownAction(), false);
            t.addEventListener("mouseup", new OnUpAction(), false);
        } catch (Exception e) {}
    }
--
View this message in context:
http://www.nabble.com/how-to-update-SVGCanvas-without-moving-mouse-on-ca
nvas--tf3975725.html#a11293957
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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]

Reply via email to