From e16c5bcac44adee9b2b4d638c076bf5611d76e50 Mon Sep 17 00:00:00 2001 From: lempinen Date: Tue, 21 Dec 2010 15:07:50 +0000 Subject: [PATCH] Removed duplicate arc creation git-svn-id: https://www.simantics.org/svn/simantics/sysdyn/trunk@19190 ac1ea38d-2e2b-0410-8846-a27921b304fc --- .../ui/elements2/connections/DependencyEdgeClass.java | 6 +----- .../sysdyn/ui/elements2/connections/DependencyNode.java | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java index fc3412ce..ab652a57 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyEdgeClass.java @@ -15,7 +15,6 @@ import java.awt.BasicStroke; import java.awt.Color; import java.awt.Shape; import java.awt.Stroke; -import java.awt.geom.Arc2D; import java.awt.geom.Path2D; import java.awt.geom.Rectangle2D; import java.beans.PropertyChangeEvent; @@ -104,8 +103,6 @@ public class DependencyEdgeClass { public static final Key KEY_SG_NODE = new SceneGraphNodeKey(DependencyNode.class, "EDGE_NODE"); - private transient Arc2D arc = new Arc2D.Double(); - @Override public void init(IElement e, G2DParentNode parent) { ElementUtils.getOrCreateNode(e, parent, KEY_SG_NODE, "edge_" + e.hashCode(), DependencyNode.class); @@ -186,8 +183,7 @@ public class DependencyEdgeClass { path = new Path2D.Double(); else path.reset(); - Dependencies.createArc(arc, beginTerminalShape.getBounds2D(), endTerminalShape.getBounds2D(), node.getAngle()); - path.append(arc, false); + path.append(node.getArc(), false); eh.setPath(e, path); } diff --git a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java index 03fdf329..1ccb00d2 100644 --- a/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java +++ b/org.simantics.sysdyn.ui/src/org/simantics/sysdyn/ui/elements2/connections/DependencyNode.java @@ -121,7 +121,11 @@ public class DependencyNode extends G2DNode implements ISelectionPainterNode, Mo public double getAngle() { return angle; } - + + public Arc2D getArc() { + return shapes.first; + } + @Override public void render(Graphics2D g) { if(beginBounds == null || endBounds == null) return; -- 2.47.1