while(!pi.isDone()) {
switch(pi.currentSegment(coords)) {
case PathIterator.SEG_CLOSE : list.add(new SVGPathSegClosePath()); break;
case PathIterator.SEG_LINETO: list.add(new SVGPathSegLineto(coords[0], coords[1], false)); break;
case PathIterator.SEG_MOVETO: list.add(new SVGPathSegMoveto(coords[0], coords[1], false)); break;
case PathIterator.SEG_CUBICTO: list.add(new SVGPathSegCurvetoCubic(coords[4], coords[5], coords[0], coords[1], coords[2], coords[3], false)); break;
case PathIterator.SEG_QUADTO: list.add(new SVGPathSegCurvetoQuadratic(coords[2], coords[3], coords[0], coords[1], false)); break;
default: throw new ParseException("Invalid Path2D element:" + pi.currentSegment(coords), -1);
}
pi.next();