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;fp=org.simantics.district.network%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fnetwork%2Fprofile%2FEdgeStyle.java;h=45b55549333848a94c3d808fbfe4e824e94af877;hb=29914be09d4a237840e5c793bdb562ec83093b8d;hp=4ee26ad4f7b00f1014668d78feeeed2d8443e0eb;hpb=10fe42db158693adffc526131d37f58cbd5780b2;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeStyle.java b/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java similarity index 83% rename from org.simantics.district.network/src/org/simantics/district/network/profile/EdgeStyle.java rename to org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java index 4ee26ad4..45b55549 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeStyle.java +++ b/org.simantics.district.network/src/org/simantics/district/network/profile/EdgeThicknessStyle.java @@ -1,6 +1,6 @@ package org.simantics.district.network.profile; -import org.simantics.databoard.Bindings; +import org.simantics.Simantics; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; @@ -12,7 +12,7 @@ import org.simantics.scenegraph.g2d.nodes.ConnectionNode; import org.simantics.scenegraph.profile.EvaluationContext; import org.simantics.scenegraph.profile.common.ProfileVariables; -public class EdgeStyle extends StyleBase { +public class EdgeThicknessStyle extends StyleBase { private static final Double PENDING = Double.NaN; private static final Double ONE = 1.0; @@ -22,12 +22,12 @@ public class EdgeStyle extends StyleBase { DiagramSettings ds = graph.syncRequest(new DiagramSettingsRequest(runtimeDiagram), TransientCacheAsyncListener.instance()); Double thickness = ONE; if (ds.edgeThicknessProperty.isPresent()) { - thickness = graph.getPossibleRelatedValue2(groupItem, ds.edgeThicknessProperty.get(), Bindings.DOUBLE); - //System.out.println("read thickness: " + thickness + " : " + ds.edgeThicknessProperty); + 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.edgeThicknessScale; + thickness = thickness * ds.edgeThicknessGain + ds.edgeThicknessBias; } } return thickness; @@ -35,7 +35,7 @@ public class EdgeStyle extends StyleBase { @Override public void applyStyleForNode(EvaluationContext observer, INode node, Double value) { - //System.out.println("apply: " + node + " : " + value); +// System.out.println("apply: " + node + " : " + value); ConnectionNode n = (ConnectionNode) node; if (value == PENDING) { ((G2DSceneGraph)node.getRootNode()).setPending(node);