}
if (gm != null && gm != graphModel) {
reset();
}
gm = graphModel;
HierarchicalGraph graph;
if (graphModel.isDirected()) {
undirected = false;
graph = graphModel.getHierarchicalDirectedGraphVisible();
} else if (graphModel.isUndirected()) {
undirected = true;
graph = graphModel.getHierarchicalUndirectedGraphVisible();
} else if (graphModel.isMixed()) {
undirected = false;
graph = graphModel.getHierarchicalMixedGraphVisible();
} else {
undirected = false;
graph = graphModel.getHierarchicalDirectedGraphVisible();
}
if (dynamicModel == null) {
DynamicController dynamicController = Lookup.getDefault().lookup(DynamicController.class);
dynamicModel = dynamicController.getModel();
}
graphView = graph.getView().getViewId();
ModelClass[] object3dClasses = engine.getModelClasses();
graph.readLock();
ModelClass nodeClass = object3dClasses[AbstractEngine.CLASS_NODE];
if (nodeClass.isEnabled() && (graph.getNodeVersion() > nodeVersion || modeManager.requireModeChange())) {
updateNodes(graph);
nodeClass.setCacheMarker(cacheMarker);
}
ModelClass edgeClass = object3dClasses[AbstractEngine.CLASS_EDGE];
if (edgeClass.isEnabled() && (graph.getEdgeVersion() > edgeVersion || modeManager.requireModeChange())) {
updateEdges(graph);
updateMetaEdges(graph);
edgeClass.setCacheMarker(cacheMarker);
if (!undirected && vizConfig.isShowArrows()) {
object3dClasses[AbstractEngine.CLASS_ARROW].setCacheMarker(cacheMarker);
}
}
ModelClass potatoClass = object3dClasses[AbstractEngine.CLASS_POTATO];
if (potatoClass.isEnabled() && (graph.getNodeVersion() > nodeVersion || modeManager.requireModeChange())) {
updatePotatoes(graph);
potatoClass.setCacheMarker(cacheMarker);
}
nodeVersion = graph.getNodeVersion();
edgeVersion = graph.getEdgeVersion();
graph.readUnlock();
engine.worldUpdated(cacheMarker);
}