/*
 * fTablero.java
 *
 * Created on 9 de enero de 2009, 15:04
 */
import java.awt.Color;
import java.util.ArrayList;
import java.util.Observer;
import java.util.Observable;


/**
 *
 * @author  juan antonio
 */
public class fTablero extends javax.swing.JFrame implements Observer{

    private ArrayList<Territorio> lterritorios;
    
    private javax.swing.JLabel[] listalabels=new javax.swing.JLabel[45];
    
    Partida miPartida;
    /** Creates new form fTablero */
    public fTablero(Partida p) {
        initComponents();
        miPartida=p;
        lterritorios=miPartida.getTerritorio();
        listalabels[0]=lt1;
        listalabels[1]=lt2;
        listalabels[2]=lt3;
        listalabels[3]=lt4;
        listalabels[4]=lt5;
        listalabels[5]=lt6;
        listalabels[6]=lt7;
        listalabels[7]=lt8;
        listalabels[8]=lt9;
        listalabels[9]=lt10;
        listalabels[10]=lt11;
        listalabels[11]=lt12;
        listalabels[12]=lt13;
        listalabels[13]=lt14;
        listalabels[14]=lt15;
        listalabels[15]=lt16;
        listalabels[16]=lt17;
        listalabels[17]=lt18;
        listalabels[18]=lt19;
        listalabels[19]=lt20;
        listalabels[20]=lt21;
        listalabels[21]=lt22;
        listalabels[22]=lt23;
        listalabels[23]=lt24;
        listalabels[24]=lt25;
        listalabels[25]=lt26;
        listalabels[26]=lt27;
        listalabels[27]=lt28;
        listalabels[28]=lt29;
        listalabels[29]=lt30;
        listalabels[30]=lt31;
        listalabels[31]=lt32;
        listalabels[32]=lt33;
        listalabels[33]=lt34;
        listalabels[34]=lt35;
        listalabels[35]=lt36;
        listalabels[36]=lt37;
        listalabels[37]=lt38;
        listalabels[38]=lt39;
        listalabels[39]=lt40;
        listalabels[40]=lt41;
        listalabels[41]=lt42;
        listalabels[42]=lt43;
        listalabels[43]=lt44;
        listalabels[44]=lt45;
        lpbotones.setVisible(false);
        bcomenzar.setVisible(false);
        laccion.setVisible(false);   
    }

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

        basignar = new javax.swing.JButton();
        lpbotones = new javax.swing.JLayeredPane();
        batacar = new javax.swing.JButton();
        btransferir = new javax.swing.JButton();
        bcartas = new javax.swing.JButton();
        lejercitos = new javax.swing.JLabel();
        ljugador = new javax.swing.JLabel();
        jButton2 = new javax.swing.JButton();
        lptablero = new javax.swing.JLayeredPane();
        lt1 = new javax.swing.JLabel();
        lt31 = new javax.swing.JLabel();
        lt3 = new javax.swing.JLabel();
        lt4 = new javax.swing.JLabel();
        lt2 = new javax.swing.JLabel();
        lt5 = new javax.swing.JLabel();
        lt6 = new javax.swing.JLabel();
        lt29 = new javax.swing.JLabel();
        lt33 = new javax.swing.JLabel();
        lt34 = new javax.swing.JLabel();
        lt44 = new javax.swing.JLabel();
        lt45 = new javax.swing.JLabel();
        lt43 = new javax.swing.JLabel();
        lt32 = new javax.swing.JLabel();
        lt39 = new javax.swing.JLabel();
        lt40 = new javax.swing.JLabel();
        lt41 = new javax.swing.JLabel();
        lt42 = new javax.swing.JLabel();
        lt38 = new javax.swing.JLabel();
        lt37 = new javax.swing.JLabel();
        lt36 = new javax.swing.JLabel();
        lt35 = new javax.swing.JLabel();
        lt7 = new javax.swing.JLabel();
        lt9 = new javax.swing.JLabel();
        lt8 = new javax.swing.JLabel();
        lt10 = new javax.swing.JLabel();
        lt11 = new javax.swing.JLabel();
        lt12 = new javax.swing.JLabel();
        lt13 = new javax.swing.JLabel();
        lt14 = new javax.swing.JLabel();
        lt15 = new javax.swing.JLabel();
        lt16 = new javax.swing.JLabel();
        lt17 = new javax.swing.JLabel();
        lt18 = new javax.swing.JLabel();
        lt19 = new javax.swing.JLabel();
        lt20 = new javax.swing.JLabel();
        lt21 = new javax.swing.JLabel();
        lt23 = new javax.swing.JLabel();
        lt22 = new javax.swing.JLabel();
        lt26 = new javax.swing.JLabel();
        lt27 = new javax.swing.JLabel();
        lt25 = new javax.swing.JLabel();
        lt28 = new javax.swing.JLabel();
        lt24 = new javax.swing.JLabel();
        lt30 = new javax.swing.JLabel();
        lpanel = new javax.swing.JLabel();
        bcomenzar = new javax.swing.JButton();
        laccion = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        basignar.setText("Asignar Territorios");
        basignar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                basignarActionPerformed(evt);
            }
        });

        lpbotones.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 3, true));

        batacar.setText("Atacar");
        batacar.setBounds(10, 90, 120, -1);
        lpbotones.add(batacar, javax.swing.JLayeredPane.DEFAULT_LAYER);

        btransferir.setText("Transferir");
        btransferir.setBounds(10, 120, 120, -1);
        lpbotones.add(btransferir, javax.swing.JLayeredPane.DEFAULT_LAYER);

        bcartas.setText("Ver Cartas");
        bcartas.setBounds(10, 150, 120, -1);
        lpbotones.add(bcartas, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lejercitos.setFont(new java.awt.Font("Tahoma", 1, 11));
        lejercitos.setText("Ejercitos disponibles:");
        lejercitos.setBounds(10, 40, 160, -1);
        lpbotones.add(lejercitos, javax.swing.JLayeredPane.DEFAULT_LAYER);

        ljugador.setFont(new java.awt.Font("Tahoma", 1, 11));
        ljugador.setText("Es el turno del Jugador:");
        ljugador.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
        ljugador.setOpaque(true);
        ljugador.setBounds(10, 10, 170, 20);
        lpbotones.add(ljugador, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jButton2.setText("Finalizar turno");
        jButton2.setBounds(10, 180, 120, -1);
        lpbotones.add(jButton2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt1.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt1.setOpaque(true);
        lt1.setBounds(30, 30, 20, 20);
        lptablero.add(lt1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt31.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt31.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt31.setOpaque(true);
        lt31.setBounds(370, 210, 20, 20);
        lptablero.add(lt31, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt3.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt3.setOpaque(true);
        lt3.setBounds(70, 60, 20, 20);
        lptablero.add(lt3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt4.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt4.setOpaque(true);
        lt4.setBounds(100, 100, 20, 20);
        lptablero.add(lt4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt2.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt2.setOpaque(true);
        lt2.setBounds(54, 90, 20, 20);
        lptablero.add(lt2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt5.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt5.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt5.setOpaque(true);
        lt5.setBounds(130, 60, 20, 20);
        lptablero.add(lt5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt6.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt6.setOpaque(true);
        lt6.setBounds(150, 80, 20, 20);
        lptablero.add(lt6, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt29.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt29.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt29.setOpaque(true);
        lt29.setBounds(270, 154, 20, 20);
        lptablero.add(lt29, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt33.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt33.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt33.setOpaque(true);
        lt33.setBounds(330, 220, 20, 20);
        lptablero.add(lt33, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt34.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt34.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt34.setOpaque(true);
        lt34.setBounds(430, 220, 20, 20);
        lptablero.add(lt34, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt44.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt44.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt44.setOpaque(true);
        lt44.setBounds(510, 124, 20, 20);
        lptablero.add(lt44, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt45.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt45.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt45.setOpaque(true);
        lt45.setBounds(530, 174, 20, 20);
        lptablero.add(lt45, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt43.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt43.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt43.setOpaque(true);
        lt43.setBounds(480, 164, 20, 20);
        lptablero.add(lt43, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt32.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt32.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt32.setOpaque(true);
        lt32.setBounds(350, 280, 20, 20);
        lptablero.add(lt32, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt39.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt39.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt39.setOpaque(true);
        lt39.setBounds(390, 290, 20, 20);
        lptablero.add(lt39, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt40.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt40.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt40.setOpaque(true);
        lt40.setBounds(460, 260, 20, 20);
        lptablero.add(lt40, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt41.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt41.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt41.setOpaque(true);
        lt41.setBounds(480, 334, 20, 20);
        lptablero.add(lt41, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt42.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt42.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt42.setOpaque(true);
        lt42.setBounds(530, 380, 20, 20);
        lptablero.add(lt42, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt38.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt38.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt38.setOpaque(true);
        lt38.setBounds(420, 330, 20, 20);
        lptablero.add(lt38, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt37.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt37.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt37.setOpaque(true);
        lt37.setBounds(380, 334, 20, 20);
        lptablero.add(lt37, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt36.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt36.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt36.setOpaque(true);
        lt36.setBounds(260, 380, 20, 20);
        lptablero.add(lt36, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt35.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt35.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt35.setOpaque(true);
        lt35.setBounds(310, 340, 20, 20);
        lptablero.add(lt35, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt7.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt7.setOpaque(true);
        lt7.setBounds(20, 450, 20, 20);
        lptablero.add(lt7, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt9.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt9.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt9.setOpaque(true);
        lt9.setBounds(90, 480, 20, 20);
        lptablero.add(lt9, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt8.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt8.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt8.setOpaque(true);
        lt8.setBounds(40, 490, 20, 20);
        lptablero.add(lt8, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt10.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt10.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt10.setOpaque(true);
        lt10.setBounds(120, 500, 20, 20);
        lptablero.add(lt10, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt11.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt11.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt11.setOpaque(true);
        lt11.setBounds(100, 530, 20, 20);
        lptablero.add(lt11, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt12.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt12.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt12.setOpaque(true);
        lt12.setBounds(130, 564, 20, 20);
        lptablero.add(lt12, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt13.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt13.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt13.setOpaque(true);
        lt13.setBounds(310, 494, 20, 20);
        lptablero.add(lt13, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt14.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt14.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt14.setOpaque(true);
        lt14.setBounds(360, 480, 20, 20);
        lptablero.add(lt14, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt15.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt15.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt15.setOpaque(true);
        lt15.setBounds(360, 510, 20, 20);
        lptablero.add(lt15, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt16.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt16.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt16.setOpaque(true);
        lt16.setBounds(410, 500, 20, 20);
        lptablero.add(lt16, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt17.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt17.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt17.setOpaque(true);
        lt17.setBounds(400, 554, 20, 20);
        lptablero.add(lt17, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt18.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt18.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt18.setOpaque(true);
        lt18.setBounds(440, 540, 20, 20);
        lptablero.add(lt18, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt19.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt19.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt19.setOpaque(true);
        lt19.setBounds(440, 580, 20, 20);
        lptablero.add(lt19, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt20.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt20.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt20.setOpaque(true);
        lt20.setBounds(610, 550, 20, 20);
        lptablero.add(lt20, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt21.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt21.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt21.setOpaque(true);
        lt21.setBounds(610, 480, 20, 20);
        lptablero.add(lt21, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt23.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt23.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt23.setOpaque(true);
        lt23.setBounds(680, 520, 20, 20);
        lptablero.add(lt23, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt22.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt22.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt22.setOpaque(true);
        lt22.setBounds(640, 530, 20, 20);
        lptablero.add(lt22, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt26.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt26.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt26.setOpaque(true);
        lt26.setBounds(730, 500, 20, 20);
        lptablero.add(lt26, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt27.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt27.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt27.setOpaque(true);
        lt27.setBounds(760, 480, 20, 20);
        lptablero.add(lt27, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt25.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt25.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt25.setOpaque(true);
        lt25.setBounds(700, 470, 20, 20);
        lptablero.add(lt25, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt28.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt28.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt28.setOpaque(true);
        lt28.setBounds(730, 440, 20, 20);
        lptablero.add(lt28, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt24.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt24.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt24.setOpaque(true);
        lt24.setBounds(650, 480, 20, 20);
        lptablero.add(lt24, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lt30.setFont(new java.awt.Font("Tahoma", 1, 14));
        lt30.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        lt30.setOpaque(true);
        lt30.setBounds(330, 190, 20, 20);
        lptablero.add(lt30, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lpanel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Copia de tableroFINAL1.jpg"))); // NOI18N
        lpanel.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(227, 121, 22), 4));
        lpanel.setBounds(0, 2, 800, -1);
        lptablero.add(lpanel, javax.swing.JLayeredPane.DEFAULT_LAYER);

        bcomenzar.setText("Comenzar");
        bcomenzar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                bcomenzarActionPerformed(evt);
            }
        });

        laccion.setBackground(new java.awt.Color(255, 255, 255));
        laccion.setFont(new java.awt.Font("Tahoma", 1, 18));
        laccion.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 3));
        laccion.setOpaque(true);

        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()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(laccion, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 801, Short.MAX_VALUE)
                    .addComponent(lptablero, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 800, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(bcomenzar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(basignar, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 187, Short.MAX_VALUE))
                    .addComponent(lpbotones, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(basignar)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(bcomenzar)
                        .addGap(18, 18, 18)
                        .addComponent(lpbotones, javax.swing.GroupLayout.PREFERRED_SIZE, 252, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(lptablero, javax.swing.GroupLayout.PREFERRED_SIZE, 612, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(laccion, javax.swing.GroupLayout.DEFAULT_SIZE, 35, Short.MAX_VALUE))
        );

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

private void basignarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_basignarActionPerformed
// TODO add your handling code here:
    miPartida.asignarPartJug(miPartida);
    miPartida.asignarPartTer(miPartida);
    miPartida.asignarTerritorios();
    bcomenzar.setVisible(true);
}//GEN-LAST:event_basignarActionPerformed

private void bcomenzarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bcomenzarActionPerformed
// TODO add your handling code here:
    miPartida.ponerActivo();
}//GEN-LAST:event_bcomenzarActionPerformed


private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                               
   miPartida.getJugador(miPartida.getJugadorActivo()).atacarTerritorio();
   
}

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                               
   miPartida.getJugador(miPartida.getJugadorActivo()).verCartas();
   
}

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                               
   miPartida.getJugador(miPartida.getJugadorActivo()).transferirEjercitos();
   
}


    /**
    * @param args the command line arguments
    */
    

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton basignar;
    private javax.swing.JButton batacar;
    private javax.swing.JButton bcartas;
    private javax.swing.JButton bcomenzar;
    private javax.swing.JButton btransferir;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel laccion;
    private javax.swing.JLabel lejercitos;
    private javax.swing.JLabel ljugador;
    private javax.swing.JLabel lpanel;
    private javax.swing.JLayeredPane lpbotones;
    private javax.swing.JLayeredPane lptablero;
    private javax.swing.JLabel lt1;
    private javax.swing.JLabel lt10;
    private javax.swing.JLabel lt11;
    private javax.swing.JLabel lt12;
    private javax.swing.JLabel lt13;
    private javax.swing.JLabel lt14;
    private javax.swing.JLabel lt15;
    private javax.swing.JLabel lt16;
    private javax.swing.JLabel lt17;
    private javax.swing.JLabel lt18;
    private javax.swing.JLabel lt19;
    private javax.swing.JLabel lt2;
    private javax.swing.JLabel lt20;
    private javax.swing.JLabel lt21;
    private javax.swing.JLabel lt22;
    private javax.swing.JLabel lt23;
    private javax.swing.JLabel lt24;
    private javax.swing.JLabel lt25;
    private javax.swing.JLabel lt26;
    private javax.swing.JLabel lt27;
    private javax.swing.JLabel lt28;
    private javax.swing.JLabel lt29;
    private javax.swing.JLabel lt3;
    private javax.swing.JLabel lt30;
    private javax.swing.JLabel lt31;
    private javax.swing.JLabel lt32;
    private javax.swing.JLabel lt33;
    private javax.swing.JLabel lt34;
    private javax.swing.JLabel lt35;
    private javax.swing.JLabel lt36;
    private javax.swing.JLabel lt37;
    private javax.swing.JLabel lt38;
    private javax.swing.JLabel lt39;
    private javax.swing.JLabel lt4;
    private javax.swing.JLabel lt40;
    private javax.swing.JLabel lt41;
    private javax.swing.JLabel lt42;
    private javax.swing.JLabel lt43;
    private javax.swing.JLabel lt44;
    private javax.swing.JLabel lt45;
    private javax.swing.JLabel lt5;
    private javax.swing.JLabel lt6;
    private javax.swing.JLabel lt7;
    private javax.swing.JLabel lt8;
    private javax.swing.JLabel lt9;
    // End of variables declaration//GEN-END:variables

    public void update(Observable o, Object arg) {
        Territorio t=(Territorio)o;
        Color c=t.getColor();
        //String nom="lt"+t.getIdTerritorio();
        int id=t.getIdTerritorio();
        listalabels[id-1].setBackground(c);
    }
    
}
