SVG questions

I have managed to create an SVG file using JGo however I still have several issues to resolve.
The code I’m using is very simple:
FileOutputStream F = new FileOutputStream((“C:\SVGFile.svg”);
SVGGoView svgView = new SVGGoView();
svgView.generateSVG( F );

  1. During the execution of the last line I get the following error:
    XOR Mode is not supported by Graphics2D SVG Generator
    Can someone throw some light on what might be causing this?
    An SVG file is created by my code however it is corrupted - Paintshop can’t open it at all and Visio opens it but generates loads of errors about unsupported attribute types and unsupported attribute values.
  2. Are these Visio errors in normal? How can I avoid them?
    The image imports into Visio quite well except for a couple of problems:
  3. The diagram layout is quite different from the layout as it appears in the Java applet. The boxes are displayed left to right in the applet but are laid out in a step fashion in Visio i.e. each box is positioned down and to the right of the previous box meaning that all the connectors now cross over the boxes.
  4. When the diagram is in Visio, none of the elements seem to be grouped. So for an area, the border, background and nodes are all individual elements and can be moved independently of each other. When I click on an area, Visio appears to highlight the whole bounded area, but when I drag the highlighted area I am in fact only moving the shaded background of the area. If I then click on the original area again, it highlights but when I move it I find that I am only moving the border of the area. Is this normal behaviour or do I have to do something special when creating the diagram.
    We’re getting close to the end of our evaluation and just need to get these last few issues nailed.

That’s interesting. I’m not aware of anyplace in JGo where we draw in XOR mode other than drawing a resize box or a multiple selection drag rectangle. Neither of which is applicable in your case.
What objects do you have in your JGoDocument? If you simplify the contents of the JGoDocument, perhaps just to show a single JGoRectangle, do you still get this error?
Also, what versions are you using of the JDK and Batik libraries.
The generated SVG should certainly be legal SVG, although it is simply produced by handling all the Graphics2D draw commands and translated them to SVG, so things like grouping of objects will not be preserved.

Thank you for clarifying some of my SVG questions.
I have tried with a very simple applet (see code below) and get the same error. The JVM version is 1.5.0_06. I am using the latest batik jars (version 1.6). Any idea what may be happening ?
</FONT> <FONT size=2>import*;<BR>import javax.swing.*;</FONT> <FONT size=2>import com.nwoods.jgo.*;<BR>import com.nwoods.jgo.svg.*;</FONT> <FONT size=2>public class TestUI extends JApplet{<BR> private JGoView myView;<BR> private JGoDocument doc; <BR> <BR> public void init() {<BR> try {<BR> System.out.println(System.getProperty("java.version")) ; <BR> myView = new JGoView();<BR> getContentPane().add(myView);<BR> doc = new JGoDocument();<BR> myView.setDocument(doc);<BR> JGoBasicNode node = new JGoBasicNode("Test");<BR> doc.addObjectAtTail(node);<BR> storeSVG();</FONT> <FONT size=2> }catch (Exception e) {<BR> System.err.println(e); <BR> }<BR> }<BR> public void storeSVG()<BR> throws IOException, UnsupportedOperationException<BR> {<BR> try{<BR> FileOutputStream F = new FileOutputStream("C:\\temp\\testsvg.svg");<BR> SVGGoView svgView = new SVGGoView();<BR> svgView.setDocument(doc);<BR> svgView.generateSVG( F );<BR> }catch (Exception e) {<BR> System.err.println("Error: " + e); <BR> }<BR> }</FONT> <FONT size=2>}</FONT> <FONT size=2>