X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fimage%2Fimpl%2FShapeImage.java;h=90ceaa12af567f4d1f217bd35131b11c47bd6a9b;hp=77c65cb6ee497d9883cf01ea496a81039dc5184c;hb=f1e832f8b1172fd6370ae37f34461823f03adaa8;hpb=64a47f48bceb4683c6e0d96924e1404ae5ddff9b diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/image/impl/ShapeImage.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/image/impl/ShapeImage.java index 77c65cb6e..90ceaa12a 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/image/impl/ShapeImage.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/image/impl/ShapeImage.java @@ -21,7 +21,7 @@ import java.util.EnumSet; import org.simantics.g2d.image.Image; import org.simantics.scenegraph.Node; import org.simantics.scenegraph.g2d.G2DParentNode; -import org.simantics.scenegraph.g2d.nodes.ShapeNode; +import org.simantics.scenegraph.g2d.nodes.ShapeNode2; /** * @author Tuukka Lehtonen @@ -31,7 +31,8 @@ public class ShapeImage extends AbstractImage implements Image { private static final EnumSet defaultFeats = VECTOR; Shape shape; - Paint paint; + Paint fillPaint; + Paint strokePaint; Stroke stroke; EnumSet feats; boolean scaleStroke = false; @@ -41,16 +42,20 @@ public class ShapeImage extends AbstractImage implements Image { } public ShapeImage(Shape shape, Paint fill, Stroke stroke, boolean scaleStroke) { - this(shape, fill, stroke, scaleStroke, defaultFeats); + this(shape, fill, stroke, fill, scaleStroke, defaultFeats); } public ShapeImage(Shape shape, Paint fill, Stroke stroke, EnumSet features) { - this(shape, fill, stroke, false, features); + this(shape, fill, stroke, fill, false, features); + } + public ShapeImage(Shape shape, Paint fill, Stroke stroke, Paint strokeColor, boolean scaleStroke) { + this(shape, fill, stroke, strokeColor, scaleStroke, defaultFeats); } - public ShapeImage(Shape shape, Paint fill, Stroke stroke, boolean scaleStroke, EnumSet features) { + public ShapeImage(Shape shape, Paint fill, Stroke stroke, Paint strokeColor, boolean scaleStroke, EnumSet features) { this.shape = shape; - this.paint = fill; + this.fillPaint = fill; + this.strokePaint = strokeColor; this.stroke = stroke; this.scaleStroke = scaleStroke; this.feats = features; @@ -73,11 +78,11 @@ public class ShapeImage extends AbstractImage implements Image { @Override public Node init(G2DParentNode parent) { - ShapeNode shapeNode = parent.getOrCreateNode("ShapeImage", ShapeNode.class); + ShapeNode2 shapeNode = parent.getOrCreateNode("ShapeImage", ShapeNode2.class); shapeNode.setShape(shape); shapeNode.setStroke(stroke); - shapeNode.setFill(paint != null); - shapeNode.setColor(paint != null ? paint : Color.BLACK); + shapeNode.setFillColor(fillPaint); + shapeNode.setStrokeColor(strokePaint != null ? strokePaint : Color.BLACK); shapeNode.setScaleStroke(scaleStroke); return shapeNode; }