use of com.google.code.appengine.awt.geom.GeneralPath in project activityinfo by bedatadriven.
the class ImageMapRenderer method drawAdminOverlay.
@Timed(name = "mapping.draw_admin_overlay")
protected void drawAdminOverlay(TiledMap map, Graphics2D g2d, AdminOverlay overlay) {
List<AdminGeo> geometry = geometryProvider.getGeometries(overlay.getAdminLevelId());
Color strokeColor = ColorUtil.colorFromString(overlay.getOutlineColor());
g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND));
for (AdminGeo adminGeo : geometry) {
AdminMarker polygon = overlay.getPolygon(adminGeo.getId());
if (polygon != null) {
GeneralPath path = PathUtils.toPath(map, adminGeo.getGeometry());
g2d.setColor(bubbleFillColor(ColorUtil.colorFromString(polygon.getColor())));
g2d.fill(path);
g2d.setColor(strokeColor);
g2d.draw(path);
}
}
}
use of com.google.code.appengine.awt.geom.GeneralPath in project activityinfo by bedatadriven.
the class PathUtils method toPath.
public static GeneralPath toPath(TiledMap map, Geometry geometry) {
GeneralPath path = new GeneralPath();
for (int i = 0; i != geometry.getNumGeometries(); ++i) {
Polygon polygon = (Polygon) geometry.getGeometryN(i);
PathUtils.addRingToPath(map, path, polygon.getExteriorRing().getCoordinates());
for (int j = 0; j != polygon.getNumInteriorRing(); ++j) {
PathUtils.addRingToPath(map, path, polygon.getInteriorRingN(j).getCoordinates());
}
break;
}
return path;
}
Aggregations