Examples of HierarchicalUndirectedGraphImpl


Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

        //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();

        //Nodes
        for (int i = 0; i < 3; i++) {
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    @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>();

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

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    @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();

        Node node1 = factory.newNode();
        Node node2 = factory.newNode();
        Node node3 = factory.newNode();
        graph.addNode(node1);
        graph.addNode(node2);
        graph.addNode(node3);

        //Test normal edge
        graph.addEdge(node1, node2);
        AbstractNode preNode1 = (AbstractNode) node1;
        AbstractNode preNode2 = (AbstractNode) node2;

        AbstractEdge edge = preNode1.getEdgesOutTree().getItem(preNode2.getNumber());
        assertNotNull("find OUT edge", edge);
        assertTrue("contains OUT edge", preNode1.getEdgesOutTree().contains(edge));

        AbstractEdge edge2 = preNode2.getEdgesInTree().getItem(preNode1.getNumber());
        assertNotNull("find IN edge", edge);
        assertTrue("contains IN edge", preNode2.getEdgesInTree().contains(edge2));
        assertSame("edges equal", edge, edge2);
        assertEquals("edges count", 1, graph.getEdgeCount());

        //Test mutual edge add fail
        graph.addEdge(node2, node1);

        assertNull("cant find OUT edge", preNode2.getEdgesOutTree().getItem(preNode1.getNumber()));
        assertEquals("edges count", 1, graph.getEdgeCount());


        //Test factoryedge
        graph.addEdge(edge);
        assertEquals("edges count", 1, graph.getEdgeCount());

        //Test self loop
        graph.addEdge(node3, node3);

        AbstractNode preNode3 = (AbstractNode) node3;

        AbstractEdge edge3 = preNode3.getEdgesOutTree().getItem(preNode3.getNumber());
        assertNotNull("find OUT edge", edge);
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    public DirectedGraph getDirectedGraph() {
        return new HierarchicalDirectedGraphImpl(this, graphStructure.getMainView());
    }

    public UndirectedGraph getUndirectedGraph() {
        return new HierarchicalUndirectedGraphImpl(this, graphStructure.getMainView());
    }
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    public HierarchicalMixedGraph getHierarchicalMixedGraph() {
        return new HierarchicalMixedGraphImpl(this, graphStructure.getMainView());
    }

    public HierarchicalUndirectedGraph getHierarchicalUndirectedGraph() {
        return new HierarchicalUndirectedGraphImpl(this, graphStructure.getMainView());
    }
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    public HierarchicalMixedGraph getHierarchicalMixedGraph(GraphView view) {
        return new HierarchicalMixedGraphImpl(this, (GraphViewImpl) view);
    }

    public HierarchicalUndirectedGraph getHierarchicalUndirectedGraph(GraphView view) {
        return new HierarchicalUndirectedGraphImpl(this, (GraphViewImpl) view);
    }
View Full Code Here

Examples of org.gephi.graph.dhns.graph.HierarchicalUndirectedGraphImpl

    public MixedGraph getMixedGraph(GraphView view) {
        return new HierarchicalMixedGraphImpl(this, (GraphViewImpl) view);
    }

    public UndirectedGraph getUndirectedGraph(GraphView view) {
        return new HierarchicalUndirectedGraphImpl(this, (GraphViewImpl) view);
    }
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.