From cf8245d265c4fa33458768ef1ae2a11dbe5a6053 Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Wed, 1 Feb 2017 11:58:41 +0200 Subject: [PATCH] Minor GraphLayerManager fixes refs #6958 Change-Id: I476367efad804f11e028006813cb5c1211f2cd8f --- .../graph/layer/GraphLayerManager.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java index 41947ef99..e92ce1b41 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java @@ -433,8 +433,10 @@ public class GraphLayerManager { graph.forHasStatement(element, gl.getVisible(), element, new AsyncProcedureAdapter() { @Override public void execute(AsyncReadGraph graph, Boolean result) { - synchronized (visible) { - visible.add(l); + if (result) { + synchronized (visible) { + visible.add(l); + } } if (DEBUG_LAYERS) System.out.println(" Visible on layer '" + gl.getName() + "'"); @@ -452,8 +454,10 @@ public class GraphLayerManager { graph.forHasStatement(element, gl.getFocusable(), element, new AsyncProcedureAdapter() { @Override public void execute(AsyncReadGraph graph, Boolean result) { - synchronized (focusable) { - focusable.add(l); + if (result) { + synchronized (focusable) { + focusable.add(l); + } } if (DEBUG_LAYERS) System.out.println(" Focusable on layer '" + gl.getName() + "'"); -- 2.47.0