public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VTKNodeMap<DBObject,E>, IMappingListener, RenderListener, NodeListener, UndoRedoSupport.ChangeListener{
public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VTKNodeMap<DBObject,E>, IMappingListener, RenderListener, NodeListener, UndoRedoSupport.ChangeListener{
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractVTKNodeMap.class);
protected Session session;
private static final Logger LOGGER = LoggerFactory.getLogger(AbstractVTKNodeMap.class);
protected Session session;
undoOpCount = undoContext.getAll().size();
redoOpCount = undoContext.getRedoList().size();
} catch(DatabaseException e) {
undoOpCount = undoContext.getAll().size();
redoOpCount = undoContext.getRedoList().size();
} catch(DatabaseException e) {
UndoContext undoContext = undoRedoSupport.getUndoContext(session);
int ucount = undoContext.getAll().size();
int rcount = undoContext.getRedoList().size();
UndoContext undoContext = undoRedoSupport.getUndoContext(session);
int ucount = undoContext.getAll().size();
int rcount = undoContext.getRedoList().size();
@SuppressWarnings("unchecked")
private void receiveAdd(E node, String id, boolean db) {
@SuppressWarnings("unchecked")
private void receiveAdd(E node, String id, boolean db) {
synchronized (syncMutex) {
for (Pair<E, String> n : added) {
if (n.first.equals(node))
synchronized (syncMutex) {
for (Pair<E, String> n : added) {
if (n.first.equals(node))
@SuppressWarnings("unchecked")
private void receiveRemove(E node, String id, boolean db) {
@SuppressWarnings("unchecked")
private void receiveRemove(E node, String id, boolean db) {
synchronized (syncMutex) {
for (Pair<E, String> n : removed) {
if (n.first.equals(node))
synchronized (syncMutex) {
for (Pair<E, String> n : removed) {
if (n.first.equals(node))
synchronized (syncMutex) {
// for (Pair<E, String> n : updated) {
// if (n.first.equals(node))
synchronized (syncMutex) {
// for (Pair<E, String> n : updated) {
// if (n.first.equals(node))
session.syncRequest(new WriteRequest() {
@Override
public void perform(WriteGraph graph) throws DatabaseException {
session.syncRequest(new WriteRequest() {
@Override
public void perform(WriteGraph graph) throws DatabaseException {
if (commitMessage != null) {
Layer0Utils.addCommentMetadata(graph, commitMessage);
graph.markUndoPoint();
if (commitMessage != null) {
Layer0Utils.addCommentMetadata(graph, commitMessage);
graph.markUndoPoint();
} catch (InvocationTargetException | InterruptedException e) {
LOGGER.error("Unexpected exception", e);
}
}
} catch (InvocationTargetException | InterruptedException e) {
LOGGER.error("Unexpected exception", e);
}
}
session.asyncRequest(new UniqueRead<Object>() {
@Override
public Object perform(ReadGraph graph) throws DatabaseException {
session.asyncRequest(new UniqueRead<Object>() {
@Override
public Object perform(ReadGraph graph) throws DatabaseException {
private boolean useFullSyncWithUndo = false;
protected void update(ReadGraph graph) throws DatabaseException {
private boolean useFullSyncWithUndo = false;
protected void update(ReadGraph graph) throws DatabaseException {
- synchronized (syncMutex) {
- if (DEBUG) System.out.println("Graph update start");
-
- if (runUndo && useFullSyncWithUndo) {
+ if (LOGGER.isTraceEnabled()) LOGGER.trace("Graph update start");
+
+ if (runUndo && useFullSyncWithUndo) {
+ synchronized (syncMutex) {
protected void syncDeletes() {
deleteUC.clear();
for (Pair<E, String> n : removed) {
protected void syncDeletes() {
deleteUC.clear();
for (Pair<E, String> n : removed) {
for (Pair<E, String> n : added) {
deleteUC.remove(n.first);
}
for (Pair<E, String> n : added) {
deleteUC.remove(n.first);
}
//receiveAdd((E)child, rel ,graphUpdates);
receiveAdd((E)child, rel ,graphModified.contains(node));
}
//receiveAdd((E)child, rel ,graphUpdates);
receiveAdd((E)child, rel ,graphModified.contains(node));
}
//receiveRemove((E)child, rel, graphUpdates);
receiveRemove((E)child, rel, graphModified.contains(node));
//receiveRemove((E)child, rel, graphUpdates);
receiveRemove((E)child, rel, graphModified.contains(node));