public void drawOn(Page page) throws Exception { if (fill_shape) { page.setBrushColor(color[0], color[1], color[2]); } else { page.setPenColor(color[0], color[1], color[2]); } page.setPenWidth(width); page.setLinePattern(pattern); for (int i = 0; i < points.size(); i++) { Point point = points.get(i); point.x += box_x; point.y += box_y; } if (fill_shape) { page.drawPath(points, 'f'); } else { if (close_path) { page.drawPath(points, 's'); } else { page.drawPath(points, 'S'); } } for (int i = 0; i < points.size(); i++) { Point point = points.get(i); point.x -= box_x; point.y -= box_y; } }