if(g2d == null) { g2d = (Graphics2D)getGraphics().create(); g2d.setClip(this.getVisibleRect()); }
    public void paintSubMap(MultilayerPlane m, Graphics2D g2d, float mapOpacity) {    	Iterator li = m.getLayers();    	MapLayer layer;    	double currentZoom = zoom;    	while (li.hasNext()) {            if ((layer = (MapLayer)li.next()) != null) {                float opacity = layer.getOpacity() * mapOpacity;                if (layer.isVisible() && opacity > 0.0f) {                    if (opacity < 1.0f) {                        g2d.setComposite(AlphaComposite.getInstance(                                    AlphaComposite.SRC_ATOP, opacity));                    } else {                        g2d.setComposite(AlphaComposite.SrcOver);                    }                    if (layer instanceof TileLayer) {                        paintLayer(g2d, (TileLayer)layer, currentZoom);                    } else if (layer instanceof ObjectGroup) {                        paintLayer(g2d, (ObjectGroup)layer, currentZoom);                    }                }            }        }    }