import java.awt.Color;
import java.awt.Composite;
+import java.awt.Graphics2D;
import java.awt.Stroke;
import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
import org.simantics.diagram.connection.RouteGraph;
import org.simantics.scenegraph.INode;
+import org.simantics.scenegraph.g2d.G2DRenderingHints;
import org.simantics.scenegraph.g2d.IG2DNode;
import org.simantics.scenegraph.g2d.events.MouseEvent;
import org.simantics.scenegraph.g2d.nodes.connection.RouteGraphNode;
return false;
}
+ @Override
+ public void beforeRender(Graphics2D g) {
+ g.setRenderingHint(G2DRenderingHints.KEY_BEGIN_ELEMENT, "connection");
+ }
+
+ @Override
+ public void afterRender(Graphics2D g) {
+ g.setRenderingHint(G2DRenderingHints.KEY_END_ELEMENT, "connection");
+ }
+
+ @Override
+ public Rectangle2D getBoundsInLocal() {
+ // #134: Route graph connections render their own selection.
+ // ElementPainter will place an empty G2DParentNode
+ // called "selection" under this ConnectionNode which
+ // should be ignored in bounds calculations.
+ // Otherwise this node will not support being inserted
+ // into a spatial search structure and further selections
+ // will fail.
+ return super.getBoundsInLocal(true);
+ }
+
}