Package org.gephi.data.attributes.api

Examples of org.gephi.data.attributes.api.AttributeRow


                    writeTimeInterval(xmlWriter, timeInterval);
                }
            }

            if (exportAttributes && node.getNodeData().getAttributes() != null) {
                AttributeRow attributeRow = (AttributeRow) node.getNodeData().getAttributes();
                writeAttValues(xmlWriter, attributeRow, visibleInterval);
            }

            if (exportSize) {
                writeNodeSize(xmlWriter, node);
View Full Code Here


            if (exportColors) {
                writeEdgeColor(xmlWriter, edge);
            }

            if (exportAttributes && edge.getEdgeData().getAttributes() != null) {
                AttributeRow attributeRow = (AttributeRow) edge.getEdgeData().getAttributes();
                writeAttValues(xmlWriter, attributeRow, visibleInterval);
            }

            xmlWriter.writeEndElement();
            Progress.progress(progress);
View Full Code Here

                cc /= (network[v].length() * (network[v].length() - 1));
                if (!isDirected) {
                    cc *= 2.0f;
                }
                nodeClustering[v] = cc;
                AttributeRow row = (AttributeRow) network[v].node.getNodeData().getAttributes();
                row.setValue(clusteringCol, cc);
                row.setValue(triCount, triangles[v]);
                avgClusteringCoeff += cc;
            }
            Progress.progress(progress, ++ProgressCount);

            if (isCanceled) {
View Full Code Here

        Progress.start(progress, graph.getNodeCount());
        int i = 0;

        for (Node n : graph.getNodes()) {
            AttributeRow row = (AttributeRow) n.getNodeData().getAttributes();
            float totalWeight = 0;
            for (Iterator it = graph.getEdgesAndMetaEdges(n).iterator(); it.hasNext();) {
                Edge e = (Edge) it.next();
                totalWeight += e.getWeight();
            }

            row.setValue(degCol, totalWeight);
            avgWDegree += totalWeight;

            if (!degreeDist.containsKey(totalWeight)) {
                degreeDist.put(totalWeight, 0);
            }
View Full Code Here

        graph.readLock();

        Progress.start(progress, graph.getNodeCount());

        for (Node n : graph.getNodes()) {
            AttributeRow row = (AttributeRow) n.getNodeData().getAttributes();
            if (graph instanceof DirectedGraph) {
                HierarchicalDirectedGraph hdg = graph.getGraphModel().getHierarchicalDirectedGraph();
                int inDegree = hdg.getTotalInDegree(n);
                int outDegree = hdg.getTotalOutDegree(n);
                row.setValue(inCol, inDegree);
                row.setValue(outCol, outDegree);
                if (!inDegreeDist.containsKey(inDegree)) {
                    inDegreeDist.put(inDegree, 0);
                }
                inDegreeDist.put(inDegree, inDegreeDist.get(inDegree) + 1);
                if (!outDegreeDist.containsKey(outDegree)) {
                    outDegreeDist.put(outDegree, 0);
                }
                outDegreeDist.put(outDegree, outDegreeDist.get(outDegree) + 1);
            }
            int degree = graph.getTotalDegree(n);
            row.setValue(degCol, degree);
            avgDegree += degree;
            if (!degreeDist.containsKey(degree)) {
                degreeDist.put(degree, 0);
            }
            degreeDist.put(degree, degreeDist.get(degree) + 1);
View Full Code Here

            hubsCol = nodeTable.addColumn(HUB, "Hub", AttributeType.FLOAT, AttributeOrigin.COMPUTED, new Float(0));
        }

        for (Node s : hgraph.getNodes()) {
            int s_index = indicies.get(s);
            AttributeRow row = (AttributeRow) s.getNodeData().getAttributes();
            row.setValue(authorityCol, (float) authority[s_index]);
            row.setValue(hubsCol, (float) hubs[s_index]);
        }

        hgraph.readUnlockAll();
    }
View Full Code Here

            pangeRanksCol = nodeTable.addColumn(PAGERANK, "PageRank", AttributeType.DOUBLE, AttributeOrigin.COMPUTED, new Double(0));
        }

        for (Node s : hgraph.getNodes()) {
            int s_index = indicies.get(s);
            AttributeRow row = (AttributeRow) s.getNodeData().getAttributes();
            row.setValue(pangeRanksCol, pageranks[s_index]);
        }

        hgraph.readUnlockAll();
    }
View Full Code Here

            Progress.progress(progress);
        }

        for (int i = 0; i < N; i++) {
            Node s = indicies.get(i);
            AttributeRow row = (AttributeRow) s.getNodeData().getAttributes();
            row.setValue(eigenCol, centralities[i]);
            if (isCanceled) {
                return;
            }
        }
        hgraph.readUnlock();
View Full Code Here

            clearEdgeData(e, columnsToClear);
        }
    }

    public void clearRowData(Attributes row, AttributeColumn[] columnsToClear) {
        AttributeRow attributeRow = (AttributeRow) row;
        if (columnsToClear != null) {
            for (AttributeColumn column : columnsToClear) {
                //Clear all except id and computed attributes:
                if (canClearColumnData(column)) {
                    row.setValue(column.getIndex(), null);
                }
            }
        } else {
            AttributeValue[] values = attributeRow.getValues();
            for (int i = 0; i < values.length; i++) {
                //Clear all except id and computed attributes:
                if (canClearColumnData(values[i].getColumn())) {
                    row.setValue(i, null);
                }
View Full Code Here

        copyRowDataToOtherRows(row, otherRows, columnsToCopy);
    }

    public void copyRowDataToOtherRows(Attributes row, Attributes[] otherRows, AttributeColumn[] columnsToCopy) {
        AttributeRow attributeRow = (AttributeRow) row;
        if (columnsToCopy != null) {
            for (AttributeColumn column : columnsToCopy) {
                //Copy all except id and computed attributes:
                if (canChangeColumnData(column)) {
                    for (Attributes otherRow : otherRows) {
                        otherRow.setValue(column.getIndex(), row.getValue(column.getIndex()));
                    }
                }
            }
        } else {
            AttributeColumn column;
            AttributeValue[] values = attributeRow.getValues();
            for (int i = 0; i < values.length; i++) {
                column = values[i].getColumn();
                //Copy all except id and computed attributes:
                if (canChangeColumnData(column)) {
                    for (Attributes otherRow : otherRows) {
View Full Code Here

TOP

Related Classes of org.gephi.data.attributes.api.AttributeRow

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.