]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scenegraph/src/org/simantics/scenegraph/g2d/nodes/connection/RouteGraphNode.java
Diagram to SVG enhancements
[simantics/platform.git] / bundles / org.simantics.scenegraph / src / org / simantics / scenegraph / g2d / nodes / connection / RouteGraphNode.java
index ad71bb126185c1ef6c49bcb3e5c654440b19171f..687731f4c2f9d8528ab40cc0c6189151672828f4 100644 (file)
@@ -124,12 +124,22 @@ public class RouteGraphNode extends G2DNode implements ISelectionPainterNode, In
 
     protected transient Map<Object,ILineEndStyle> dynamicStyles = null;
     
+    private transient boolean ignoreSelection = false;
+    
     @Override
     public void initValues() {
         dynamicColor = null;
         wrapRenderer();
     }
 
+    public void setIgnoreSelection(boolean value) {
+        ignoreSelection = value;
+    }
+    
+    public boolean getIgnoreSelection() {
+        return ignoreSelection;
+    }  
+  
     @PropertySetter("color")
     @SyncField(value = {"dynamicColor"})
     public void setDynamicColor(Color color) {
@@ -215,20 +225,20 @@ public class RouteGraphNode extends G2DNode implements ISelectionPainterNode, In
         if(dynamicColor != null || dynamicStroke != null) {
             BasicConnectionStyle baseStyle = (BasicConnectionStyle)tryGetStyle(baseRenderer);
             try {
-               Constructor<? extends BasicConnectionStyle> c = baseStyle.getClass().getConstructor(Color.class, Color.class, double.class, Stroke.class, Stroke.class, double.class);
+               Constructor<? extends BasicConnectionStyle> c = baseStyle.getClass().getConstructor(Color.class, Color.class, double.class, Stroke.class, Stroke.class, double.class, double.class);
                renderer = new StyledRouteGraphRenderer(c.newInstance(
                         dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
                                 baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
                                     dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(), 
                                             dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
-                                                    baseStyle.getDegeneratedLineLength()));
+                                                    baseStyle.getDegeneratedLineLength(), baseStyle.getRounding()));
             } catch (Exception e) {
                renderer = new StyledRouteGraphRenderer(new BasicConnectionStyle(
                         dynamicColor != null ? dynamicColor : baseStyle.getLineColor(),
                                 baseStyle.getBranchPointColor(), baseStyle.getBranchPointRadius(),
                                     dynamicStroke != null ? dynamicStroke : baseStyle.getLineStroke(), 
                                             dynamicStroke != null ? dynamicStroke : baseStyle.getRouteLineStroke(),
-                                                    baseStyle.getDegeneratedLineLength()));
+                                                    baseStyle.getDegeneratedLineLength(), baseStyle.getRounding()));
             }
             
             
@@ -347,7 +357,9 @@ public class RouteGraphNode extends G2DNode implements ISelectionPainterNode, In
         Object aaHint = g.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
         g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
 
-        boolean selected = NodeUtil.isSelected(this, 1);
+        boolean selected = ignoreSelection ? false : NodeUtil.isSelected(this, 1);
+
+        rg.updateTerminals();
 
         if (currentAction != null) {
             currentAction.render(g, renderer, mouseX, mouseY);