if (editor != null && editor.getCurrentLayer() instanceof TileLayer) { g2d.setComposite(AlphaComposite.SrcOver);  TileLayer tl = (TileLayer) editor.getCurrentLayer(); if (tl != null && tl.isVisible()) { paintPropertyFlags(g2d, tl); } }
    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);                }            }            // Paint Brush            if (currentBrush != null) {                currentBrush.drawPreview(g2d, this);            }        }        // Grid color (also used for coordinates)        g2d.setColor(gridColor);        if (showGrid) {            // Grid opacity            if (gridOpacity < 255) {                g2d.setComposite(AlphaComposite.getInstance(                        AlphaComposite.SRC_ATOP,                        (float)gridOpacity / 255.0f));            } else {                g2d.setComposite(AlphaComposite.SrcOver);            }            // Configure grid antialiasing            if (antialiasGrid) {                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                        RenderingHints.VALUE_ANTIALIAS_ON);            } else {                g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,                        RenderingHints.VALUE_ANTIALIAS_OFF);            }            g2d.setStroke(new BasicStroke());            paintGrid(g2d);        }        if (getMode(PF_COORDINATES)) {            g2d.setComposite(AlphaComposite.SrcOver);            paintCoordinates(g2d);        }    }