X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fconnection%2FConnectionVisuals.java;h=802881e1610efa52d787e0670edddb4c291e45de;hp=5aa8048acb7e5d415936a96c2a5dc5e30cdec3f4;hb=a04499b2328562e789c1dc3a4f6d2dda3f663f3d;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/connection/ConnectionVisuals.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/connection/ConnectionVisuals.java index 5aa8048ac..802881e16 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/connection/ConnectionVisuals.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/connection/ConnectionVisuals.java @@ -25,13 +25,21 @@ public class ConnectionVisuals { public final float[] color; public final StrokeType strokeType; public final Stroke stroke; + public final Double branchPointRadius; + public final Double rounding; - public ConnectionVisuals(float[] color, StrokeType strokeType, Stroke stroke) { + 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); this.color = color; this.strokeType = strokeType; this.stroke = stroke; + this.branchPointRadius = branchPointRadius; + this.rounding = rounding; } public Color toColor() { @@ -46,7 +54,9 @@ public class ConnectionVisuals { public int hashCode() { final int prime = 31; int result = 1; + result = prime * result + ((branchPointRadius == null) ? 0 : branchPointRadius.hashCode()); result = prime * result + Arrays.hashCode(color); + result = prime * result + ((rounding == null) ? 0 : rounding.hashCode()); result = prime * result + ((stroke == null) ? 0 : stroke.hashCode()); result = prime * result + ((strokeType == null) ? 0 : strokeType.hashCode()); return result; @@ -58,22 +68,28 @@ public class ConnectionVisuals { return true; if (obj == null) return false; - if (!(obj instanceof ConnectionVisuals)) + if (getClass() != obj.getClass()) return false; ConnectionVisuals other = (ConnectionVisuals) obj; + if (branchPointRadius == null) { + if (other.branchPointRadius != null) + return false; + } else if (!branchPointRadius.equals(other.branchPointRadius)) + return false; if (!Arrays.equals(color, other.color)) return false; + if (rounding == null) { + if (other.rounding != null) + return false; + } else if (!rounding.equals(other.rounding)) + return false; if (stroke == null) { if (other.stroke != null) return false; } else if (!stroke.equals(other.stroke)) return false; - if (strokeType == null) { - if (other.strokeType != null) - return false; - } else if (!strokeType.equals(other.strokeType)) + if (strokeType != other.strokeType) return false; return true; } - }