Examples of DHNSSerializer


Examples of org.gephi.graph.dhns.utils.DHNSSerializer

public class DhnsPersistenceProvider implements WorkspacePersistenceProvider {

    public void writeXML(XMLStreamWriter writer, Workspace workspace) {
        DhnsGraphController graphController = Lookup.getDefault().lookup(DhnsGraphController.class);
        Dhns dhns = (Dhns) graphController.getModel(workspace);
        DHNSSerializer serializer = new DHNSSerializer();
        try {
            serializer.writeDhns(writer, dhns);
        } catch (XMLStreamException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

Examples of org.gephi.graph.dhns.utils.DHNSSerializer

    }

    public void readXML(XMLStreamReader reader, Workspace workspace) {
        DhnsGraphController graphController = Lookup.getDefault().lookup(DhnsGraphController.class);
        Dhns dhns = (Dhns) graphController.getModel(workspace);
        DHNSSerializer serializer = new DHNSSerializer();
        try {
            serializer.readDhns(reader, dhns);
        } catch (XMLStreamException ex) {
            throw new RuntimeException(ex);
        }
    }
View Full Code Here

Examples of org.gephi.graph.dhns.utils.DHNSSerializer

    }

    @Test
    public void testDhnsSerializer() {
        try {
            DHNSSerializer dHNSSerializer = new DHNSSerializer();
            StringWriter stringWriter = new StringWriter();
            dHNSSerializer.writeDhns(createWriter(stringWriter), dhns2);
            String s1 = stringWriter.toString();
            ProjectController pc = Lookup.getDefault().lookup(ProjectController.class);
            Workspace workspace3 = pc.newWorkspace(pc.getCurrentProject());
            pc.openWorkspace(workspace3);
            Lookup.getDefault().lookup(AttributeController.class).getModel();
            Dhns d2 = new Dhns(new DhnsGraphController(), workspace3);
            StringReader stringReader = new StringReader(s1);
            dHNSSerializer.readDhns(createReader(stringReader), d2);
            stringWriter = new StringWriter();
            dHNSSerializer.writeDhns(createWriter(stringWriter), d2);
            String s2 = stringWriter.toString();
            assertEquals(s1, s2);
        } catch (XMLStreamException ex) {
            Exceptions.printStackTrace(ex);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.