x = _getDouble(attributes, "x", 0);
y = _getDouble(attributes, "y", 0);
width = _getDouble(attributes, "width");
height = _getDouble(attributes, "height");
PaintedShape ps = new PaintedShape(new Rectangle2D.Double(x, y,
width, height));
processPaintedShapeAttributes(ps, attributes);
return ps;
} else if (type.equals("circle")) {
double cx;
double cy;
double r;
cx = _getDouble(attributes, "cx", 0);
cy = _getDouble(attributes, "cy", 0);
r = _getDouble(attributes, "r");
PaintedShape ps = new PaintedShape(new Ellipse2D.Double(cx - r, cy
- r, 2 * r, 2 * r));
processPaintedShapeAttributes(ps, attributes);
return ps;
} else if (type.equals("ellipse")) {
double cx;
double cy;
double rx;
double ry;
cx = _getDouble(attributes, "cx", 0);
cy = _getDouble(attributes, "cy", 0);
rx = _getDouble(attributes, "rx");
ry = _getDouble(attributes, "ry");
PaintedShape ps = new PaintedShape(new Ellipse2D.Double(cx - rx, cy
- ry, 2 * rx, 2 * ry));
processPaintedShapeAttributes(ps, attributes);
return ps;
} else if (type.equals("line")) {
double x1;
double y1;
double x2;
double y2;
x1 = _getDouble(attributes, "x1", 0);
y1 = _getDouble(attributes, "y1", 0);
x2 = _getDouble(attributes, "x2", 0);
y2 = _getDouble(attributes, "y2", 0);
Line2D line = new Line2D.Double(x1, y1, x2, y2);
PaintedPath pp = new PaintedPath(line);
processPaintedPathAttributes(pp, attributes);
return pp;
} else if (type.equals("polyline")) {
double[] coords = parseCoordString((String) attributes
.get("points"));
Polyline2D poly = new Polyline2D.Double();
poly.moveTo(coords[0], coords[1]);
for (int i = 2; i < coords.length; i += 2) {
poly.lineTo(coords[i], coords[i + 1]);
}
PaintedPath pp = new PaintedPath(poly);
processPaintedPathAttributes(pp, attributes);
return pp;
} else if (type.equals("polygon")) {
double[] coords = parseCoordString((String) attributes
.get("points"));
Polygon2D poly = new Polygon2D.Double();
poly.moveTo(coords[0], coords[1]);
for (int i = 2; i < coords.length; i += 2) {
poly.lineTo(coords[i], coords[i + 1]);
}
poly.closePath();
PaintedShape ps = new PaintedShape(poly);
processPaintedShapeAttributes(ps, attributes);
return ps;
} else if (type.equals("text")) {
double x;
double y;