h.startPath(); for (int i = 0; i < n; i++) { SVGPathSeg seg = p.getItem(i); switch (seg.getPathSegType()) { case SVGPathSeg.PATHSEG_CLOSEPATH: h.closePath(); break; case SVGPathSeg.PATHSEG_MOVETO_ABS: { SVGPathSegMovetoAbs s = (SVGPathSegMovetoAbs) seg; h.movetoAbs(s.getX(), s.getY()); break; h.movetoRel(s.getX(), s.getY()); break; h.linetoAbs(s.getX(), s.getY()); break; h.linetoRel(s.getX(), s.getY()); break; SVGPathSegCurvetoCubicAbs s = (SVGPathSegCurvetoCubicAbs) seg; h.curvetoCubicAbs (s.getX1(), s.getY1(), s.getX2(), s.getY2(), s.getX(), s.getY()); SVGPathSegCurvetoCubicRel s = (SVGPathSegCurvetoCubicRel) seg;
/** * Parses a 'T' command. */ protected void parseT() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticSmoothAbs(x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'q' command. */ protected void parseq() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x1 = parseFloat(); skipCommaSpaces(); float y1 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticRel(x1, y1, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'S' command. */ protected void parseS() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x2 = parseFloat(); skipCommaSpaces(); float y2 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoCubicSmoothAbs(x2, y2, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 's' command. */ protected void parses() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x2 = parseFloat(); skipCommaSpaces(); float y2 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoCubicSmoothRel(x2, y2, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'Q' command. */ protected void parseQ() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x1 = parseFloat(); skipCommaSpaces(); float y1 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticAbs(x1, y1, x, y); expectNumber = skipCommaSpaces2(); } }
float y = parseFloat(); pathHandler.curvetoCubicRel(x1, y1, x2, y2, x, y); expectNumber = skipCommaSpaces2();
float y = parseFloat(); pathHandler.curvetoCubicAbs(x1, y1, x2, y2, x, y); expectNumber = skipCommaSpaces2();
float y = parseFloat(); pathHandler.arcRel(rx, ry, ax, laf, sf, x, y); expectNumber = skipCommaSpaces2();
float y = parseFloat(); pathHandler.arcAbs(rx, ry, ax, laf, sf, x, y); expectNumber = skipCommaSpaces2();
/** * Parses a 'T' command. */ protected void parseT() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticSmoothAbs(x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'q' command. */ protected void parseq() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x1 = parseFloat(); skipCommaSpaces(); float y1 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticRel(x1, y1, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'S' command. */ protected void parseS() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x2 = parseFloat(); skipCommaSpaces(); float y2 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoCubicSmoothAbs(x2, y2, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 's' command. */ protected void parses() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x2 = parseFloat(); skipCommaSpaces(); float y2 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoCubicSmoothRel(x2, y2, x, y); expectNumber = skipCommaSpaces2(); } }
/** * Parses a 'Q' command. */ protected void parseQ() throws ParseException, IOException { current = reader.read(); skipSpaces(); boolean expectNumber = true; for (;;) { switch (current) { default: if (expectNumber) reportUnexpected(current); return; case '+': case '-': case '.': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': break; } float x1 = parseFloat(); skipCommaSpaces(); float y1 = parseFloat(); skipCommaSpaces(); float x = parseFloat(); skipCommaSpaces(); float y = parseFloat(); pathHandler.curvetoQuadraticAbs(x1, y1, x, y); expectNumber = skipCommaSpaces2(); } }
float y = parseFloat(); pathHandler.curvetoCubicRel(x1, y1, x2, y2, x, y); expectNumber = skipCommaSpaces2();
float y = parseFloat(); pathHandler.curvetoCubicAbs(x1, y1, x2, y2, x, y); expectNumber = skipCommaSpaces2();
float y = parseFloat(); pathHandler.arcRel(rx, ry, ax, laf, sf, x, y); expectNumber = skipCommaSpaces2();