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