You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Dmitrij Sakara <dm...@epfl.ch> on 2004/10/27 17:24:21 UTC
NullPointerException while matix transformation
Hi all,
I have the following code for transformation element coordinates to
screen:
Element root = svgElement.getOwnerDocument().getDocumentElement();
SVGMatrix matrix = ((SVGTransformable)
svgElement).getTransformToElement((SVGElement) root);
SVGPoint p = new SVGOMPoint(0, 0);
p = p.matrixTransform(matrix);
I receive the nullPointerException during the matrixTransform execution
java.lang.NullPointerException
at
org.apache.batik.dom.svg.SVGLocatableSupport$4.getAffineTransform(Unknow
n Source)
at org.apache.batik.dom.svg.AbstractSVGMatrix.getA(Unknown
Source)
at
org.apache.batik.dom.svg.SVGOMPoint.matrixTransform(Unknown Source)
Variables matrix and p are not null. What can be a problem?
___________________________________________
Dmitrij SAKARA
STI IPR LICP
Swiss Federal Institute of Technology (EPFL)
Me - Ecublens
CH-1015 Lausanne
Switzerland
Tel. : +41 (0)21 / 693 5913
Fax. : +41 (0)21 / 693 3509
e-mail : dmitrij.sakara@epfl.ch
My office at EPFL: http://map.epfl.ch/?room=MEA1382
___________________________________________
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org
Re: NullPointerException while matix transformation
Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Dmitrij,
Most likely svgElement is no in the rendering tree.
This generally means that it either has 'display="none"' or
is in a 'defs' section.
The other possibility is that the document is not setup
to be 'dynamic' - which using the SVG DOM requires.
We should really check this in the call to getTransformToElement,
but we don't.
Dmitrij Sakara wrote:
> Hi all,
>
> I have the following code for transformation element coordinates to
> screen:
>
> Element root = svgElement.getOwnerDocument().getDocumentElement();
> SVGMatrix matrix = ((SVGTransformable)
> svgElement).getTransformToElement((SVGElement) root);
> SVGPoint p = new SVGOMPoint(0, 0);
> p = p.matrixTransform(matrix);
>
> I receive the nullPointerException during the matrixTransform execution
>
> java.lang.NullPointerException
> at
> org.apache.batik.dom.svg.SVGLocatableSupport$4.getAffineTransform(Unknow
> n Source)
> at org.apache.batik.dom.svg.AbstractSVGMatrix.getA(Unknown
> Source)
> at
> org.apache.batik.dom.svg.SVGOMPoint.matrixTransform(Unknown Source)
>
> Variables matrix and p are not null. What can be a problem?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org