*/
@Override
public void paintComponent(Graphics g) {
Graphics2D g2d = (Graphics2D) g.create();
MapLayer layer;
Rectangle clip = g2d.getClipBounds();
g2d.setStroke(new BasicStroke(2.0f));
// Do an initial fill with the background color
// todo: make background color configurable
// try {
// String colorString = displayPrefs.get("backgroundColor", "");
// g2d.setColor(Color.decode(colorString));
// } catch (NumberFormatException e) {
// }
g2d.setColor(DEFAULT_BACKGROUND_COLOR);
g2d.fillRect(clip.x, clip.y, clip.width, clip.height);
paintSubMap(map, g2d, 1.0f);
if (!getMode(PF_NOSPECIAL)) {
Iterator<?> li = map.getLayersSpecial();
while (li.hasNext()) {
layer = (MapLayer) li.next();
if (layer.isVisible()) {
if (layer instanceof SelectionLayer) {
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, 0.3f));
g2d.setColor(((SelectionLayer) layer).getHighlightColor());
}
paintLayer(g2d, (TileLayer) layer);