protected IMapping<DBObject,E> mapping;
protected VtkView view;
- protected MapList<E, vtkProp> nodeToActor = new MapList<E, vtkProp>();
- protected Map<vtkProp,E> actorToNode = new HashMap<vtkProp, E>();
+ private MapList<E, vtkProp> nodeToActor = new MapList<E, vtkProp>();
+ private Map<vtkProp,E> actorToNode = new HashMap<vtkProp, E>();
protected ParentNode<E> rootNode;
e.printStackTrace();
}
}
-
-
-
+
protected abstract void addActor(E node);
protected abstract void removeActor(E node);
protected abstract void updateActor(E node,Set<String> ids);
return nodeToActor.getValues((E)node);
}
+ protected <T extends vtkProp> void map(E node, Collection<T> props) {
+ for (vtkProp p : props) {
+ nodeToActor.add(node, p);
+ actorToNode.put(p, node);
+ }
+ }
+
+ protected void removeMap(E node) {
+ Collection<vtkProp> coll = nodeToActor.getValuesUnsafe(node);
+ for (vtkProp p : coll) {
+ actorToNode.remove(p);
+ }
+ nodeToActor.remove(node);
+ }
+
@SuppressWarnings("unchecked")
@Override
public ParentNode<E> getRootNode() {
added.add(new Pair<E, String>(node, id));
rangeModified = true;
}
- view.refresh();
+ repaint();
}
@SuppressWarnings("unchecked")
/**
* When objects are removed (either from Java or Graph), after remove processing the Java objects remain in mapping cache.
- * This causes problems with Undo and Redo, whcih the end up re-using the removed objects from mapping cache.
+ * This causes problems with Undo and Redo, which cause re-using the removed objects from mapping cache.
*
* This code here synchronizes removed and added objects to collect deletable objects. (a deletable object is one which is removed but not added).
*