Support for edge widths in rendering 77/1777/1
authorHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 14 May 2018 10:07:02 +0000 (13:07 +0300)
committerHannu Niemistö <hannu.niemisto@semantum.fi>
Mon, 14 May 2018 10:07:02 +0000 (13:07 +0300)
Change-Id: I079ad59d7997a4a17abaf7835f7d71ce8c006085

bundles/org.simantics.graphviz/src/org/simantics/graphviz/internal/xdot/SetStyle.java

index 5269ac09dc0efb3cc964373fa772b0359cd4c5f3..1098c53fde7ec017378b9903d6507f186d2c9e9a 100644 (file)
@@ -34,6 +34,10 @@ public class SetStyle implements DrawCommand {
                    g.setStroke(DASHED);
                else if(styleName.equals("dotted"))
             g.setStroke(DOTTED);
+               else if(styleName.startsWith("setlinewidth(")) {
+                   double w = Double.parseDouble(styleName.substring(13, styleName.length()-1));
+                   g.setStroke(new BasicStroke((float)w, BasicStroke.CAP_SQUARE, BasicStroke.JOIN_MITER, 10.0f, ((BasicStroke)g.getStroke()).getDashArray(), 0.0f));
+               }
                else
                    System.out.println("Unknown style: " + styleName);
        }