Hello

I am working on complex relationship management desktop application. The
user can load or create some graph on the JSVGCanvas. He is able to edit
that graph (move nodes, edit relations etc). 

The user should be able to save the state of the edited graph and load that
state whenever he wants. 

In some other (non-SVG) parts of my application, I use this kind of
serialization (and it works):

<code>
        import java.beans.XMLEncoder;

        FileOutputStream os = null;
        try{
                os = new FileOutputStream("c:\\serialization.xml");
        }
        catch(Exception ex){
        }
        
        if(os != null){
                XMLEncoder encoder = new XMLEncoder(os);
                encoder.writeObject(serializedObject);
                encoder.close();
        }
</code>

The object I try to serialize is:
<code>
        SVGOMRectElement serializedObject = new SVGOMRectElement("customNS",
jsvgCanvas.getDocument());
</code>

This is the reported exception:
java.lang.IllegalAccessException: Class sun.reflect.misc.Trampoline can not
access a member of class org.apache.batik.dom.svg.SVGOMRectElement with
modifiers "protected"
Continuing ...
java.lang.Exception: XMLEncoder: discarding statement
XMLEncoder.writeObject(SVGOMRectElement);
Continuing ...

So...
Is there some other way to serialize this (and deserialize it afterwards)?
Or I am doing something wrong?
Or I have to dive into the Batik source code and deal with the unaccessible
members?
Or any other suggestion?


Thanks,
Nebojsa

-- 
View this message in context: 
http://www.nabble.com/Serialization-with-FileStreams-tf2522028.html#a7034898
Sent from the Batik - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to