final int fcol = _profile.getColor(type);
final Color bgcolor = new Color(gc.getDevice(), (fcol & 0xff0000) >> 16,
(fcol & 0xff00) >> 8, fcol & 0xff);
final int[] poly = new int[object.getNodes().size() * 2];
int idx = 0;
Point p;
for (final MapNodeRef point : object.getNodes()) {
p = calcPos(point.getNode().getLatitude(), point.getNode().getLongitude());
gc.setForeground(border);
gc.setBackground(bgcolor);
poly[idx++] = p.getX();
poly[idx++] = p.getY();
}
if (type.isClosed()) {
gc.fillPolygon(poly);
gc.drawPolygon(poly);
}
else {
gc.setLineWidth(5);
gc.drawPolyline(poly);
gc.setForeground(bgcolor);
gc.setLineWidth(2);
gc.drawPolyline(poly);
}
final String iconName = "net/sf/myway/map/icons/" + _profile.getIcon(type) + ".gif";
final InputStream icon = Thread.currentThread().getContextClassLoader()
.getResourceAsStream(iconName);
if (icon != null) {
final Image img = new Image(gc.getDevice(), icon);
p = calcPos(object.getCenter().getNode().getLatitude(), object.getCenter().getNode()
.getLongitude());
gc.drawImage(img, p.getX() - img.getImageData().width / 2, p.getY()
- img.getImageData().height / 2);
}
border.dispose();
bgcolor.dispose();
}