]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Minor GraphLayerManager fixes 12/312/1
authorjsimomaa <jani.simomaa@gmail.com>
Wed, 1 Feb 2017 09:58:41 +0000 (11:58 +0200)
committerjsimomaa <jani.simomaa@gmail.com>
Wed, 1 Feb 2017 10:03:24 +0000 (12:03 +0200)
refs #6958

Change-Id: I476367efad804f11e028006813cb5c1211f2cd8f

bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java

index 41947ef993c49bc937b39eedddb0a0cbf3d25460..e92ce1b41da779df96b1d08359241a7b959fa6b1 100644 (file)
@@ -433,8 +433,10 @@ public class GraphLayerManager {
                 graph.forHasStatement(element, gl.getVisible(), element, new AsyncProcedureAdapter<Boolean>() {
                     @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<Boolean>() {
                     @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() + "'");