Hi Selva,
I had a similar problem a long time ago... can't remember
well, what the exact reason was, but found some left over
code, did you try it like that too??
use2.setAttributeNS
(XLINK_NAMESPACE_URI, "href",
"file:///C:/xx/de.svg#portset");
Hope this solves it,
Dominik Steiner
Dipl-Ing. Informationstechnik (BA)
GIGATRONIK
Gesellschaft für Automobil-
elektronikentwicklung mbH
Taunusstr. 21
80807 München
Telefon +49 (0) 89 / 353 96 80-70
Telefax +49 (0) 89 / 353 96 80-99
mailto:dominik.steiner gigatronik.com
www.gigatronik.com
-----Ursprüngliche Nachricht-----
Von: news [mailto:news sea.gmane.org] Im Auftrag von Selva
Gesendet: Dienstag, 25. April 2006 14:17
An: batik-users xml.apache.org
Betreff: Position problem for group element
Hi All,
I have created a group element "port" in my
external defs.svg and instanced it
in my application using "use" element with
"x" and "y" attributes. But if I
tried to get the position "use" elements
position, it's returning (0,0). It's
not giving "x" and "y" attributes
which was set by me.
Declaration in defs.svg:
<g id = "portset">
<rect x="0" y="0"
fill="#AEADAE" stroke="black"
stroke-width="0.25" width="53"
height="17"/>
.
.
.
</g>
Accessing code in my Application:
Element g2 = doc.createElementNS(svgNS, "g");
g2.setAttributeNS(null, "id",
"group2");
Element use2 = doc.createElementNS(svgNS,
"use");
use2.setAttributeNS(null, "id",
"use2");
use2.setAttributeNS
(XLINK_NAMESPACE_URI, "xlink:href",
"file:///C:/xx/de.svg#portset");
use2.setAttributeNS(null, "x",
"10");
use2.setAttributeNS(null, "y",
"10");
g2.appendChild(use2);
.
.
.
SVGLocatable recPos = (SVGLocatable)use2;
SVGRect posRect = re.getBBox();
System.out.println("X::" + posRect.getX());
System.out.println("Y::" + posRect.getY());
Can anyone please clarify my problem?
Thanks,
Selva
------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribe xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help xmlgraphics.apache.org
------------------------------------------------------------
---------
To unsubscribe, e-mail: batik-users-unsubscribe xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help xmlgraphics.apache.org
|