/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package gui;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.MouseAdapter;
import javax.swing.InputVerifier;
import javax.swing.JComponent;
import javax.swing.JPanel;

/**
 *
 * @author Csubák Péter
 */
public class MobirentGlassPane extends JPanel {
    
    public MobirentGlassPane() {
        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() { 
            @Override
            public boolean verify(JComponent input) { 
                return !isVisible(); 
            }
        }); 
    } 
 
    @Override
    protected void paintComponent(Graphics g) { 
        Graphics2D g2 = (Graphics2D) g.create(); 
        // fill the component with another translucent color 
        g2.setColor(new Color(0, 0, 27, 200));
        g2.fillRect(0, 0, getWidth(), getHeight()); 
        g2.dispose(); 
    } 
} 
