/*
 * Image/J Plugins
 * Copyright (C) 2002-2008 Jarek Sacha
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Latest release available at http://sourceforge.net/projects/ij-plugins/
 *
 */
package net.sf.ij_plugins.ui;

import javax.swing.*;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;

/**
 * GlassPane it is transparent for MouseEvents,
 * and respects underneath component's cursors by default,
 * it is also friedly for other users,
 * if someone adds a mouseListener to this GlassPane
 * or set a new cursor it will respect them
 * <p/>
 * Inspired on class created by Alexander Potochkin,
 * http://weblogs.java.net/blog/alexfromsun/archive/2007/06/_enablingdisabl_1.html
 *
 * @author Jarek Sacha
 * @since Nov 13, 2008
 */
public final class GlassPane extends JPanel {

    public GlassPane() {
        setOpaque(false);

        // This is breaking the "mouseEvents transparency"
        // see also
        // http://weblogs.java.net/blog/alexfromsun/archive/2006/09/index.html
        // http://weblogs.java.net/blog/alexfromsun/archive/2005/10/index.html
        addMouseListener(new MouseAdapter() {
        });

        // This component keeps the focus until is made hidden
        setInputVerifier(new InputVerifier() {
            public boolean verify(JComponent input) {
                return !isVisible();
            }
        });
    }

    protected void paintComponent(Graphics g) {
        Graphics2D g2 = (Graphics2D) g.create();
        g2.setColor(new Color(0, 128, 128, 128));
        g2.fillRect(0, 0, getWidth(), getHeight());
        g2.dispose();
    }
}

@@ -1576,24 +1576,140 @@
 JPanel %7B%0D%0A%0D%0A
+    private static final long serialVersionUID = 1L;%0D%0A    private Color color = new Color(255, 255, 255, 128);%0D%0A%0D%0A%0D%0A
     public G
@@ -1718,24 +1718,24 @@
 ssPane() %7B%0D%0A
-
         setO
@@ -2292,24 +2292,448 @@
 ;%0D%0A    %7D%0D%0A%0D%0A
+%0D%0A    /**%0D%0A     * @return glass pane color.%0D%0A     */%0D%0A    public Color getColor() %7B%0D%0A        return color;%0D%0A    %7D%0D%0A%0D%0A%0D%0A    /**%0D%0A     * Glass pane color including transparency.%0D%0A     * It should be semi-transparent to see blocked content.%0D%0A     * For instance,  Color(255, 255, 255, 128).%0D%0A     *%0D%0A     * @param color new color%0D%0A     */%0D%0A    public void setColor(final Color color) %7B%0D%0A        this.color = color;%0D%0A    %7D%0D%0A%0D%0A%0D%0A
     protecte
@@ -2754,16 +2754,22 @@
 mponent(
+final 
 Graphics
@@ -2783,16 +2783,22 @@
         
+final 
 Graphics
@@ -2855,35 +2855,13 @@
 lor(
-new Color(0, 128, 128, 128)
+color
 );%0D%0A

Add ability to set glass pane color.