Examples of readLock()


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

                    } 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

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

        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

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

        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

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

        return nodesCount;
    }

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

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

    public boolean removeNodeFromGroup(Node node) {
        if (isNodeInGroup(node)) {
            HierarchicalGraph hg = getHierarchicalGraph();
            Node parent = hg.getParent(node);
            hg.readLock();
            int childrenCount = hg.getChildrenCount(parent);
            hg.readUnlock();
            if (childrenCount == 1) {
                hg.ungroupNodes(parent);//Break group when the last child is removed.
            } else {
View Full Code Here

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

        }
        AttributeColumn edgeCol = am.getEdgeTable().getColumn("filter_" + title);
        if (edgeCol == null) {
            edgeCol = am.getEdgeTable().addColumn("filter_" + title, title, AttributeType.BOOLEAN, AttributeOrigin.COMPUTED, Boolean.FALSE);
        }
        result.readLock();
        for (Node n : result.getNodes()) {
            n.getNodeData().getAttributes().setValue(nodeCol.getIndex(), Boolean.TRUE);
        }
        for (Edge e : result.getEdgesAndMetaEdges()) {
            e.getEdgeData().getAttributes().setValue(edgeCol.getIndex(), Boolean.TRUE);
View Full Code Here

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

        } else {
            FilterProcessor processor = new FilterProcessor();
            result = (HierarchicalGraph) processor.process((AbstractQueryImpl) query, model.getGraphModel());
        }
        HierarchicalGraph fullHGraph = model.getGraphModel().getHierarchicalGraph();
        fullHGraph.readLock();
        for (Node n : fullHGraph.getNodes()) {
            boolean inView = n.getNodeData().getNode(result.getView().getViewId()) != null;
            n.getNodeData().getTextData().setVisible(inView);
        }
        for (Edge e : fullHGraph.getEdgesAndMetaEdges()) {
View Full Code Here

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

        graphView = graph.getView().getViewId();

        ModelClass[] object3dClasses = engine.getModelClasses();

        graph.readLock();



        ModelClass nodeClass = object3dClasses[AbstractEngine.CLASS_NODE];
        if (nodeClass.isEnabled() && (graph.getNodeVersion() > nodeVersion || modeManager.requireModeChange())) {
View Full Code Here

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

            graph = graphModel.getHierarchicalGraphVisible();
        } else {
            graph = graphModel.getHierarchicalGraph();
        }
        Progress.start(progress);
        graph.readLock();

        //Options
        if (normalize) {
            calculateMinMax(graph);
        }
View Full Code Here

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

        isDirected = graphModel.isDirected();
        isCanceled = false;

        UndirectedGraph undirectedGraph = graphModel.getUndirectedGraphVisible();

        undirectedGraph.readLock();

        weaklyConnected(undirectedGraph, attributeModel);
        if (isDirected) {
            DirectedGraph directedGraph = graphModel.getDirectedGraphVisible();
            stronglyConnected(directedGraph, attributeModel);
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.