if (s instanceof GeneralPath) { left.setWindingRule(((GeneralPath) s).getWindingRule()); right.setWindingRule(((GeneralPath) s).getWindingRule()); } else if (s instanceof BezierPath) { left.setWindingRule(((BezierPath) s).getWindingRule()); right.setWindingRule(((BezierPath) s).getWindingRule()); }
    public Shape createStrokedShape(Shape s) {    BezierPath bp = new BezierPath();        GeneralPath left = new GeneralPath();        GeneralPath right = new GeneralPath();                double[] coords = new double[6];        // FIXME - We only do a flattened path        for (PathIterator i = s.getPathIterator(null, 0.1d); ! i.isDone(); i.next()) {            int type = i.currentSegment(coords);                        switch (type) {                case PathIterator.SEG_MOVETO :                    if (bp.size() != 0) {                        traceStroke(bp, left, right);                    }                    bp.clear();                    bp.moveTo(coords[0], coords[1]);                    break;                case PathIterator.SEG_LINETO :                    if (coords[0] != bp.get(bp.size() - 1).x[0] ||                            coords[1] != bp.get(bp.size() - 1).y[0]) {                        bp.lineTo(coords[0], coords[1]);                    }                    break;                case PathIterator.SEG_QUADTO :                    bp.quadTo(coords[0], coords[1], coords[2], coords[3]);                    break;                case PathIterator.SEG_CUBICTO :                    bp.curveTo(coords[0], coords[1], coords[2], coords[3], coords[4], coords[5]);                    break;                case PathIterator.SEG_CLOSE:                    bp.setClosed(true);                    break;            }        }        if (bp.size() > 1) {            traceStroke(bp, left, right);        }                        if (left.getBounds2D().contains(right.getBounds2D())) {            return (grow > 0) ? left : right;        } else {            return (grow > 0) ? right : left;        }    }