public Double calculateThrottledStyle(ReadGraph graph, Resource runtimeDiagram, Resource entry, Resource groupItem) throws DatabaseException {
DiagramSettings ds = graph.syncRequest(new DiagramSettingsRequest(runtimeDiagram), TransientCacheAsyncListener.instance());
Double scaling = ONE;
- if (ds.vertexScaleProperty.isPresent()) {
- scaling = Simantics.applySCLRead(graph, ds.vertexScaleProperty.get(), groupItem);
- if (scaling == null) {
- scaling = ONE;
- } else {
-// System.out.println("read vertex scaling: " + scaling + " : " + ds.vertexScaleProperty);
- scaling = scaling * ds.vertexScaleGain + ds.vertexScaleBias;
-// System.out.println("RESULT: " + scaling);
+ // Prevent PendingVariableExceptions from coming through
+ boolean wasSynchronous = graph.setSynchronous(true);
+ try {
+ if (ds.vertexScaleProperty.isPresent()) {
+ scaling = Simantics.applySCLRead(graph, ds.vertexScaleProperty.get(), groupItem);
+ if (scaling == null) {
+ scaling = ONE;
+ } else {
+ // System.out.println("read vertex scaling: " + scaling + " : " + ds.vertexScaleProperty);
+ scaling = scaling * ds.vertexScaleGain + ds.vertexScaleBias;
+ // System.out.println("RESULT: " + scaling);
+ }
}
+ return scaling;
+ }
+ finally {
+ graph.setSynchronous(wasSynchronous);
}
- return scaling;
}
@Override