Package org.gephi.graph.dhns

Examples of org.gephi.graph.dhns.DhnsGraphController


    public static void tearDownClass() throws Exception {
    }

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


        graphGlobal = null;
    }

    @Test
    public void testAddEdge() {
        DhnsGraphController controller = new DhnsGraphController();
        Dhns dhns = new Dhns(controller, null);
        HierarchicalUndirectedGraphImpl graph = new HierarchicalUndirectedGraphImpl(dhns, dhns.getGraphStructure().getMainView());
        TreeStructure treeStructure = dhns.getGraphStructure().getMainView().getStructure();
        GraphFactoryImpl factory = dhns.factory();
View Full Code Here

    public static void tearDownClass() throws Exception {
    }

    @Before
    public void setUp() {
        DhnsGraphController graphController = new DhnsGraphController();
        dhns = new Dhns(graphController, null);

        singleNode = dhns.factory().newNode();
        dhns.getDirectedGraph().addNode(singleNode);
        graph = dhns.getDirectedGraph();
View Full Code Here

    public static void tearDownClass() throws Exception {
    }

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

        TreeStructure treeStructure = dhnsGlobal.getGraphStructure().getMainView().getStructure();
        GraphFactoryImpl factory = dhnsGlobal.factory();

        //Nodes
        for (int i = 0; i < 15; i++) {
            AbstractNode node = factory.newNode();
            node.getNodeData().setLabel("Node " + i);
            graphGlobal.addNode(node);
            nodeMap.put(node.getNodeData().getLabel(), node);
        }

        //2
        controller = new DhnsGraphController();
        dhnsGlobal2 = new Dhns(controller, null);
        graphGlobal2Directed = new HierarchicalDirectedGraphImpl(dhnsGlobal2, dhnsGlobal2.getGraphStructure().getMainView());
        graphGlobal2Undirected = new HierarchicalUndirectedGraphImpl(dhnsGlobal2, dhnsGlobal2.getGraphStructure().getMainView());
        treeStructure = dhnsGlobal2.getGraphStructure().getMainView().getStructure();
        factory = dhnsGlobal2.factory();
View Full Code Here

        //treeStructure.showTreeAsTable();
    }

    @Test
    public void testView() {
        DhnsGraphController controller = new DhnsGraphController();
        Dhns dhns = new Dhns(controller, null);
        HierarchicalGraph graph = new HierarchicalDirectedGraphImpl(dhns, dhns.getGraphStructure().getMainView());

        TreeStructure treeStructure = dhns.getGraphStructure().getMainView().getStructure();
        GraphFactoryImpl factory = dhns.factory();
View Full Code Here

        assertEquals(1, graphGlobal2Directed.getHeight());
    }

    @Test
    public void testMetaEdgesAfterGrouping() {
        DhnsGraphController controller = new DhnsGraphController();
        Dhns dhns = new Dhns(controller, null);
        TreeStructure treeStructure = dhns.getGraphStructure().getMainView().getStructure();
        HierarchicalDirectedGraphImpl graph = new HierarchicalDirectedGraphImpl(dhns, dhns.getGraphStructure().getMainView());
        GraphFactoryImpl factory = dhns.factory();
View Full Code Here

    public static void tearDownClass() throws Exception {
    }

    @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>();
View Full Code Here

        pc.newProject();
        Workspace workspace = pc.getCurrentWorkspace();
        Lookup.getDefault().lookup(AttributeController.class).getModel();

        //Graph 1 - Multilevel sample without edges
        DhnsGraphController controller1 = new DhnsGraphController();
        dhns1 = new Dhns(controller1, workspace);
        graph1 = new HierarchicalDirectedGraphImpl(dhns1, dhns1.getGraphStructure().getMainView());
        GraphFactoryImpl factory1 = dhns1.factory();

        AbstractNode nodeA = factory1.newNode();
        AbstractNode nodeB = factory1.newNode();
        AbstractNode nodeC = factory1.newNode();
        AbstractNode nodeD = factory1.newNode();
        AbstractNode nodeE = factory1.newNode();
        graph1.addNode(nodeA);
        graph1.addNode(nodeB);
        graph1.addNode(nodeC, nodeA);
        graph1.addNode(nodeE, nodeB);
        graph1.addNode(nodeD, nodeA);
        graph1.addNode(nodeD, nodeB);

        //Graph2 - Directed sample with edges
        Workspace workspace2 = pc.newWorkspace(pc.getCurrentProject());
        pc.openWorkspace(workspace2);
        Lookup.getDefault().lookup(AttributeController.class).getModel();
        nodeMap2 = new HashMap<String, Node>();
        DhnsGraphController controller2 = new DhnsGraphController();
        dhns2 = new Dhns(controller2, workspace2);
        graph2 = new HierarchicalDirectedGraphImpl(dhns2, dhns2.getGraphStructure().getMainView());
        GraphFactoryImpl factory2 = dhns2.factory();

        for (int i = 0; i < 10; i++) {
View Full Code Here

            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();
View Full Code Here

    }

    @Before
    public void setUp() {
        nodeMap = new HashMap<String, AbstractNode>();
        DhnsGraphController controller = new DhnsGraphController();
        dhns1 = new Dhns(controller, null);
        graph1 = new HierarchicalDirectedGraphImpl(dhns1, dhns1.getGraphStructure().getMainView());
        GraphFactoryImpl factory = dhns1.factory();

        AbstractNode nodeA = factory.newNode();
View Full Code Here

TOP

Related Classes of org.gephi.graph.dhns.DhnsGraphController

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.