xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thierry Kormann <tkorm...@ilog.fr>
Subject Re: pixels vs. pt in JSVGComponent
Date Mon, 16 Jul 2001 07:35:27 GMT
On Thursday 12 July 2001 00:16, Peter Armstrong wrote:

> > To handle units you have the UnitProcessor class in the bridge package.
> > This class provides methods used everywhere in the bridge (see
> > SVGSVGElementBridge...) such as float svgLengthToUserSpace(...).
> >
> > If you just want to size of the document, you can ask to the
> > bridge context
> > to give that size in pixels with bridgeContext.getDocumentSize() method.
> Yes, this does.  However, since I need to determine the size of the
> document when I construct my subclass of JSVGComponent, when I call the
> JSVGComponent's getSVGDocumentSize() method, it calls the getDocumentSize()
> method of its bridgeContext, but this method returns null since (as its
> JavaDoc says) the document has not been built yet.
> So now I'm stuck figuring out how to wait() until the document has been
> built, unless there's some method I can call which will do this for me and
> block until the document has been built.

As the JSVGCanvas tutorial mentions, you have to implement a listener and 
attach it to the svg canvas. Once the document is built, you will be informed 
that it is done. At this time, you can ask for:


See: GVTTreeBuilderListener - gvtBuildCompleted.

Hope this helps,

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

View raw message