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:
svgCanvas.getSVGDocumentSize();
See: GVTTreeBuilderListener - gvtBuildCompleted.
Hope this helps,
Thierry.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]