boolean drawIt = false;
    public void draw(Graphics g, Shape s) {        if (decorations.isEmpty())            return;        PathIterator pi = s.getPathIterator(null, FLATNESS);        int segType;        double[] segCoords = new double[6];        LinkedList points = new LinkedList();        Point2D firstPoint = null;        Point2D point;        // split path in polylines        boolean drawIt = false;        do {            segType = pi.currentSegment(segCoords);            point = new Point2D.Double(segCoords[0], segCoords[1]);            switch (segType) {            case PathIterator.SEG_MOVETO:                if (firstPoint == null)                    firstPoint = point;                if (points.size() > 0) {                    // draw decorations for the previous polyline                    draw(g, points);                }                // init a new polyline                points.clear();                points.add(point);                break;            case PathIterator.SEG_LINETO:                points.add(point);                break;            case PathIterator.SEG_CLOSE:                points.add(firstPoint);                break;            }            pi.next();        } while (!pi.isDone());        // draw decorations for the last poly        if (points.size() > 0) {            draw(g, points);        }    }