public void setStrokeParts(float w, int cap, int join, float limit, float[] ary, float phase) {
        if (w == NOWIDTH) {
            w = state.stroke.getLineWidth();
        }
        if (cap == NOCAP) {
            cap = state.stroke.getEndCap();
        }
        if (join == NOJOIN) {
            join = state.stroke.getLineJoin();
        }
        if (limit == NOLIMIT) {
            limit = state.stroke.getMiterLimit();
        }
        if (phase == NOPHASE) {
            ary = state.stroke.getDashArray();
            phase = state.stroke.getDashPhase();
        }
        if (ary != null && ary.length == 0) {
            ary = null;
        }
        if (phase == NOPHASE) {
            state.stroke = new BasicStroke(w, cap, join, limit);
        } else {
            state.stroke = new BasicStroke(w, cap, join, limit, ary, phase);
        }
    }