}
weight += 1;
locationWeights.put(location, weight);
}
Graph graph = new Graph();
Location rootLocation = locations.get(rootPath);
if (rootLocation == null) return;
Node rootNode = new Node(rootLocation.px, rootLocation.py, 1, rootLocation.getDocument());
graph.addNode(rootNode);
graph.setRootNode(rootNode);
for (Location each: locationWeights.keySet()) {
Integer weight = locationWeights.get(each);
Node node = new Node(each.px, each.py, weight, each.getDocument());
graph.addNode(node);
}
graphs.add(graph);
}