]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/synchronization/graph/layer/GraphLayerManager.java
Combination of Simantics-platform related changes and fixes for district
[simantics/platform.git] / 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() + "'");