if(!getMode(PF_NOSPECIAL)) { li = myMap.getLayersSpecial();  while (li.hasNext()) { layer = (MapLayer) li.next(); if(layer.isVisible()) { if (layer.getClass() == SelectionLayer.class) { ((Graphics2D)g).setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_ATOP, 0.3f)); g.setColor(((SelectionLayer)layer).getHighlightColor()); } paint(g, layer, currentZoom); } } }
if (!getMode(PF_NOSPECIAL)) { li = myMap.getLayersSpecial();  while (li.hasNext()) { layer = (MapLayer) li.next(); if (layer.isVisible()) { if (layer.getClass() == SelectionLayer.class) { g2d.setComposite(AlphaComposite.getInstance( AlphaComposite.SRC_ATOP, 0.3f)); g2d.setColor( ((SelectionLayer)layer).getHighlightColor()); } paint(g, layer, currentZoom); } } }
    public void paint(Graphics g) {        double currentZoom = zoom;        Graphics2D g2d = (Graphics2D)g;        Iterator li = myMap.getLayers();        MapLayer layer;        Rectangle clip = g.getClipBounds();        g2d.setStroke(new BasicStroke(2.0f));        // Do an initial fill        g.setColor(new Color(64, 64, 64));        g.fillRect(clip.x, clip.y, clip.width, clip.height);        while (li.hasNext()) {            if ((layer = (MapLayer)li.next()) != null) {                float opacity = layer.getOpacity();                if (layer.isVisible() && opacity > 0.0f) {                    if (opacity < 1.0f) {                        g2d.setComposite(AlphaComposite.getInstance(                                    AlphaComposite.SRC_ATOP, opacity));                    } else {                        g2d.setComposite(AlphaComposite.SrcOver);                    }                    paint(g, layer, currentZoom);                }            }        }		if(!getMode(PF_NOSPECIAL)) {	        li = myMap.getLayersSpecial();		        while (li.hasNext()) {	            layer = (MapLayer) li.next();	            if(layer.isVisible()) {	            	if (layer.getClass() == SelectionLayer.class) {	                	((Graphics2D)g).setComposite(AlphaComposite.getInstance(	                    	                AlphaComposite.SRC_ATOP, 0.3f));	                	g.setColor(((SelectionLayer)layer).getHighlightColor());	            	}	            	paint(g, layer, currentZoom);	            }	        }		}        if (getMode(PF_GRIDMODE)) {            // Configure grid properties according to preferences            TiledConfiguration conf = TiledConfiguration.getInstance();            // Stroke            g2d.setStroke(new BasicStroke());            // Color            try {                String colorString = conf.getValue("tiled.grid.color");                g.setColor(Color.decode(colorString));            } catch (NumberFormatException e) {                g.setColor(Color.black);            }            // Opacity            int opacity = conf.getIntValue("tiled.grid.opacity", 255);            if (opacity < 255) {                g2d.setComposite(AlphaComposite.getInstance(                            AlphaComposite.SRC_ATOP, (float)opacity / 255.0f));            } else {                g2d.setComposite(AlphaComposite.SrcOver);            }            // Antialiasing            if (conf.keyHasValue("tiled.grid.antialias", 1)) {                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                        RenderingHints.VALUE_ANTIALIAS_ON);            } else {                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                        RenderingHints.VALUE_ANTIALIAS_OFF);            }            paintGrid(g, currentZoom);        }        if (getMode(PF_COORDINATES)) {            paintCoordinates(g, zoom);        }    }