if (partition != null) {
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
DynamicModel dynamicModel = model.getDynamicModel();
TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(partition.getColumn()) ? model.getNumberEstimator() : model.getEstimator();
PartitionFactory.buildNodePartition((NodePartition) partition, graphModel.getGraphVisible(), timeInterval, estimator);
}
model.setNodePartition(partition);
if (model.getNodeTransformerBuilder() == null) {
//Select the first transformer
TransformerBuilder[] builders = Lookup.getDefault().lookupAll(TransformerBuilder.class).toArray(new TransformerBuilder[0]);
for (int i = 0; i < builders.length; i++) {
TransformerBuilder t = builders[i];
if (t instanceof TransformerBuilder.Node) {
model.setNodeBuilder(t);
break;
}
}
}
model.setWaiting(false);
}
}, "Partition Model refresh");
t.start();
} else {
Thread t = new Thread(new Runnable() {
public void run() {
if (partition != null) {
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
DynamicModel dynamicModel = model.getDynamicModel();
TimeInterval timeInterval = dynamicModel != null ? dynamicModel.getVisibleInterval() : null;
Estimator estimator = AttributeUtils.getDefault().isDynamicNumberColumn(partition.getColumn()) ? model.getNumberEstimator() : model.getEstimator();
PartitionFactory.buildEdgePartition((EdgePartition) partition, graphModel.getGraphVisible(), timeInterval, estimator);
}
model.setEdgePartition(partition);
if (model.getEdgeTransformerBuilder() == null) {
//Select the first transformer