]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram/src/org/simantics/diagram/connection/ConnectionVisuals.java
Support VirtualGraph in GraphToDiagramSynchronizer and DiagramSGProvider
[simantics/platform.git] / bundles / org.simantics.diagram / src / org / simantics / diagram / connection / ConnectionVisuals.java
index 5f62ac31469798b15ac2d95ec2712a75b108bcc2..d89c07c4f3a82034fa5700e819dc8a299f3c2224 100644 (file)
@@ -28,6 +28,10 @@ public class ConnectionVisuals {
     public final Double branchPointRadius;
     public final Double rounding;
 
+    public ConnectionVisuals(float[] color, StrokeType strokeType, Stroke stroke, Double rounding) {
+       this(color, strokeType, stroke, null, rounding);
+    }
+
     public ConnectionVisuals(float[] color, StrokeType strokeType, Stroke stroke, Double branchPointRadius, Double rounding) {
         if (color != null && color.length < 3)
             throw new IllegalArgumentException("colors must have at least 3 components (rgb), got " + color.length);
@@ -42,8 +46,8 @@ public class ConnectionVisuals {
         if (color == null)
             return null;
         if (color.length == 3)
-            return new Color(color[2], color[1], color[0]);
-        return new Color(color[2], color[1], color[0], color[3]);
+            return new Color(color[0], color[1], color[2]);
+        return new Color(color[0], color[1], color[2], color[3]);
     }
 
     @Override