public void addShapeList(ShapeList sl, Hashtable<String, ImageArea> areas)
			throws Exception {

		if (areas != null && areas.size() > 0) {
			ImagemapShape imshape = null;
			ImageArea area = null;
			Shape shape = null;
			for (String key : areas.keySet()) {
				imshape = null;
				area = areas.get(key);
				shape = area.getShape();
				System.out.println(key + " = " + areas.get(key));
				System.out.println(shape);

				if (shape.getType().compareToIgnoreCase("rect") == 0) {
					Rectangle rect = shape.getRect();
					imshape = new ImagemapShape(rect.x, rect.y, rect.x
							+ rect.width, rect.y + rect.height);
				} else if (shape.getType().compareToIgnoreCase("poly") == 0) {
					Polygon poly = shape.getPoly();
					imshape = new ImagemapShape(poly);
				} else if (shape.getType().compareToIgnoreCase("circle") == 0) {
					Circle circle = shape.getCircle();
					imshape = new ImagemapShape(circle);
				} else
					throw new Exception("illegal shape " + shape.getType());
				imshape.setId(area.getId());
				imshape.set_comp(area.getComparitor());
				imshape.set_name(area.getName());
				imshape.setImageFile(area.getImageFile());
				sl.add_shape(imshape);
			}
		}
	}