@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