
import java.lang.String;



/**
 *
 * @author  Koeman
 */
public class jfrmVerEstado extends javax.swing.JFrame {

     Juego j;
    String nombre;
    String color;
    int num;
    int cartas;
    int numt;
    /** Creates new form jfrmVerEstado */
    public jfrmVerEstado(Juego j) {
        
        initComponents();
        this.j=j;
        jButtonVerEstadoF.setVisible(true);
     jLabelVerEstado1.setVisible(true);
     jLabelVerEstado2.setVisible(true);
   jLabelVerEstado3.setVisible(true);
     jLabelVerEstado4.setVisible(true);
     jPanelVerEstado.setVisible(true);
     jTextField1.setVisible(true);
     jTextField2.setVisible(true);
     jTextField3.setVisible(true);
     jTextField4.setVisible(true);
        
    }

    private jfrmVerEstado() {
        throw new UnsupportedOperationException("Not yet implemented");
    }
  public void lanzarVerEstado(){
      
       nombre=j.getjugadores(j.gettur()).getNombre();
      jTextField1.setText(nombre);   
        numt =j.getjugadores(j.gettur()).getNumTerritorios();//convertirlo a cadena
      jTextField2.setText(Integer.toString(numt));
       color=j.getjugadores(j.gettur()).getColor();
      jTextField3.setText(color); 
       cartas=j.getjugadores(j.gettur()).getNumCartas();
      jTextField4.setText(Integer.toString(cartas)); 
      jList1.setListData(j.getjugadores(j.gettur()).getCartas().toArray());
    }


    /** 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() {

        jPanelVerEstado = new javax.swing.JPanel();
        jLabelVerEstado1 = new javax.swing.JLabel();
        jTextField1 = new javax.swing.JTextField();
        jLabelVerEstado2 = new javax.swing.JLabel();
        jTextField2 = new javax.swing.JTextField();
        jLabelVerEstado3 = new javax.swing.JLabel();
        jTextField3 = new javax.swing.JTextField();
        jLabelVerEstado4 = new javax.swing.JLabel();
        jTextField4 = new javax.swing.JTextField();
        jButtonVerEstadoF = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jList1 = new javax.swing.JList();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabelVerEstado1.setText("Jugador:");

        jLabelVerEstado2.setText("Numero de Territorios:");

        jLabelVerEstado3.setText("Color: ");

        jLabelVerEstado4.setText("Cartas: ");

        jTextField4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextField4ActionPerformed(evt);
            }
        });

        jButtonVerEstadoF.setText("Finalizar");
        jButtonVerEstadoF.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonVerEstadoFActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanelVerEstadoLayout = new javax.swing.GroupLayout(jPanelVerEstado);
        jPanelVerEstado.setLayout(jPanelVerEstadoLayout);
        jPanelVerEstadoLayout.setHorizontalGroup(
            jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelVerEstadoLayout.createSequentialGroup()
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelVerEstadoLayout.createSequentialGroup()
                        .addGap(100, 100, 100)
                        .addComponent(jButtonVerEstadoF))
                    .addGroup(jPanelVerEstadoLayout.createSequentialGroup()
                        .addGap(51, 51, 51)
                        .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabelVerEstado2, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelVerEstado1, javax.swing.GroupLayout.PREFERRED_SIZE, 68, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelVerEstado3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabelVerEstado4, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addGap(26, 26, 26)
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jTextField4)
                    .addComponent(jTextField3)
                    .addComponent(jTextField2)
                    .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 83, Short.MAX_VALUE))
                .addContainerGap(30, Short.MAX_VALUE))
        );
        jPanelVerEstadoLayout.setVerticalGroup(
            jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelVerEstadoLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelVerEstado1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelVerEstado2, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelVerEstado3, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(21, 21, 21)
                .addGroup(jPanelVerEstadoLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelVerEstado4, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 62, Short.MAX_VALUE)
                .addComponent(jButtonVerEstadoF)
                .addGap(45, 45, 45))
        );

        jList1.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        jScrollPane1.setViewportView(jList1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanelVerEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 257, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(33, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelVerEstado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addGroup(layout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

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

private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_jTextField4ActionPerformed

private void jButtonVerEstadoFActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonVerEstadoFActionPerformed
setVisible(false);
}//GEN-LAST:event_jButtonVerEstadoFActionPerformed

    /**
    * @param args the command line arguments
    */
 /*   public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jfrmVerEstado().setVisible(true);
            }
        });
    }*/

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonVerEstadoF;
    private javax.swing.JLabel jLabelVerEstado1;
    private javax.swing.JLabel jLabelVerEstado2;
    private javax.swing.JLabel jLabelVerEstado3;
    private javax.swing.JLabel jLabelVerEstado4;
    private javax.swing.JList jList1;
    private javax.swing.JPanel jPanelVerEstado;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    // End of variables declaration//GEN-END:variables

}
