Hi V,

I do it this way:

   public void moveTo(String svgID, Point2D.Double location, JSVGCanvas
canvas) {
       SVGDocument document = canvas.getSVGDocument();
       final Element e = document.getElementById(svgID);
       final Point2D.Double newLoc = location;

       canvas.getUpdateManager().getUpdateRunnableQueue().invokeLater(new
Runnable() {
           public void run() {
                     e.setAttributeNS(null, "x", "" + newLoc.x);
                     e.setAttributeNS(null, "y", "" + newLoc.y);
            }
        });
   }

This particular method is specifically for moving "rect" elements.  Other
elements can be handled similarly.

Hope that helps,

     Phil

On 12/1/06, vyang <[EMAIL PROTECTED]> wrote:


Hello;

I was wondering how I would update a document using JSVGCanvas.  I have
written a simple java file that creates a document that has 2 rectangles
in
them.  I then use JSVGCanvas to display it.  I load the document into
JSVGCanvas using setDocument().  Now what I want to do is that when I
move(or do things in JSVGCanvas) I would like that to update to my
document.
How would I go about doing that?  Any help would be much appreciated.
--
View this message in context:
http://www.nabble.com/JSVGCanvas-Update-tf2740725.html#a7646942
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Visit http://www.darkisle.com for photos of castles, cairns and other
historic sites in the British Isles.

Reply via email to