Exemplo n.º 1
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    buttonGroup2 = new javax.swing.ButtonGroup();
    jPanel3 = new javax.swing.JPanel();
    size = new javax.swing.JLabel();
    sizes = new javax.swing.JComboBox();
    sizes.addItem("10x10");
    sizes.addItem("11x11");
    sizes.addItem("12x12");
    sizes.addItem("13x13");
    sizes.addItem("14x14");
    sizes.addItem("15x15");
    sizes.addItem("16x16");
    sizes.addItem("17x17");
    sizes.addItem("18x18");
    sizes.addItem("19x19");
    sizes.addItem("20x20");
    sizes.setSelectedIndex(0);
    nantenas = new javax.swing.JLabel();
    nant = new javax.swing.JTextField();
    pmax = new javax.swing.JLabel();
    pmaxima = new javax.swing.JTextField();
    jPanel2 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    HC = new javax.swing.JRadioButton();
    SA = new javax.swing.JRadioButton();
    jPanel5 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    heur1 = new javax.swing.JRadioButton();
    heur2 = new javax.swing.JRadioButton();
    heur3 = new javax.swing.JRadioButton();
    jPanel6 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    tiempo = new javax.swing.JTextField();
    jPanel1 = new javax.swing.JPanel();
    reiniciar = new javax.swing.JButton();
    ejecutar = new javax.swing.JButton();
    jPanel7 = new javax.swing.JPanel();
    instrum = new javax.swing.JTextArea();
    drawPanel1 = new IA.probAntenas.AntenasCoberturaPanel();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    Salir = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Antenas");
    getContentPane().setLayout(new java.awt.GridBagLayout());

    jPanel3.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    size.setText("Tamaño: ");
    jPanel3.add(size);

    sizes.setToolTipText("Tamaño del mapa");
    sizes.setPreferredSize(new java.awt.Dimension(70, 24));
    sizes.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            sizesActionPerformed(evt);
          }
        });
    jPanel3.add(sizes);

    nantenas.setText("Num Antenas:");
    jPanel3.add(nantenas);

    nant.setColumns(3);
    nant.setText(nc + "");
    jPanel3.add(nant);

    pmax.setText("Potencia Maxima:");
    jPanel3.add(pmax);

    pmaxima.setColumns(4);
    pmaxima.setText(pot + "");
    jPanel3.add(pmaxima);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(jPanel3, gridBagConstraints);

    jPanel2.setLayout(new java.awt.GridBagLayout());

    jLabel4.setText("Algoritmo: ");
    jPanel2.add(jLabel4, new java.awt.GridBagConstraints());

    buttonGroup1.add(HC);
    HC.setSelected(true);
    HC.setText("Hill Climbing");
    HC.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            HCActionPerformed(evt);
          }
        });
    jPanel2.add(HC, new java.awt.GridBagConstraints());

    buttonGroup1.add(SA);
    SA.setText("Annealing");
    SA.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SAActionPerformed(evt);
          }
        });
    jPanel2.add(SA, new java.awt.GridBagConstraints());

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 6;
    getContentPane().add(jPanel2, gridBagConstraints);

    jPanel5.setLayout(new java.awt.GridBagLayout());

    jLabel3.setText("Heuristicas: ");
    jPanel5.add(jLabel3, new java.awt.GridBagConstraints());

    buttonGroup2.add(heur1);
    heur1.setSelected(true);
    heur1.setLabel("Heuristico 1");
    heur1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            heur1ActionPerformed(evt);
          }
        });
    jPanel5.add(heur1, new java.awt.GridBagConstraints());

    buttonGroup2.add(heur2);
    heur2.setLabel("Heuristico 2");
    heur2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            heur2ActionPerformed(evt);
          }
        });
    jPanel5.add(heur2, new java.awt.GridBagConstraints());

    buttonGroup2.add(heur3);
    heur3.setLabel("Heuristico 3");
    heur3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            heur3ActionPerformed(evt);
          }
        });
    jPanel5.add(heur3, new java.awt.GridBagConstraints());

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jPanel5, gridBagConstraints);

    jPanel6.setLayout(new java.awt.GridBagLayout());

    jLabel1.setText("Tiempo: ");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = new java.awt.Insets(1, 27, 0, 0);
    jPanel6.add(jLabel1, gridBagConstraints);

    tiempo.setColumns(10);
    tiempo.setEditable(false);
    jPanel6.add(tiempo, new java.awt.GridBagConstraints());

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 4;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    getContentPane().add(jPanel6, gridBagConstraints);

    jPanel1.setMinimumSize(new java.awt.Dimension(100, 35));
    jPanel1.setPreferredSize(new java.awt.Dimension(500, 35));
    jPanel1.setLayout(new java.awt.GridBagLayout());

    reiniciar.setText("Actualizar parametros");
    reiniciar.setToolTipText("Reiniciar el mapa");
    reiniciar.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mousePressed(java.awt.event.MouseEvent evt) {
            reiniciarMousePressed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    jPanel1.add(reiniciar, gridBagConstraints);

    ejecutar.setText("Ejecutar");
    ejecutar.setToolTipText("Ejecutar el algoritmo seleccionado");
    ejecutar.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mousePressed(java.awt.event.MouseEvent evt) {
            ejecutarMousePressed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    jPanel1.add(ejecutar, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    getContentPane().add(jPanel1, gridBagConstraints);

    jPanel7.setPreferredSize(new java.awt.Dimension(600, 400));
    jPanel7.setLayout(new java.awt.GridBagLayout());

    instrum.setColumns(10);
    instrum.setEditable(false);
    instrum.setLineWrap(true);
    instrum.setRows(10);
    instrum.setPreferredSize(new java.awt.Dimension(180, 300));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    jPanel7.add(instrum, gridBagConstraints);

    drawPanel1.setPreferredSize(new java.awt.Dimension(400, 400));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    jPanel7.add(drawPanel1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridy = 1;
    getContentPane().add(jPanel7, gridBagConstraints);

    jMenu1.setText("Menu");

    Salir.setText("Salir");
    Salir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SalirActionPerformed(evt);
          }
        });
    jMenu1.add(Salir);

    jMenuBar1.add(jMenu1);

    setJMenuBar(jMenuBar1);

    pack();
  } // </editor-fold>//GEN-END:initComponents
Exemplo n.º 2
0
 /** El metodo actualizar se encarga del manejo del teclado y de movimiento de las imagenes */
 public void actualizar() {
   if (fondo1 != null) {
     fondo1.mover(10);
     fondo2.mover(10);
     fondo3.mover(10);
     fondo4.mover(10);
     puntajes.mover(1);
     ayuda.mover(1);
     creditos.mover(1);
     salir.mover(1);
     titulo.mover(1);
     menuPuntajes = null;
     menuAyuda = null;
     menuCreditos = null;
     menuSalir = null;
     menuInicio = null;
   }
   if (menuPuntajes != null) {
     try {
       menuPuntajes.actualizar();
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (menuAyuda != null) {
     try {
       menuAyuda.actualizar();
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (menuCreditos != null) {
     try {
       menuCreditos.actualizar();
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (menuSalir != null) {
     try {
       menuSalir.actualizar();
     } catch (Exception ex) {
       ex.printStackTrace();
     }
     if (menuSalir.getSalir()) {
       midlet.terminar();
       animador.terminar();
       midlet.detenerMusica();
       terminar = true;
     }
   }
   if (menuInicio != null) {
     try {
       menuInicio.actualizar();
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (highLight != null) {
     int estado = getKeyStates();
     if (estado == 0) {
       bandera = false;
     }
     if (highLight.getPrioridad() == juego.getPrioridad()) {
       if ((estado & UP_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(puntajes.getX() - 1, puntajes.getY() - 1);
         highLight.setPrioridad(puntajes.getPrioridad());
         bandera = true;
       }
       if ((estado & DOWN_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(salir.getX(), salir.getY());
         highLight.setPrioridad(salir.getPrioridad());
         bandera = true;
       }
       if ((estado & FIRE_PRESSED) != 0 && !bandera) {
         menuInicio = new Inicio(this);
         borrarTodo();
         bandera = true;
       }
     } else if (highLight.getPrioridad() == creditos.getPrioridad()) {
       if ((estado & UP_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(juego.getX(), juego.getY());
         highLight.setPrioridad(juego.getPrioridad());
         bandera = true;
       }
       if ((estado & LEFT_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(salir.getX(), salir.getY());
         highLight.setPrioridad(salir.getPrioridad());
         bandera = true;
       }
       if ((estado & FIRE_PRESSED) != 0) {
         menuCreditos = new Creditos(this);
         borrarTodo();
         bandera = true;
       }
     } else if (highLight.getPrioridad() == puntajes.getPrioridad()) {
       if ((estado & RIGHT_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(ayuda.getX(), ayuda.getY());
         highLight.setPrioridad(ayuda.getPrioridad());
         bandera = true;
       }
       if ((estado & DOWN_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(juego.getX(), juego.getY());
         highLight.setPrioridad(juego.getPrioridad());
         bandera = true;
       }
       if ((estado & FIRE_PRESSED) != 0) {
         try {
           menuPuntajes = new Puntajes(this, lecturaScores());
         } catch (IOException ex) {
           menuPuntajes = new Puntajes(this, "0");
         }
         borrarTodo();
         bandera = true;
       }
     } else if (highLight.getPrioridad() == salir.getPrioridad()) {
       if ((estado & RIGHT_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(creditos.getX(), creditos.getY());
         highLight.setPrioridad(creditos.getPrioridad());
         bandera = true;
       }
       if ((estado & UP_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(juego.getX(), juego.getY());
         highLight.setPrioridad(juego.getPrioridad());
         bandera = true;
       }
       if ((estado & FIRE_PRESSED) != 0) {
         menuSalir = new Salir(this);
         borrarTodo();
         bandera = true;
       }
     } else if (highLight.getPrioridad() == ayuda.getPrioridad()) {
       if ((estado & LEFT_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(puntajes.getX(), puntajes.getY());
         highLight.setPrioridad(puntajes.getPrioridad());
         bandera = true;
       }
       if ((estado & DOWN_PRESSED) != 0 && !bandera) {
         highLight.setPosicion(juego.getX(), juego.getY());
         highLight.setPrioridad(juego.getPrioridad());
         bandera = true;
       }
       if ((estado & FIRE_PRESSED) != 0) {
         menuAyuda = new Ayuda(this);
         borrarTodo();
         bandera = true;
       }
     }
   }
 }
Exemplo n.º 3
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() {

    informacionLabel = new javax.swing.JLabel();
    nombreLabel = new javax.swing.JLabel();
    nombreTextField = new javax.swing.JTextField();
    fechaInicioLabel = new javax.swing.JLabel();
    fechaInicioTextField = new javax.swing.JTextField();
    fechaFinLabel = new javax.swing.JLabel();
    fechaFinTextField = new javax.swing.JTextField();
    plazasLabel = new javax.swing.JLabel();
    plazasTextField = new javax.swing.JTextField();
    descripcionLabel = new javax.swing.JLabel();
    descripcionScrollPane = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    Salir = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

    informacionLabel.setText("Informacion");

    nombreLabel.setText("Nombre");

    fechaInicioLabel.setText("Fecha inicio");

    fechaFinLabel.setText("Fecha Fin");

    plazasLabel.setText("Plazas");

    descripcionLabel.setText("Descripcion");

    jTextArea1.setColumns(20);
    jTextArea1.setRows(5);
    descripcionScrollPane.setViewportView(jTextArea1);

    Salir.setText("Salir");
    Salir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SalirActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(20, 20, 20)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(fechaInicioLabel)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        fechaInicioTextField,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        181,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(29, 29, 29)
                                    .addComponent(fechaFinLabel)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(fechaFinTextField))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(nombreLabel)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        nombreTextField,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        239,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addComponent(informacionLabel)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(plazasLabel)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(
                                                        plazasTextField,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        58,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(descripcionLabel)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)
                                                    .addComponent(
                                                        descripcionScrollPane,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        415,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(0, 68, Short.MAX_VALUE)))
                    .addContainerGap())
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(Salir)
                    .addGap(27, 27, 27)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(23, 23, 23)
                    .addComponent(informacionLabel)
                    .addGap(36, 36, 36)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(nombreLabel)
                            .addComponent(
                                nombreTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(22, 22, 22)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(fechaInicioLabel)
                            .addComponent(
                                fechaInicioTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(fechaFinLabel)
                            .addComponent(
                                fechaFinTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(22, 22, 22)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(plazasLabel)
                            .addComponent(
                                plazasTextField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(descripcionLabel)
                            .addComponent(
                                descripcionScrollPane,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                101,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(Salir)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
  } // </editor-fold>//GEN-END:initComponents
Exemplo n.º 4
0
  /** Este metodo te permite dibujar todas las opciones del menu asi como los respectivos fondos. */
  public void dibujar() {
    if (logoTec != null) {
      dibujarLogoTec();
    }
    logoTec = null;
    if (fondo4 != null) {
      fondo1.dibujar(g);
      fondo2.dibujar(g);
      fondo3.dibujar(g);
      fondo4.dibujar(g);
      if (fondo4.getY() >= 108) {
        puntajes.dibujar(g);
        if (highLight.getPrioridad() == puntajes.getPrioridad()) {
          tituloPuntajes.dibujar(g);
        }

        ayuda.dibujar(g);
        if (highLight.getPrioridad() == ayuda.getPrioridad()) {
          tituloAyuda.dibujar(g);
        }

        creditos.dibujar(g);
        if (highLight.getPrioridad() == creditos.getPrioridad()) {
          tituloCreditos.dibujar(g);
        }

        salir.dibujar(g);
        if (highLight.getPrioridad() == salir.getPrioridad()) {
          tituloSalir.dibujar(g);
        }

        juego.dibujar(g);
        if (puntajes.getX() <= 20) {
          if (highLight.getPrioridad() == juego.getPrioridad()) {
            tituloJuego1.dibujar(g);
            tituloJuego2.dibujar(g);
            tituloJuego3.dibujar(g);
            tituloJuego4.dibujar(g);
          }
        }

        highLight.dibujar(g);
        titulo.dibujar(g);
      }
    }

    if (menuPuntajes != null) {
      menuPuntajes.g = this.getGraphics();
      menuPuntajes.dibujar();
    }

    if (menuAyuda != null) {
      menuAyuda.g = this.getGraphics();
      menuAyuda.dibujar();
    }

    if (menuCreditos != null) {
      menuCreditos.g = this.getGraphics();
      menuCreditos.dibujar();
    }

    if (menuSalir != null) {
      menuSalir.g = this.getGraphics();
      menuSalir.dibujar();
    }

    if (menuInicio != null) {
      menuInicio.g = this.getGraphics();
      menuInicio.dibujar();
    }

    flushGraphics();
  }
Exemplo n.º 5
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel2 = new javax.swing.JLabel();
    HillClimbingL = new javax.swing.JLabel();
    AnnealingL = new javax.swing.JLabel();
    annealingTA = new java.awt.TextArea();
    hillClimbTA = new java.awt.TextArea();
    ciudadesL = new java.awt.Label();
    ejecutarB = new javax.swing.JButton();
    CiudadesS = new javax.swing.JSlider();
    ejecutarPrB = new javax.swing.JButton();
    SemillaL = new javax.swing.JLabel();
    SemillaTF = new javax.swing.JFormattedTextField(new Integer(1));
    AnnealingPL = new javax.swing.JLabel();
    NiterL = new javax.swing.JLabel();
    NiterS = new javax.swing.JSlider();
    LambdaL = new javax.swing.JLabel();
    ParKS = new javax.swing.JSlider();
    ParKL = new javax.swing.JLabel();
    LambdaFT = new javax.swing.JFormattedTextField();
    jMenuBar1 = new javax.swing.JMenuBar();
    jMenu1 = new javax.swing.JMenu();
    Salir = new javax.swing.JMenuItem();

    jLabel2.setText("jLabel2");

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Travelling Salesman Problem");

    HillClimbingL.setText("Hill Climbing");

    AnnealingL.setText("Simulated Annealing");

    annealingTA.setColumns(40);
    annealingTA.setEditable(false);
    annealingTA.setRows(30);

    hillClimbTA.setColumns(37);
    hillClimbTA.setEditable(false);
    hillClimbTA.setName("hillClimbingTA"); // NOI18N
    hillClimbTA.setRows(30);

    ciudadesL.setText("Num Ciudades:");

    ejecutarB.setText("Ejecutar Prob Aleatorio");
    ejecutarB.setActionCommand(" Ejecutar");
    ejecutarB.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mousePressed(java.awt.event.MouseEvent evt) {
            ejecutarBMousePressed(evt);
          }
        });

    CiudadesS.setMajorTickSpacing(5);
    CiudadesS.setMaximum(40);
    CiudadesS.setMinimum(10);
    CiudadesS.setMinorTickSpacing(5);
    CiudadesS.setPaintLabels(true);
    CiudadesS.setPaintTicks(true);
    CiudadesS.setSnapToTicks(true);
    CiudadesS.setToolTipText("Elige el número de ciudades");
    CiudadesS.setValue(10);

    ejecutarPrB.setText("Ejecutar Prob Específico");
    ejecutarPrB.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            ejecutarPrBActionPerformed(evt);
          }
        });

    SemillaL.setText("Semilla:");

    SemillaTF.setFormatterFactory(formSeed);
    SemillaTF.setHorizontalAlignment(javax.swing.JTextField.RIGHT);

    AnnealingPL.setText("Parametros Annealing");

    NiterL.setText("Num It:");

    NiterS.setMajorTickSpacing(1000);
    NiterS.setMaximum(10000);
    NiterS.setMinimum(1000);
    NiterS.setMinorTickSpacing(1000);
    NiterS.setOrientation(javax.swing.JSlider.VERTICAL);
    NiterS.setPaintLabels(true);
    NiterS.setPaintTicks(true);
    NiterS.setSnapToTicks(true);
    NiterS.setToolTipText("Numero de iteraciones total");

    LambdaL.setText("Lambda");

    ParKS.setMajorTickSpacing(1);
    ParKS.setMaximum(20);
    ParKS.setMinimum(1);
    ParKS.setMinorTickSpacing(1);
    ParKS.setOrientation(javax.swing.JSlider.VERTICAL);
    ParKS.setPaintLabels(true);
    ParKS.setPaintTicks(true);
    ParKS.setSnapToTicks(true);
    ParKS.setToolTipText("Lambda");
    ParKS.setValue(5);

    ParKL.setText("K");

    LambdaFT.setFormatterFactory(formLambda);
    LambdaFT.setToolTipText("Parametro Lambda");
    LambdaFT.setValue(new Double(0.01));

    jMenu1.setText("Menu");

    Salir.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/Imagenes/door_out.png"))); // NOI18N
    Salir.setText("Salir");
    Salir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            SalirActionPerformed(evt);
          }
        });
    jMenu1.add(Salir);

    jMenuBar1.add(jMenu1);

    setJMenuBar(jMenuBar1);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(12, 12, 12)
                                    .add(
                                        hillClimbTA,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        313,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        annealingTA,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        317,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(NiterL)
                                                            .add(
                                                                NiterS,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE))
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .TRAILING,
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .add(ParKL)
                                                                    .add(21, 21, 21))
                                                            .add(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .add(
                                                                        ParKS,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        Short.MAX_VALUE)
                                                                    .addPreferredGap(
                                                                        org.jdesktop.layout
                                                                            .LayoutStyle.RELATED)))
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .LEADING)
                                                            .add(
                                                                LambdaFT,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                72,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE)
                                                            .add(LambdaL)))
                                            .add(AnnealingPL)))
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(149, 149, 149)
                                    .add(ejecutarB)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(ejecutarPrB)
                                    .add(22, 22, 22)
                                    .add(SemillaL)
                                    .add(27, 27, 27)
                                    .add(
                                        SemillaTF,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        89,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(180, 180, 180)
                                    .add(
                                        ciudadesL,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(19, 19, 19)
                                    .add(
                                        CiudadesS,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(109, 109, 109)
                                    .add(HillClimbingL)
                                    .add(233, 233, 233)
                                    .add(AnnealingL)))
                    .addContainerGap(41, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                CiudadesS,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(20, 20, 20)
                                    .add(
                                        ciudadesL,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup().add(19, 19, 19).add(HillClimbingL))
                            .add(layout.createSequentialGroup().add(18, 18, 18).add(AnnealingL)))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .add(AnnealingPL)
                                    .add(25, 25, 25)
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.BASELINE)
                                            .add(NiterL)
                                            .add(LambdaL)
                                            .add(ParKL))
                                    .add(
                                        layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(15, 15, 15)
                                                    .add(
                                                        NiterS,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .DEFAULT_SIZE,
                                                        org.jdesktop.layout.GroupLayout
                                                            .PREFERRED_SIZE)
                                                    .addPreferredGap(
                                                        org.jdesktop.layout.LayoutStyle.RELATED,
                                                        69,
                                                        Short.MAX_VALUE))
                                            .add(
                                                layout
                                                    .createSequentialGroup()
                                                    .add(18, 18, 18)
                                                    .add(
                                                        layout
                                                            .createParallelGroup(
                                                                org.jdesktop.layout.GroupLayout
                                                                    .BASELINE)
                                                            .add(
                                                                LambdaFT,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE)
                                                            .add(
                                                                ParKS,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                266,
                                                                Short.MAX_VALUE)))))
                            .add(
                                annealingTA,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                343,
                                Short.MAX_VALUE)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                hillClimbTA,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                343,
                                Short.MAX_VALUE))
                    .add(24, 24, 24)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(ejecutarPrB)
                            .add(SemillaL)
                            .add(
                                SemillaTF,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                ejecutarB,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                25,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

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