GraphModel graphModel = graphController.getGraphModel();
AttributeModel attributeModel = graphController.getAttributeModel();
double window = statistics.getWindow();
double tick = statistics.getTick();
Interval bounds = statistics.getBounds();
if (bounds == null) {
bounds = graphModel.getTimeBoundsVisible();
statistics.setBounds(bounds);
}
if (dynamicLongTask != null) {
//Count
int c = (int) ((bounds.getHigh() - window - bounds.getLow()) / tick);
dynamicLongTask.start(c);
}
//Init
statistics.execute(graphModel, attributeModel);
//Loop
for (double low = bounds.getLow(); low <= bounds.getHigh() - window; low += tick) {
double high = low + window;
// Graph g = dynamicGraph.getSnapshotGraph(low, high);
GraphView currentView = graphModel.getVisibleView();
Graph graph = graphModel.getGraphVisible();
GraphView view = graphModel.createView();
Graph g = graphModel.getGraph(view);
TimestampIndex<Node> nodeIndex = graphModel.getNodeTimestampIndex(currentView);
for(Node node : nodeIndex.get(low, high)) {
g.addNode(node);
}
TimestampIndex<Edge> edgeIndex = graphModel.getEdgeTimestampIndex(currentView);
for(Edge edge : edgeIndex.get(low, high)) {
g.addEdge(edge);
}
statistics.loop(g.getView(), new Interval(low, high));
//Cancelled?
if (dynamicLongTask != null && dynamicLongTask.isCancelled()) {
return;
} else if (dynamicLongTask != null) {