X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=org.simantics.district.network%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fprofile%2FDNElementColorStyle.java;h=9bcae2e5f42e907231694ca559d7b68e64184416;hb=0a1b7351ff6fcf3724ee2b8e4121779ee6d42929;hp=fe0a1fe7f2ebce8bbbfdec501fce0a0032b6e544;hpb=fb4e5f02481e918807be83e87239a4d91b4343f2;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java b/org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java index fe0a1fe7..9bcae2e5 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java +++ b/org.simantics.district.network/src/org/simantics/district/network/profile/DNElementColorStyle.java @@ -3,7 +3,6 @@ package org.simantics.district.network.profile; import java.awt.Color; import java.util.Map; -import org.simantics.Simantics; import org.simantics.databoard.Bindings; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; @@ -40,7 +39,6 @@ public class DNElementColorStyle extends ThrottledStyleBase { DynamicVisualisation dv = graph.syncRequest(new RuntimeDynamicVisualisationsRequest(runtimeDiagram), TransientCacheAsyncListener.instance()); - DiagramSettings ds = graph.syncRequest(new DiagramSettingsRequest(runtimeDiagram), TransientCacheAsyncListener.instance()); // Prevent PendingVariableExceptions from coming through boolean wasSynchronous = graph.setSynchronous(true); try { @@ -72,7 +70,7 @@ public class DNElementColorStyle extends ThrottledStyleBase { // here we do the adjusting according to spec in #15038 double adjustedValue = possibleValue.doubleValue() * dcc.getVariableGain() + dcc.getVariableBias(); DynamicColorMap defaultColorMap = dcc.getDefaultColorMap(); - Color color = defaultColorMap.getColor(adjustedValue, dcc.getDefaultMin(), dcc.getDefaultMax()); + Color color = defaultColorMap.getColor(adjustedValue, dv.getColorBarOptions().isUseGradients(), dcc.getDefaultMin(), dcc.getDefaultMax()); return color; } else { LOGGER.warn("No value for {}", attribute.getURI(graph)); @@ -91,20 +89,6 @@ public class DNElementColorStyle extends ThrottledStyleBase { } } } - - // the old implementation here - if (ds.elementColoringFunction.isPresent()) { - if (DEBUG) - System.out.print("elementColoringFunction: " + ds.elementColoringFunction + "(" + groupItem + "): "); - Double t = Simantics.applySCLRead(graph, ds.elementColoringFunction.get(), groupItem); - if (DEBUG) - System.out.print(t); - if (t != null) { - Color result = ds.coloringGradient.get(t); - //System.out.println("color(" + t + "): " + result); - return result; - } - } } finally { graph.setSynchronous(wasSynchronous);