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
private static final EnumSet<Feature> defaultFeats = VECTOR;
Shape shape;
- Paint paint;
+ Paint fillPaint;
+ Paint strokePaint;
Stroke stroke;
EnumSet<Feature> feats;
boolean scaleStroke = false;
}
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<Feature> 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<Feature> features) {
+ public ShapeImage(Shape shape, Paint fill, Stroke stroke, Paint strokeColor, boolean scaleStroke, EnumSet<Feature> features) {
this.shape = shape;
- this.paint = fill;
+ this.fillPaint = fill;
+ this.strokePaint = strokeColor;
this.stroke = stroke;
this.scaleStroke = scaleStroke;
this.feats = features;
@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;
}