package  com.limagiran.hearthstone.partida.view;

import com.limagiran.hearthstone.card.control.Card;
import java.awt.Color;
import java.awt.Dimension;
import java.util.List;
import javax.swing.JLabel;

/**
 *
 * @author Vinicius
 */
public class PopUpSegredos extends javax.swing.JFrame {

    /**
     * Creates new form PopUpSegredos
     */
    public PopUpSegredos() {
        initComponents();
        setBackground(new Color(0, 0, 0, 0));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanelSegredos = new javax.swing.JPanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setUndecorated(true);
        setResizable(false);
        addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                formFocusLost(evt);
            }
        });
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jPanelSegredos.setBackground(new Color(0, 0, 0, 0));
        jPanelSegredos.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0));
        getContentPane().add(jPanelSegredos, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 861, 190));

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void formFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusLost
        dispose();
    }//GEN-LAST:event_formFocusLost


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanelSegredos;
    // End of variables declaration//GEN-END:variables

    public void showPopUp(List<Card> segredos){
        jPanelSegredos.removeAll();
        for(Card c : segredos){
            JLabel label = new JLabel(c.getImagemSmall());
            label.setPreferredSize(new Dimension(123, 190));
            label.setSize(new Dimension(123, 190));
            jPanelSegredos.add(label);
        }
        setVisible(true);
    }
}