float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_MOVETO_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_MOVETO_ABS, vals[count]));
}
}
} else if(str.equals("m")) {
float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_MOVETO_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_MOVETO_REL, vals[count]));
}
}
} else if(str.equals("L")) {
float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_ABS, vals[count]));
}
}
} else if(str.equals("l")) {
float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_REL, vals[count]));
}
}
} else if(str.equals("H")) {
float[][] vals = getPoints(1, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_HORIZONTAL_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS, vals[count]));
}
}
} else if(str.equals("h")) {
float[][] vals = getPoints(1, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_HORIZONTAL_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL, vals[count]));
}
}
} else if(str.equals("V")) {
float[][] vals = getPoints(1, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_VERTICAL_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS, vals[count]));
}
}
} else if(str.equals("v")) {
float[][] vals = getPoints(1, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_LINETO_VERTICAL_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL, vals[count]));
}
}
} else if(str.equals("C")) {
float[][] vals = getPoints(6, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_CUBIC_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS, vals[count]));
}
}
} else if(str.equals("c")) {
float[][] vals = getPoints(6, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_CUBIC_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL, vals[count]));
}
}
} else if(str.equals("S")) {
float[][] vals = getPoints(4, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS, vals[count]));
}
}
} else if(str.equals("s")) {
float[][] vals = getPoints(4, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_CUBIC_SMOOTH_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL, vals[count]));
}
}
} else if(str.equals("Q")) {
float[][] vals = getPoints(4, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_QUADRATIC_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS, vals[count]));
}
}
} else if(str.equals("q")) {
float[][] vals = getPoints(4, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_QUADRATIC_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL, vals[count]));
}
}
} else if(str.equals("T")) {
float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS, vals[count]));
}
}
} else if(str.equals("t")) {
float[][] vals = getPoints(2, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL, vals[count]));
}
}
} else if(str.equals("A")) {
float[][] vals = getPoints(7, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_ARC_ABS, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_ARC_ABS, vals[count]));
}
}
} else if(str.equals("a")) {
float[][] vals = getPoints(7, st);
if(vals != null) {
for(int count = 0; count < vals.length; count++) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_ARC_REL, vals[count]));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_ARC_REL, vals[count]));
}
}
} else if(str.equals("Z") || str.equals("z")) {
- addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.SVG_PATHSEG_CLOSEPATH, null));
+ addSVGPathSeg(new SVGPathSegImpl(SVGPathSeg.PATHSEG_CLOSEPATH, null));
}
}
}
value = st.nextToken().trim();
SVGTransformImpl transform = new SVGTransformImpl();
if(type.equals("translate")) {
- SVGLengthImpl xlen;
- SVGLengthImpl ylen;
+ float xlen = 0;
+ float ylen = 0;
int pos = value.indexOf(",");
if(pos != -1) {
- xlen = new SVGLengthImpl(value.substring(0, pos).trim());
- ylen = new SVGLengthImpl(value.substring(pos + 1, value.length()).trim());
- } else {
- xlen = new SVGLengthImpl("0");
- ylen = new SVGLengthImpl("0");
+ SVGLengthImpl length;
+ length = new SVGLengthImpl();
+ length.setValueAsString(value.substring(0, pos).trim());
+ xlen = length.getValue();
+ length = new SVGLengthImpl();
+ length.setValueAsString(value.substring(pos + 1, value.length()).trim());
+ ylen = length.getValue();
}
transform.setTranslate(xlen, ylen);
list.addElement(transform);
} else if(type.equals("skewX")) {
- SVGAngleImpl angle = new SVGAngleImpl();
- angle.setValueAsString(value);
+// SVGAngleImpl angle = new SVGAngleImpl();
+// angle.setValueAsString(value);
+ float angle = Float.valueOf(value).floatValue();
transform.setSkewX(angle);
list.addElement(transform);
} else if(type.equals("skewY")) {
- SVGAngleImpl angle = new SVGAngleImpl();
- angle.setValueAsString(value);
+ // SVGAngleImpl angle = new SVGAngleImpl();
+// angle.setValueAsString(value);
+ float angle = Float.valueOf(value).floatValue();
transform.setSkewY(angle);
list.addElement(transform);
} else if(type.equals("scale")) {
- SVGNumberImpl xlen = new SVGNumberImpl();
- SVGNumberImpl ylen = new SVGNumberImpl();
+ float xlen = 0;
+ float ylen = 0;
int pos = value.indexOf(",");
if(pos != -1) {
- try {
- xlen.setValue((new Float(value.substring(0, pos).trim())).floatValue());
- } catch(Exception e) {
- }
- try {
- ylen.setValue((new Float(value.substring(pos + 1, value.length()).trim()).floatValue()));
- } catch(Exception e) {
- }
+// try {
+ xlen = Float.valueOf(value.substring(0, pos).trim()).floatValue();
+// } catch(Exception e) {
+// }
+// try {
+ ylen = Float.valueOf(value.substring(pos + 1, value.length()).trim()).floatValue();
+// } catch(Exception e) {
+// }
}
transform.setScale(xlen, ylen);
list.addElement(transform);
} else if(type.equals("rotate")) {
- SVGAngleImpl angle = new SVGAngleImpl();
- angle.setValueAsString(value);
- transform.setRotate(angle);
+ // SVGAngleImpl angle = new SVGAngleImpl();
+// angle.setValueAsString(value);
+ float angle = Float.valueOf(value).floatValue();
+ transform.setRotate(angle, 0, 0);
list.addElement(transform);
} else if(type.equals("matrix")) {
SVGMatrixImpl matrix = new SVGMatrixImpl();
break;
tok = mt.nextToken();
}
+ float floatVal = Float.valueOf(tok).floatValue();
if(neg)
- tok = "-" + tok;
- length = new SVGLengthImpl();
- length.setValueAsString(tok);
- matrix.setE(length);
+ floatVal = -floatVal;
+// if(neg)
+// tok = "-" + tok;
+// length = new SVGLengthImpl();
+// length.setValueAsString(tok);
+ matrix.setE(floatVal);
}
if(mt.hasMoreTokens()) {
tok = mt.nextToken();
break;
tok = mt.nextToken();
}
+ float floatVal = Float.valueOf(tok).floatValue();
if(neg)
- tok = "-" + tok;
- length = new SVGLengthImpl();
- length.setValueAsString(tok);
- matrix.setF(length);
+ floatVal = -floatVal;
+// if(neg)
+// tok = "-" + tok;
+// length = new SVGLengthImpl();
+// length.setValueAsString(tok);
+ matrix.setF(floatVal);
}
transform.setMatrix(matrix);
list.addElement(transform);