xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vmlgo...@free.fr
Subject Re: Drawing with JSVGCanvas
Date Fri, 30 Jul 2004 21:22:07 GMT
Hi Thomas,

Thanks a lot for your answer that's fixed my problems. You're right, i was
creating the element by using the createElement method without any Name Space.
however i didn't used any updateManager objet to repaint the JSVGCanvas, i
suppose that the jsvgcanvas.setDocumentState(ALWAYS_DYNAMIC) method is the
reason?

Bye

Victor


> Hi Victor,
>
>     Well, I can see one mistake and guess at two likely others.
> First the one I can see is that you aren't making your changes
> to the document in the UpdateManager thread (search the list
> for UpdateManager for all the details) or read the FAQ.
>
>     Second (only a guess) is that your document may not be setup
> for dynamic rendering.  To ensure your document is always in a
> dynamic state when loaded you need to call
> 'jsvgcanvas.setDocumentState(ALWAYS_DYNAMIC)' _before_ loading
> the document (with setURI or what ever).
>
>     Third (also only a guess) you may not be creating your
> 'element' in the SVG namespace:
>
>     Element myPath = doc.createElementNS("http://www.w3.org/2000/svg",
>                                          "path");
>     myPath.setAttribute("d", "M....");
>
>     Hope this helps, and good luck.
>
> LOPES GOMES Victor wrote:
>
> > Hi,
> >
> > I start to work with Batik and i need to create and manipulate basic Shapes
> in
> > the JSVGCanvas.
> > I would like to modify and manipulate the SVGDocument and (repaint) the
> > SVGCanvas to view the changement.
> >
> > How to create and put new elements in the JSVGCanvas? I try this one below
> but
> > nothing
> > appear in the screen:
> >
> > I've added a MouseListener in my JSVGCanvas
> > the createElement just create an Element at the pt coordinate.
> >
> > public void mousePressed(MouseEvent e) {
> > 		Point2D pt = e.getPoint();
> > 		SVGDocument doc = canvas.getSVGDocument();
> > 		Element root = doc.getDocumentElement();
> > 		root.appendChild(createElement(pt));
> > 	}
> >
> > Is it a wrong way to do?
> >
> >
> >
> > It will be fine to
> >
> > --
> > Victor from Paris(France)
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> > For additional commands, e-mail: batik-users-help@xml.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
>
>

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


Mime
View raw message