X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.network%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fprofile%2FEdgeThicknessStyle.java;h=b305c39148bd284bfea3b96ee1cbf6221226e198;hb=39fc97fadfc37361c1e937b87cf33f1964688cfa;hp=06dcdf3f05e8fc3d0ff6327e75ff7486ee3b893a;hpb=8958c9b265fc6a842c76714b60f0d99740434243;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java b/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java index 06dcdf3f..b305c391 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java +++ b/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java @@ -19,17 +19,25 @@ public class EdgeThicknessStyle extends ThrottledStyleBase { @Override public Double calculateThrottledStyle(ReadGraph graph, Resource runtimeDiagram, Resource entry, Resource groupItem) throws DatabaseException { DiagramSettings ds = graph.syncRequest(new DiagramSettingsRequest(runtimeDiagram), TransientCacheAsyncListener.instance()); - Double thickness = ONE; - if (ds.edgeThicknessProperty.isPresent()) { - thickness = Simantics.applySCLRead(graph, ds.edgeThicknessProperty.get(), groupItem); -// System.out.println("read thickness: " + thickness + " : " + ds.edgeThicknessProperty); - if (thickness == null) { - thickness = ONE; - } else { - thickness = thickness * ds.edgeThicknessGain + ds.edgeThicknessBias; + // Prevent PendingVariableExceptions from coming through + boolean wasSynchronous = graph.setSynchronous(true); + try { + Double thickness = ONE; + if (ds.edgeThicknessProperty.isPresent()) { + thickness = Simantics.applySCLRead(graph, ds.edgeThicknessProperty.get(), groupItem); + // System.out.println("read thickness: " + thickness + " : " + ds.edgeThicknessProperty); + if (thickness == null) { + thickness = ONE; + } else { + thickness = thickness * ds.edgeThicknessGain + ds.edgeThicknessBias; + } } + + return thickness; + } + finally { + graph.setSynchronous(wasSynchronous); } - return thickness; } @Override