Hi Randy
Thanks for the help, that example is the one which I actually looked at
http://xml.apache.org/batik/svggen.html#view when building my code.
I think my code does follow the guidelines, the only missing step is the one
where an SVGDocument's instance is populated with an svg dom ,
docSvg.getRoot(Element), because this method doesn't compile, any ideas why
it doesn't ( please see below an error message) ?
I'll try to populate SvgDocument using
docSvg.importNode(SvgGraphics2D.getRoot()), may it will help.
Cheers
Sergey Beryozkin
P.S. Below is an message on SVGGraphics2D.getRoot(Element);
SVGGraphics2D.getRoot() compiles ok
com/zandar//SVGView.java [41] getRoot() in
org.apache.batik.svggen.SVGGraphics2D cannot be applied to
(org.w3c.dom.Element)
Element gRoot = gSvg.getRoot(docSvg.getDocumentElement());
^
1 error
build.xml [29] Compile failed, messages should have been provided.
----- Original Message -----
From: "Baron, Randy {PRG~Basel}" <[EMAIL PROTECTED]>
To: "Batik Users" <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 4:23 PM
Subject: RE: Basic question on JSvgCanvas
Hi Seregy,
Maybe this thread from the archive is relevant to what you want?:
http://koala.ilog.fr/batik/mlists/batik-users/archives/msg01828.html
-Randy
-----Original Message-----
From: Siarhei Biarozkin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 4:29 PM
To: [EMAIL PROTECTED]
Subject: Basic question on JSvgCanvas
Hello
Apologies if the question has been answered before, I've found no
relevant
info in archives.
My basic question is how to make JSvgCanvas to show an svg content
generated
by SvgGraphics2D. I'm working at Windows XP, with JDK 1.4.1
Particularly, I'm using both classes the following way :
I've a subclass of JSvgCanvas, and here its fragment :
class SvgView extends JSvgCanvas {
SVGGraphics2D gSvg;
SVGDocument docSvg;
public SvgView() {
// initialize SVGGraphics2D, as shown at Batik's Generator page
DOMImplementation impl =
SVGDOMImplementation.getDOMImplementation();
docSvg = (SVGDocument)impl.createDocument
(SVGDOMImplementation.SVG_NAMESPACE_URI, "svg", null);
gSvg = new SVGGraphics2D(docSvg);
}
public void paintComponent(Graphics g) {
// first, let application components draw themselves as usual
into
SVGGraphics2D
activeComponent.draw(gSvg);
Element root = docSvg.getDocumentElement();
// the following line doesn't compile
// getRoot() can't be applied to org.w3.dom.Element
// looks like getRoot(Element) method doesn't exist ??
gSvg.getRoot(root);
setSVGDocument(docSvg);
// finally, draw itself
super.paintComponent(g);
}
}
}
}
The result is that Svg graphics is not drawn,
Can you please tell me what am I missing in the code ?
Thanks
Seregy Beryozkin
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]