* cleared because the previous preview graph is forgotten.
*
* @see PreviewController#buildGraph()
*/
public void buildGraph() {
GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
model.clearSupervisors();
graphModel.getGraph().readLock();
if (graphModel.isUndirected()) {
previewGraph = factory.createPreviewGraph(model, graphModel.getHierarchicalUndirectedGraphVisible());
} else if (graphModel.isDirected()) {
previewGraph = factory.createPreviewGraph(model, graphModel.getHierarchicalDirectedGraphVisible());
} else {
previewGraph = factory.createPreviewGraph(model, graphModel.getHierarchicalMixedGraphVisible());
}
graphModel.getGraph().readUnlockAll();
model.setUpdateFlag(true);
}