// Decompiled by DJ v3.12.12.96 Copyright 2011 Atanas Neshkov  Date: 08/10/2012 8:47:25
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   BotonTemas.java

package project;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.image.BufferedImage;
import javax.swing.ImageIcon;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

// Referenced classes of package project:
//            JLabel, ELabelUI

public class BotonTemas extends JPanel
{
    private class JColorLabel extends project.JLabel
    {

        private Color m_color;

        JColorLabel(String text, Color color)
        {
            super(text);
            m_color = color;
            BufferedImage image = new BufferedImage(12, 12, 2);
            Graphics2D g2 = (Graphics2D)image.getGraphics();
            g2.setColor(Color.black);
            g2.fill3DRect(0, 0, 12, 12, true);
            g2.setColor(Color.white);
            g2.fill3DRect(1, 1, 10, 10, true);
            g2.setColor(m_color.darker().darker());
            g2.fill3DRect(2, 2, 9, 9, true);
            g2.setColor(m_color);
            g2.fill3DRect(2, 2, 8, 8, true);
            setIcon(new ImageIcon(image));
        }
    }


    BotonTemas(String text, Color color)
    {
        setOpaque(false);
        String upperText = new String(text);
        String lowerText = new String("      ");
        int index = text.indexOf(' ');
        if(index > 0)
        {
            upperText = text.substring(0, index);
            lowerText = text.substring(index + 1);
        }
        project.JLabel upperLabel = new project.JLabel(upperText);
        upperLabel.setUI(new ELabelUI());
        Font font = new Font("SanSerif", 1, 11);
        upperLabel.setFont(font);
        upperLabel.setHorizontalAlignment(2);
        project.JLabel lowerLabel = new JColorLabel(lowerText, color);
        lowerLabel.setUI(new ELabelUI());
        lowerLabel.setHorizontalAlignment(2);
        lowerLabel.setFont(font);
        setLayout(new BorderLayout());
        add(upperLabel, "North");
        add(lowerLabel, "Center");
    }
}