Package org.gephi.graph.dhns.core

Examples of org.gephi.graph.dhns.core.Dhns


    public DhnsGraphController() {
        iDGen = new IDGen();
    }

    public Dhns newDhns(Workspace workspace) {
        Dhns dhns = new Dhns(this, workspace);
        workspace.add(dhns);
        return dhns;
    }
View Full Code Here


    private synchronized Dhns getCurrentDhns() {
        Workspace currentWorkspace = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace();
        if (currentWorkspace == null) {
            return null;
        }
        Dhns dhns = currentWorkspace.getLookup().lookup(Dhns.class);
        if (dhns == null) {
            dhns = newDhns(currentWorkspace);
        }
        return dhns;
    }
View Full Code Here

        }
        return dhns;
    }

    public GraphModel getModel(Workspace workspace) {
        Dhns dhns = workspace.getLookup().lookup(Dhns.class);
        if (dhns == null) {
            dhns = newDhns(workspace);
        }
        return dhns;
    }
View Full Code Here

*/
@ServiceProvider(service = WorkspacePersistenceProvider.class, position = 12000)
public class DataPersistenceProvider implements WorkspacePersistenceProvider {

    public void writeXML(XMLStreamWriter writer, Workspace workspace) {
        Dhns dhns = workspace.getLookup().lookup(Dhns.class);
        DataSerializer serializer = new DataSerializer();
        try {
            serializer.writeData(writer, dhns);
        } catch (XMLStreamException ex) {
            throw new RuntimeException(ex);
View Full Code Here

            throw new RuntimeException(ex);
        }
    }

    public void readXML(XMLStreamReader reader, Workspace workspace) {
        Dhns dhns = workspace.getLookup().lookup(Dhns.class);
        DataSerializer serializer = new DataSerializer();
        try {
            serializer.readData(reader, dhns);
        } catch (XMLStreamException ex) {
            throw new RuntimeException(ex);
View Full Code Here

@ServiceProvider(service = WorkspaceDuplicateProvider.class, position = 1000)
public class DhnsDuplicateProvider implements WorkspaceDuplicateProvider {

    public void duplicate(Workspace source, Workspace destination) {
        GraphController controller = Lookup.getDefault().lookup(GraphController.class);
        Dhns sourceModel = (Dhns) controller.getModel(source);
        Dhns destModel = (Dhns) controller.getModel(destination);
        if (sourceModel != null && destModel != null) {
            sourceModel.getDuplicateManager().duplicate(destModel);
        }
    }
View Full Code Here

@ServiceProvider(service = WorkspacePersistenceProvider.class, position = 10000)
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

        }
    }

    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

    }

    @Before
    public void setUp() {
        DhnsGraphController controller = new DhnsGraphController();
        dhnsGlobal = new Dhns(controller, null);
        graphGlobal = new HierarchicalDirectedGraphImpl(dhnsGlobal, dhnsGlobal.getGraphStructure().getMainView());
        nodeMap = new HashMap<String, Node>();
        edgeMap = new HashMap<String, Edge>();

        TreeStructure treeStructure = dhnsGlobal.getGraphStructure().getMainView().getStructure();
View Full Code Here

TOP

Related Classes of org.gephi.graph.dhns.core.Dhns

Copyright © 2018 www.massapicom. 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.