protected void removeMap(E node) {
Collection<vtkProp> coll = nodeToActor.getValuesUnsafe(node);
- for (vtkProp p : coll) {
- actorToNode.remove(p);
+ if (coll.size() > 0) {
+ view.lock();
+ for (vtkProp p : coll) {
+ actorToNode.remove(p);
+ if (p.GetVTKId() != 0) {
+ view.getRenderer().RemoveActor(p);
+ p.Delete();
+ }
+ }
+ view.unlock();
}
nodeToActor.remove(node);
}
if (runUndo && useFullSyncWithUndo) {
reset(graph);
} else {
- synchronized (syncMutex) {
+ synchronized (syncMutex) {
graphUpdates = true;
for (DBObject domainObject : mapping.getDomainModified()) {
@SuppressWarnings("unchecked")
syncDeletes();
clearDeletes();
graphUpdates = false;
- }
+ }
}
if (mapping.isRangeModified() && !runUndo && !runRedo)
E n = stack.pop();
boolean conflict = filterChange(removed, n);
if (conflict) {
- System.out.println("Prevent removing " + n);
+ if (DEBUG) System.out.println("Prevent removing " + n);
//filterChange(added, n)
if (filterChange(added, n))
- System.out.println("Prevent adding " + n);
+ if (DEBUG) System.out.println("Prevent adding " + n);
}
if (n instanceof ParentNode) {
ParentNode<INode> pn = (ParentNode<INode>)n;
}
-
for (Pair<E, String> n : rem) {
stopListening(n.first);
removeActor(n.first);
+ n.first.remove();
}
- for (Pair<E, String> n : add) {
- addActor(n.first);
- listen(n.first);
- }
+ for (Pair<E, String> n : add) {
+ addActor(n.first);
+ listen(n.first);
+ }
for (E e : mod.getKeys()) {
Set<String> ids = mod.getValues(e);
}
}
-// synchronized (syncMutex) {
-// rem.addAll(removed);
-// add.addAll(added);
-// //mod.addAll(updated);
-// for (E e : updated.getKeys()) {
-// for (String s : updated.getValues(e))
-// mod.add(e, s);
-// }
-//
-// removed.clear();
-// added.clear();
-// updated.clear();
-// }
-
for (E e : mod.getKeys()) {
Set<String> ids = mod.getValues(e);
updateActor(e,ids);
}
-
-
+
for (Pair<E, String> n : rem) {
for (NodeListener l : nodeListeners)
l.nodeRemoved(null, n.first, n.second);
//FIXME : 1. sometimes removed structural models cause ObjMap to add their children again.
// removing the listener here prevents corruption of visual model, but better fix is needed.
- // 2. detach causes nodeRemoved event, which then causes other critical events to be missed. Took out th
+ // 2. detach causes nodeRemoved event, which then causes other critical events to be missed. Took out call:
//stopListening(child);
}