Package org.gephi.graph.api

Examples of org.gephi.graph.api.Graph.readLock()


                if (sourceId == null || sourceId.isEmpty() || targetId == null || targetId.isEmpty()) {
                    continue;//No correct source and target ids were provided, ignore row
                }

                graph.readLock();
                source = graph.getNode(sourceId);
                graph.readUnlock();

                if (source == null) {
                    if (createNewNodes) {//Create new nodes when they don't exist already and option is enabled
View Full Code Here


                    } else {
                        continue;//Ignore this edge row, since no new nodes should be created.
                    }
                }

                graph.readLock();
                target = graph.getNode(targetId);
                graph.readUnlock();

                if (target == null) {
                    if (createNewNodes) {//Create new nodes when they don't exist already and option is enabled
View Full Code Here

            graph = graphModel.getDirectedGraph(window);
        } else {
            graph = graphModel.getUndirectedGraph(window);
        }

        graph.readLock();

        clusteringCoefficientStat = new ClusteringCoefficient();
        clusteringCoefficientStat.setDirected(isDirected);
        clusteringCoefficientStat.triangles(graph);
View Full Code Here

        return getGraph().getEdges(node).toArray();
    }

    public int getNodesCount() {
        Graph graph = getGraph();
        graph.readLock();
        int nodesCount = graph.getNodeCount();
        graph.readUnlock();
        return nodesCount;
    }
View Full Code Here

        return nodesCount;
    }

    public int getEdgesCount() {
        Graph graph = getGraph();
        graph.readLock();
        int edgesCount = graph.getEdgeCount();
        graph.readUnlock();
        return edgesCount;
    }
View Full Code Here

        HashMap<Integer, Node> nodeMap = new HashMap<Integer, Node>();
        HashMap<Node, Integer> intMap = new HashMap<Node, Integer>();

        Graph graph = graphModel.getGraphVisible();
        graph.readLock();

        //Load matrix
        SparseMatrix matrix = new SparseMatrix();
        int nodeId = 0;
        for (Edge e : graph.getEdges()) {
View Full Code Here

            graph = graphModel.getGraphVisible();
        } else {
            graph = graphModel.getGraph();
        }

        graph.readLock();


        //nodes are counted twice, because they are printed in exportNodeData and exportNodeProperties
        progressTicket.start(graph.getNodeCount() * 2 + graph.getEdgeCount());

View Full Code Here

        } else {
            graph = graphModel.getGraph();
        }
        progressTicket.start(graph.getNodeCount() + graph.getEdgeCount());

        graph.readLock();

        if (normalize) {
            computeNormalizeValues(graph);
        }
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.