/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package arql2020;

import Calculos_automaticos.B_Composicion_puntasfilossup;
import static arql2020.ARQL2020.capa_nivel;
import static arql2020.ARQL2020.cuadro;
import static arql2020.ARQL2020.episodio_estruct_planta;
import static arql2020.ARQL2020.estruct_arq;
import static arql2020.ARQL2020.localidad;
import static arql2020.ARQL2020.microsector;
import static arql2020.ARQL2020.nombre_estruct_planta;
import static arql2020.ARQL2020.piso_subcapa;
import static arql2020.ARQL2020.siglasitio;
import static arql2020.ARQL2020.sitio;
import static arql2020.ARQL2020.tipo_estruct_planta;
import static arql2020.ARQL2020.zona_ambiental;
import static arql2020.DT_frame.selectednodeparaeliminar;
import static arql2020.FORMATIZADOS_frame.editando;
import static arql2020.FORMATIZADOS_frame.expandirultimarama;
import static arql2020.FORMATIZADOS_frame.jTree1;
import clases.Cargar_MP;
import java.beans.PropertyVetoException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.tree.DefaultMutableTreeNode;
import javax.swing.tree.DefaultTreeModel;
import static arql2020.FORMATIZADOS_frame.model;
import static arql2020.FORMATIZADOS_frame.selectednode;
import static arql2020.Internal_Formatizados.btn_eliminar_formatizados;
import static arql2020.Internal_Formatizados.c32_txt_posicion_sust_adherida;
import static arql2020.Internal_puntas.btn_eliminarpuntas;
import static arql2020.Internal_puntas.p1_txt_codigopieza;
import clases.InteraccionesBD;
import clases.ValidarCampos;
import clases.bagolini_tamaños;
import clases.conexion;
import java.sql.SQLException;
import java.util.Enumeration;
import javax.swing.JOptionPane;
import javax.swing.tree.TreeNode;

/**
 *
 * @author chuen
 */
public class Internal_Nucleos extends javax.swing.JInternalFrame {

String subgrupotipologico = "";
String angulo = "";

        
        public Internal_Nucleos() {
        initComponents();
                try{
            this.setMaximum(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(B_Composicion_puntasfilossup.class.getName()).log(Level.SEVERE, null, ex);
        }   
    }

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

        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        n1_txt_codigonucleo = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        n2_txt_grupotipologico = new javax.swing.JTextField();
        n3_cbx_subgrupotipologico = new javax.swing.JComboBox<>();
        jLabel39 = new javax.swing.JLabel();
        n0_txt_codigopieza = new javax.swing.JTextField();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        n5_txt_numplat = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jLabel20 = new javax.swing.JLabel();
        n6_txt_anchoplat = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        n8_txt_espesorplat = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        n10_cbx_formasupplat = new javax.swing.JComboBox<>();
        n7_chk_anchofracturado = new javax.swing.JCheckBox();
        n9_chk_espesorfracturado = new javax.swing.JCheckBox();
        jLabel38 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        n4_txt_angulo_ultima_plataforma = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jLabel22 = new javax.swing.JLabel();
        n20_txt_largomenorlascado = new javax.swing.JTextField();
        jLabel23 = new javax.swing.JLabel();
        n14_txt_largolascado = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        n11_cbx_estadobordeextrac = new javax.swing.JComboBox<>();
        jLabel27 = new javax.swing.JLabel();
        n16_txt_ancholascado = new javax.swing.JTextField();
        jLabel28 = new javax.swing.JLabel();
        n18_txt_tamañomayorlascado = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel29 = new javax.swing.JLabel();
        n12_txt_anchotalon = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        n19_txt_moduloomayorlascado = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        n22_txt_anchomenorlascado = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        n24_txt_tamañomenorlascado = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        n25_txt_modulomenorlascado = new javax.swing.JTextField();
        jButton2 = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel35 = new javax.swing.JLabel();
        jLabel36 = new javax.swing.JLabel();
        n13_chk_anchotalonfracturado_lascadomayor = new javax.swing.JCheckBox();
        n15_chk_largofracturado_lascadomayor = new javax.swing.JCheckBox();
        n17_chk_anchofracturado_lascadomayor = new javax.swing.JCheckBox();
        n23_chk_anchofracturado_lascadomenor = new javax.swing.JCheckBox();
        n21_chk_largofracturado_lascadomenor = new javax.swing.JCheckBox();
        jLabel43 = new javax.swing.JLabel();
        n26_cbx_patina = new javax.swing.JComboBox<>();
        jLabel44 = new javax.swing.JLabel();
        n27_cbx_ventifaccion = new javax.swing.JComboBox<>();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel30 = new javax.swing.JLabel();
        n28_cbx_reactivacion = new javax.swing.JComboBox<>();
        jLabel25 = new javax.swing.JLabel();
        n29_cbx_corteza = new javax.swing.JComboBox<>();
        jLabel42 = new javax.swing.JLabel();
        n11_cbx_estadoFRENTEextrac9 = new javax.swing.JComboBox<>();
        jScrollPane3 = new javax.swing.JScrollPane();
        n30_txta_observ = new javax.swing.JTextArea();
        jLabel26 = new javax.swing.JLabel();
        btnguardar = new javax.swing.JButton();
        guardarbtn = new javax.swing.JButton();
        jLabel16 = new javax.swing.JLabel();
        jSeparator4 = new javax.swing.JSeparator();
        btn_eliminar_nucleo = new javax.swing.JButton();

        setResizable(true);
        setTitle("Ficha de Núcleos");
        addInternalFrameListener(new javax.swing.event.InternalFrameListener() {
            public void internalFrameActivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosed(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameClosing(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameIconified(javax.swing.event.InternalFrameEvent evt) {
            }
            public void internalFrameOpened(javax.swing.event.InternalFrameEvent evt) {
                formInternalFrameOpened(evt);
            }
        });

        jPanel2.setBackground(new java.awt.Color(255, 204, 102));

        jPanel3.setBackground(new java.awt.Color(252, 218, 150));
        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Códigos", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel17.setText("Código ARQ:L núcleo");

        n1_txt_codigonucleo.setEditable(false);
        n1_txt_codigonucleo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N

        jLabel18.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel18.setText("Grupo tipológico");

        n2_txt_grupotipologico.setEditable(false);
        n2_txt_grupotipologico.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n2_txt_grupotipologico.setText("Nu-Núcleo");
        n2_txt_grupotipologico.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                n2_txt_grupotipologicoActionPerformed(evt);
            }
        });

        n3_cbx_subgrupotipologico.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n3_cbx_subgrupotipologico.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Subgrupos tipológicos de Núcleos", "1_1-Núcleo de lascas: Poliédrico", "1_2-Núcleo de lascas: Discoidal", "1_3-Núcleo de lascas: Bifacial", "1_4-Núcleo de lascas: Prismático atípico de lascas", "1_9-Núcleo de lascas: Otro no diferenciado de lascas", "2_1-Núcleo de hojas: Prismático de hojas de extracciones unidireccionales", "2_2-Núcleo de hojas: Prismático de hojas de extracciones bidireccionales", "2_3-Núcleo de hojas: Piramidal", "2_9-Núcleo de hojas: Otro de hojas no diferenciados", "3-Núcleo de extacciones combinadas", "4-Nucleiforme", "5-Globuloso o agotado", "6-Núcleo de lascados aislados", "7-Núcleo bipolar", "9-Fragmento no diferenciado de núcleo", "CN" }));

        jLabel39.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel39.setText("Código ARQ:L general");

        n0_txt_codigopieza.setEditable(false);
        n0_txt_codigopieza.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N

        jLabel40.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel40.setText("Subgrupo tipológico*");

        jLabel41.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel41.setText("FAMILIA: G");

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(n3_cbx_subgrupotipologico, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel39)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                        .addComponent(jLabel18, javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(jLabel17, javax.swing.GroupLayout.Alignment.TRAILING)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(n1_txt_codigonucleo, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(n0_txt_codigopieza, javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(n2_txt_grupotipologico, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(jLabel40)
                            .addComponent(jLabel41))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel39)
                    .addComponent(n0_txt_codigopieza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(9, 9, 9)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel17)
                    .addComponent(n1_txt_codigonucleo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(n2_txt_grupotipologico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addGap(24, 24, 24)
                .addComponent(jLabel40)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(n3_cbx_subgrupotipologico, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jLabel41)
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jPanel4.setBackground(new java.awt.Color(252, 218, 150));
        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Plataforma*", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        n5_txt_numplat.setBackground(new java.awt.Color(255, 255, 0));
        n5_txt_numplat.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n5_txt_numplat.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n5_txt_numplatKeyTyped(evt);
            }
        });

        jLabel19.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel19.setText("N° plataforma");

        jLabel20.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel20.setText("Ancho (cm)");

        n6_txt_anchoplat.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n6_txt_anchoplat.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n6_txt_anchoplatKeyTyped(evt);
            }
        });

        jLabel21.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel21.setText("Espesor (cm)");

        n8_txt_espesorplat.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n8_txt_espesorplat.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n8_txt_espesorplatKeyTyped(evt);
            }
        });

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel2.setText("Forma de la superficie*");

        n10_cbx_formasupplat.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n10_cbx_formasupplat.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione:", "Ct-Cortical", "LiC-Liso cortical", "Li-Liso", "Fc-Facetado", "Di-Diedro", "Fi-Filiforme", "Pt-Puntiforme", "Fr-Fracturado", "Eli-Eliminado", "ND-No diferenciado", "CN" }));

        n7_chk_anchofracturado.setText("Fracturado");
        n7_chk_anchofracturado.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n7_chk_anchofracturadoItemStateChanged(evt);
            }
        });

        n9_chk_espesorfracturado.setText("Fracturado");
        n9_chk_espesorfracturado.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n9_chk_espesorfracturadoItemStateChanged(evt);
            }
        });

        jLabel38.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel38.setText("(transversal al último frente de extracción)");

        jLabel37.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel37.setText("Ángulo medido de la plataforma");

        n4_txt_angulo_ultima_plataforma.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n4_txt_angulo_ultima_plataforma.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n4_txt_angulo_ultima_plataformaKeyTyped(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(26, 26, 26)
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(n10_cbx_formasupplat, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addContainerGap()
                            .addComponent(jLabel38, javax.swing.GroupLayout.PREFERRED_SIZE, 278, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                            .addGap(71, 71, 71)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jLabel21)
                                .addComponent(jLabel20)
                                .addComponent(jLabel19))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(n5_txt_numplat, javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(n8_txt_espesorplat, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(n6_txt_anchoplat, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGap(18, 18, 18)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(n7_chk_anchofracturado)
                                .addComponent(n9_chk_espesorfracturado))))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel37)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(n4_txt_angulo_ultima_plataforma, javax.swing.GroupLayout.PREFERRED_SIZE, 87, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(51, 51, 51)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel19)
                    .addComponent(n5_txt_numplat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n6_txt_anchoplat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel20)
                    .addComponent(n7_chk_anchofracturado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n8_txt_espesorplat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21)
                    .addComponent(n9_chk_espesorfracturado))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel38)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n10_cbx_formasupplat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(n4_txt_angulo_ultima_plataforma, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18))
        );

        jPanel5.setBackground(new java.awt.Color(252, 218, 150));
        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Frente de extracción* (último uso)", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14))); // NOI18N

        jLabel22.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel22.setText("Largo (cm)");

        n20_txt_largomenorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n20_txt_largomenorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n20_txt_largomenorlascadoKeyTyped(evt);
            }
        });

        jLabel23.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel23.setText("Largo del lascado (cm)");

        n14_txt_largolascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n14_txt_largolascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n14_txt_largolascadoKeyTyped(evt);
            }
        });

        jLabel24.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel24.setText("Estado del borde de extracción");

        n11_cbx_estadobordeextrac.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n11_cbx_estadobordeextrac.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione:", "AcRq-Activo retocado simple", "AcRqAs-Activo retocado astillado", "AcNR-Activo no retocado", "Em-Embotado(+80°)", "EmAs-Embotado astillado", "EmAsEs-Embotado con astilladuras escalonadas", "Ab-Abradido", "NP-No preparado", "ND-No diferenciado", "CN" }));

        jLabel27.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel27.setText("Ancho del lascado (cm)");

        n16_txt_ancholascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n16_txt_ancholascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n16_txt_ancholascadoKeyTyped(evt);
            }
        });

        jLabel28.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel28.setText("Tamaño*");

        n18_txt_tamañomayorlascado.setEditable(false);
        n18_txt_tamañomayorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n18_txt_tamañomayorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n18_txt_tamañomayorlascadoKeyTyped(evt);
            }
        });

        jButton1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton1.setText("Calcular");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jLabel29.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel29.setText("Ancho del talón (cm)");

        n12_txt_anchotalon.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n12_txt_anchotalon.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n12_txt_anchotalonKeyTyped(evt);
            }
        });

        jLabel31.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel31.setText("Módulo long/ancho*");

        n19_txt_moduloomayorlascado.setEditable(false);
        n19_txt_moduloomayorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n19_txt_moduloomayorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n19_txt_moduloomayorlascadoKeyTyped(evt);
            }
        });

        jLabel32.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel32.setText("Ancho (cm)");

        n22_txt_anchomenorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n22_txt_anchomenorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n22_txt_anchomenorlascadoKeyTyped(evt);
            }
        });

        jLabel33.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel33.setText("Tamaño*");

        n24_txt_tamañomenorlascado.setEditable(false);
        n24_txt_tamañomenorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n24_txt_tamañomenorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n24_txt_tamañomenorlascadoKeyTyped(evt);
            }
        });

        jLabel34.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel34.setText("Módulo long/ancho*");

        n25_txt_modulomenorlascado.setEditable(false);
        n25_txt_modulomenorlascado.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n25_txt_modulomenorlascado.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n25_txt_modulomenorlascadoKeyTyped(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton2.setText("Calcular");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jLabel35.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel35.setText("Lascado último o de mayor tamaño");

        jLabel36.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel36.setText("Lascado de menor tamaño");

        n13_chk_anchotalonfracturado_lascadomayor.setText("Fracturado");
        n13_chk_anchotalonfracturado_lascadomayor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n13_chk_anchotalonfracturado_lascadomayorItemStateChanged(evt);
            }
        });

        n15_chk_largofracturado_lascadomayor.setText("Fracturado");
        n15_chk_largofracturado_lascadomayor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n15_chk_largofracturado_lascadomayorItemStateChanged(evt);
            }
        });

        n17_chk_anchofracturado_lascadomayor.setText("Fracturado");
        n17_chk_anchofracturado_lascadomayor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n17_chk_anchofracturado_lascadomayorItemStateChanged(evt);
            }
        });

        n23_chk_anchofracturado_lascadomenor.setText("Fracturado");
        n23_chk_anchofracturado_lascadomenor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n23_chk_anchofracturado_lascadomenorItemStateChanged(evt);
            }
        });

        n21_chk_largofracturado_lascadomenor.setText("Fracturado");
        n21_chk_largofracturado_lascadomenor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                n21_chk_largofracturado_lascadomenorItemStateChanged(evt);
            }
        });

        jLabel43.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel43.setText("Intensidad pátina ");

        n26_cbx_patina.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n26_cbx_patina.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "0-Sin pátina", "1-Débil", "2-Media", "3-Fuerte", "CN" }));

        jLabel44.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel44.setText("Intensidad ventifacción");

        n27_cbx_ventifaccion.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n27_cbx_ventifaccion.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "0-Sin ventifacción", "1-Débil", "2-Media", "3-Fuerte", "CN" }));

        jLabel30.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel30.setText("Reactivación de la plataforma ");

        n28_cbx_reactivacion.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n28_cbx_reactivacion.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "1-Sí", "0-No", "CN" }));

        jLabel25.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel25.setText("¿Corteza?");

        n29_cbx_corteza.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n29_cbx_corteza.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "1-Sí", "0-No", "CN" }));

        jLabel42.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel42.setText("Estado del frente de extracción");

        n11_cbx_estadoFRENTEextrac9.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        n11_cbx_estadoFRENTEextrac9.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione:", "AcRq-Activo retocado simple", "AcRqAs-Activo retocado astillado", "AcNR-Activo no retocado", "Em-Embotado(+80°)", "EmAs-Embotado astillado", "EmAsEs-Embotado con astilladuras escalonadas", "Ab-Abradido", "NP-No preparado", "ND-No diferenciado", "CN" }));

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(0, 0, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel34, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel33, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel32, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel22, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(n22_txt_anchomenorlascado, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(n24_txt_tamañomenorlascado, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(n25_txt_modulomenorlascado, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(n20_txt_largomenorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton2)
                    .addComponent(n23_chk_anchofracturado_lascadomenor)
                    .addComponent(n21_chk_largofracturado_lascadomenor))
                .addGap(18, 18, 18))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator2))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator1))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                        .addGap(136, 136, 136)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel31)
                            .addComponent(jLabel27)
                            .addComponent(jLabel23)
                            .addComponent(jLabel29)
                            .addComponent(jLabel28))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(n18_txt_tamañomayorlascado)
                            .addComponent(n14_txt_largolascado, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(n16_txt_ancholascado, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(n19_txt_moduloomayorlascado, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(n12_txt_anchotalon))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(n15_chk_largofracturado_lascadomayor)
                            .addComponent(n13_chk_anchotalonfracturado_lascadomayor)
                            .addComponent(n17_chk_anchofracturado_lascadomayor)
                            .addComponent(jButton1))
                        .addGap(10, 10, 10))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel35)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel24)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(n11_cbx_estadobordeextrac, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 10, Short.MAX_VALUE)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addComponent(jSeparator3)
                .addContainerGap())
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel30)
                    .addComponent(jLabel25, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(n29_cbx_corteza, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(n28_cbx_reactivacion, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel36))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGap(60, 60, 60)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel44)
                            .addComponent(jLabel43))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(n26_cbx_patina, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(n27_cbx_ventifaccion, javax.swing.GroupLayout.PREFERRED_SIZE, 209, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jLabel42)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(n11_cbx_estadoFRENTEextrac9, javax.swing.GroupLayout.PREFERRED_SIZE, 297, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel5Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n11_cbx_estadoFRENTEextrac9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel42))
                .addGap(8, 8, 8)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n11_cbx_estadobordeextrac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel24))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(8, 8, 8)
                .addComponent(jLabel35)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n12_txt_anchotalon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)
                    .addComponent(n13_chk_anchotalonfracturado_lascadomayor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel23)
                    .addComponent(n14_txt_largolascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(n15_chk_largofracturado_lascadomayor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 6, Short.MAX_VALUE)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel27)
                    .addComponent(n16_txt_ancholascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(n17_chk_anchofracturado_lascadomayor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(n18_txt_tamañomayorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel28))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(n19_txt_moduloomayorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel31)))
                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel36)
                .addGap(22, 22, 22)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n20_txt_largomenorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel22)
                    .addComponent(n21_chk_largofracturado_lascadomenor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n22_txt_anchomenorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel32)
                    .addComponent(n23_chk_anchofracturado_lascadomenor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(n24_txt_tamañomenorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel33))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(n25_txt_modulomenorlascado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel34)))
                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(29, 29, 29)
                .addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n26_cbx_patina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel43))
                .addGap(9, 9, 9)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n27_cbx_ventifaccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel44))
                .addGap(12, 12, 12)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(n28_cbx_reactivacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(n29_cbx_corteza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25))
                .addContainerGap())
        );

        n30_txta_observ.setColumns(20);
        n30_txta_observ.setFont(new java.awt.Font("Monospaced", 0, 16)); // NOI18N
        n30_txta_observ.setLineWrap(true);
        n30_txta_observ.setRows(5);
        n30_txta_observ.setWrapStyleWord(true);
        n30_txta_observ.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyPressed(java.awt.event.KeyEvent evt) {
                n30_txta_observKeyPressed(evt);
            }
            public void keyTyped(java.awt.event.KeyEvent evt) {
                n30_txta_observKeyTyped(evt);
            }
        });
        jScrollPane3.setViewportView(n30_txta_observ);

        jLabel26.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel26.setText("Observaciones");

        btnguardar.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        btnguardar.setText("Limpiar campos");
        btnguardar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnguardarActionPerformed(evt);
            }
        });

        guardarbtn.setBackground(new java.awt.Color(255, 255, 153));
        guardarbtn.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        guardarbtn.setText("Guardar");
        guardarbtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                guardarbtnActionPerformed(evt);
            }
        });

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 16)); // NOI18N
        jLabel16.setText("Descripción segmental de núcleos");

        btn_eliminar_nucleo.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        btn_eliminar_nucleo.setText("Eliminar");
        btn_eliminar_nucleo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_eliminar_nucleoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(46, 46, 46)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel2Layout.createSequentialGroup()
                                .addComponent(btnguardar, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(54, 54, 54)
                                .addComponent(btn_eliminar_nucleo, javax.swing.GroupLayout.PREFERRED_SIZE, 157, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(guardarbtn, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jPanel3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPanel4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel26, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(190, 190, 190)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jSeparator4))))
                .addContainerGap(275, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel16)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator4, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(34, 34, 34)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 65, Short.MAX_VALUE)
                .addComponent(jLabel26)
                .addGap(7, 7, 7)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnguardar)
                    .addComponent(guardarbtn)
                    .addComponent(btn_eliminar_nucleo))
                .addGap(29, 29, 29))
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(0, 0, 0))
        );

        jScrollPane1.setViewportView(jPanel1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1)
        );

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

    private void n6_txt_anchoplatKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n6_txt_anchoplatKeyTyped

        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n6_txt_anchoplatKeyTyped

    private void n8_txt_espesorplatKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n8_txt_espesorplatKeyTyped

        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n8_txt_espesorplatKeyTyped

    private void n20_txt_largomenorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n20_txt_largomenorlascadoKeyTyped

        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n20_txt_largomenorlascadoKeyTyped

    private void n14_txt_largolascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n14_txt_largolascadoKeyTyped

        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n14_txt_largolascadoKeyTyped

    private void btnguardarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnguardarActionPerformed
limpiarcampos();
    }//GEN-LAST:event_btnguardarActionPerformed
private void limpiarcampos(){
    
 
    n3_cbx_subgrupotipologico.setSelectedIndex(0);
    n4_txt_angulo_ultima_plataforma.setText("");
    n5_txt_numplat.setText("");
    n6_txt_anchoplat.setText("");
    n7_chk_anchofracturado.setSelected(false);
    n8_txt_espesorplat.setText("");
    n9_chk_espesorfracturado.setSelected(false);
    n10_cbx_formasupplat.setSelectedIndex(0);
    n11_cbx_estadobordeextrac.setSelectedIndex(0);
    n11_cbx_estadoFRENTEextrac9.setSelectedIndex(0);
    n12_txt_anchotalon.setText("");
    n13_chk_anchotalonfracturado_lascadomayor.setSelected(false);
    n14_txt_largolascado.setText("");
    n15_chk_largofracturado_lascadomayor.setSelected(false);
    n16_txt_ancholascado.setText("");
    n17_chk_anchofracturado_lascadomayor.setSelected(false);
    n18_txt_tamañomayorlascado.setText("");
    n19_txt_moduloomayorlascado.setText("");
    n20_txt_largomenorlascado.setText("");
    n21_chk_largofracturado_lascadomenor.setSelected(false);
    n22_txt_anchomenorlascado.setText("");
    n23_chk_anchofracturado_lascadomenor.setSelected(false);
    n24_txt_tamañomenorlascado.setText("");
    n25_txt_modulomenorlascado.setText("");
    n26_cbx_patina.setSelectedIndex(0);
    n27_cbx_ventifaccion.setSelectedIndex(0);
    n28_cbx_reactivacion.setSelectedIndex(0);
    n29_cbx_corteza.setSelectedIndex(0);
    n30_txta_observ.setText("");
            
}
    private void guardarbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_guardarbtnActionPerformed
validarcampos();      

subgrupotipologico=n3_cbx_subgrupotipologico.getSelectedItem().toString();
angulo = n4_txt_angulo_ultima_plataforma.getText();


if(editando==false){
 
    guardar();

}else{
    actualizarregistro();
}




expandirultimarama();



int confirmado = JOptionPane.showConfirmDialog(
  null,
   "¿Desea ingresar otra plataforma para el mismo núcleo?");

if (JOptionPane.OK_OPTION == confirmado){
                n3_cbx_subgrupotipologico.setSelectedItem(subgrupotipologico);
                n3_cbx_subgrupotipologico.setEnabled(false);
                n4_txt_angulo_ultima_plataforma.setText("");
                n4_txt_angulo_ultima_plataforma.setEnabled(true);
                }else{
                        
                        
                n3_cbx_subgrupotipologico.setEnabled(true);
                n3_cbx_subgrupotipologico.setSelectedIndex(0);
                n4_txt_angulo_ultima_plataforma.setEnabled(true);
                n4_txt_angulo_ultima_plataforma.setText("");
                
                this.dispose();
                        }

    }//GEN-LAST:event_guardarbtnActionPerformed

private void guardar(){
    
          try {
            conexion c = new conexion();
            c.getConexion();
            int aux = c.insert("insert into NUCLEOS (ID_NUCLEOS, ID_FORMATIZADOS, ZONA_AMBIENTAL,"
                + "LOCALIDAD,"
                + "SITIO,"
                + "SIGLA_SITIO,"
                + "CAPA_NIVEL,"
                + "ESTRUC_ARQ,"
                + "PISO_SUBCAPA,"
                + "ESTRUC_PLANTA,"
                + "NOMBRE_ESTRUC_PLANTA,"
                + "EPISODIO_ESTRUC_PLANTA,"
                + "CUADRO,"
                + "MICROSECTOR,"
                    
                + "GRUPO,"
                + "SUBGRUPO,"
                + "ANGULO_PLAT,"
                + "N_PLAT,"
                + "PLAT_ANCHO,"
                + "PLAT_ESPESOR,"
                + "PLAT_FORMA_SUP,"
                + "ESTADO_BORDE_EXT,"
                    
                + "LSMAY_ANCHO_TALON,"
                + "LSMAY_LARGO,"
                + "LSMAY_ANCHO_LASC,"
                + "LSMAY_TAMAÑO,"
                + "LSMAY_MODULO,"
                    
                + "LSMEN_LARGO,"
                + "LSMEN_ANCHO,"
                + "LSMEN_TAMAÑO,"
                + "LSMEN_MODULO,"
                    
                + "PATINA,"
                + "VENTIFACCION,"
                + "ACTIVACION_PLAT,"
                + "CORTEZA,"
                + "ESTADO_FRENTE_EXTRAC,"
                

                + "OBSERVACIONES "
                    
            
                +") Values ("+Integer.parseInt(n1_txt_codigonucleo.getText())+","

                +Integer.parseInt(n0_txt_codigopieza.getText())+","

                +"'"+zona_ambiental+"',"
                +"'"+localidad+"',"
                +"'"+sitio+"',"
                +"'"+siglasitio+"',"
                +"'"+capa_nivel+"',"
                +"'"+estruct_arq+"',"
                +"'"+piso_subcapa+"',"
                +"'"+tipo_estruct_planta+"',"
                +"'"+nombre_estruct_planta+"',"
                +"'"+episodio_estruct_planta+"',"
                +"'"+cuadro+"',"
                +"'"+microsector+"',"

                +"'"+n2_txt_grupotipologico.getText()+"',"
                +"'"+n3_cbx_subgrupotipologico.getSelectedItem()+"',"
                +"'"+n4_txt_angulo_ultima_plataforma.getText()+"',"
                +"'"+n5_txt_numplat.getText()+"',"
                +"'"+n6_txt_anchoplat.getText()+"',"
                +"'"+n8_txt_espesorplat.getText()+"',"
                +"'"+n10_cbx_formasupplat.getSelectedItem()+"',"
                +"'"+n11_cbx_estadobordeextrac.getSelectedItem()+"',"
                +"'"+n12_txt_anchotalon.getText()+"',"
                +"'"+n14_txt_largolascado.getText()+"',"
                +"'"+n16_txt_ancholascado.getText()+"',"
                +"'"+n18_txt_tamañomayorlascado.getText()+"',"
                +"'"+n19_txt_moduloomayorlascado.getText()+"',"
                +"'"+n20_txt_largomenorlascado.getText()+"',"
                +"'"+n22_txt_anchomenorlascado.getText()+"',"
                +"'"+n24_txt_tamañomenorlascado.getText()+"',"
                +"'"+n25_txt_modulomenorlascado.getText()+"',"
                +"'"+n26_cbx_patina.getSelectedItem()+"',"
                +"'"+n27_cbx_ventifaccion.getSelectedItem()+"',"
                +"'"+n28_cbx_reactivacion.getSelectedItem()+"',"
                +"'"+n29_cbx_corteza.getSelectedItem()+"',"
                +"'"+n11_cbx_estadoFRENTEextrac9.getSelectedItem()+"',"
               

                +"'"+n30_txta_observ.getText()+"' "
                
                        
              
               
                + ")");

            c.closeconnection();
            if (aux>0){
                agregarhoja();
                limpiarcampos();
                consultarid();
                btn_eliminar_nucleo.setEnabled(false);
            }
        

            
        } catch (SQLException ex) {
            Logger.getLogger(Internal_Nucleos.class.getName()).log(Level.SEVERE, null, ex);
        }
}  

    private void consultarid(){
    InteraccionesBD inter = new InteraccionesBD();
    int id = inter.obtenersiguienteID("NUCLEOS", "ID_NUCLEOS");
    n1_txt_codigonucleo.setText(String.valueOf(id));
    
    }
    
public void cardaridNucleos(int id){
          java.sql.ResultSet rs=null;       
        try {
            conexion c = new conexion();
            c.getConexion();
            
             rs = c.consulta("SELECT * FROM NUCLEOS WHERE (ID_NUCLEOS="+id+")");
             
             while(rs.next()){
                 n0_txt_codigopieza.setText(String.valueOf(rs.getInt("ID_FORMATIZADOS")));
                 n1_txt_codigonucleo.setText(String.valueOf(rs.getInt("ID_NUCLEOS")));
                 n2_txt_grupotipologico.setText(String.valueOf(rs.getString("GRUPO")));
                 n3_cbx_subgrupotipologico.setSelectedItem(rs.getString("SUBGRUPO"));
                 n4_txt_angulo_ultima_plataforma.setText(String.valueOf(rs.getString("ANGULO_PLAT")));
                 n5_txt_numplat.setText(String.valueOf(rs.getString("N_PLAT")));
                 n6_txt_anchoplat.setText(String.valueOf(rs.getString("PLAT_ANCHO")));
                 n8_txt_espesorplat.setText(String.valueOf(rs.getString("PLAT_ESPESOR")));
                 n10_cbx_formasupplat.setSelectedItem(rs.getString("PLAT_FORMA_SUP"));
                 n11_cbx_estadobordeextrac.setSelectedItem(rs.getString("ESTADO_BORDE_EXT"));
                 n11_cbx_estadoFRENTEextrac9.setSelectedItem(rs.getString("ESTADO_FRENTE_EXTRAC"));
                 n12_txt_anchotalon.setText(String.valueOf(rs.getString("LSMAY_ANCHO_TALON")));
                 n14_txt_largolascado.setText(String.valueOf(rs.getString("LSMAY_LARGO")));
                 n16_txt_ancholascado.setText(String.valueOf(rs.getString("LSMAY_ANCHO_LASC")));
                 n18_txt_tamañomayorlascado.setText(String.valueOf(rs.getString("LSMAY_TAMAÑO")));
                 n19_txt_moduloomayorlascado.setText(String.valueOf(rs.getString("LSMAY_MODULO")));
                 n20_txt_largomenorlascado.setText(String.valueOf(rs.getString("LSMEN_LARGO")));
                 n22_txt_anchomenorlascado.setText(String.valueOf(rs.getString("LSMEN_ANCHO")));
                 n24_txt_tamañomenorlascado.setText(String.valueOf(rs.getString("LSMEN_TAMAÑO")));
                 n25_txt_modulomenorlascado.setText(String.valueOf(rs.getString("LSMEN_MODULO")));
                 n26_cbx_patina.setSelectedItem(rs.getString("PATINA"));
                 n27_cbx_ventifaccion.setSelectedItem(rs.getString("VENTIFACCION"));
                 n28_cbx_reactivacion.setSelectedItem(rs.getString("ACTIVACION_PLAT"));
                 n29_cbx_corteza.setSelectedItem(rs.getString("CORTEZA"));
                 n30_txta_observ.setText(String.valueOf(rs.getString("OBSERVACIONES")));




                 zona_ambiental=rs.getString("ZONA_AMBIENTAL");
                 localidad=rs.getString("LOCALIDAD");
                 sitio=rs.getString("SITIO");
                 siglasitio=rs.getString("SIGLA_SITIO");
                 capa_nivel=rs.getString("CAPA_NIVEL");
                 estruct_arq=rs.getString("ESTRUC_ARQ");
                 piso_subcapa=rs.getString("PISO_SUBCAPA");
                 tipo_estruct_planta=rs.getString("ESTRUC_PLANTA");
                 nombre_estruct_planta=rs.getString("NOMBRE_ESTRUC_PLANTA");
                 episodio_estruct_planta=rs.getString("EPISODIO_ESTRUC_PLANTA");
                 cuadro=rs.getString("CUADRO");
                 microsector=rs.getString("MICROSECTOR");
                }
        
        c.closeconnection();
       } catch (SQLException ex) {
            Logger.getLogger(InteraccionesBD.class.getName()).log(Level.SEVERE, null, ex);
        }
    
  cargarchecks();  
}
 

    private void cargarchecks(){
        bagolini_tamaños b = new bagolini_tamaños();
        b.chkfracturado(n12_txt_anchotalon, n13_chk_anchotalonfracturado_lascadomayor );
        b.chkfracturado(n14_txt_largolascado,n15_chk_largofracturado_lascadomayor);
        b.chkfracturado(n16_txt_ancholascado,n17_chk_anchofracturado_lascadomayor);
        b.chkfracturado(n6_txt_anchoplat,n7_chk_anchofracturado);
        b.chkfracturado(n8_txt_espesorplat,n9_chk_espesorfracturado);
        b.chkfracturado(n20_txt_largomenorlascado,n21_chk_largofracturado_lascadomenor);
        b.chkfracturado(n22_txt_anchomenorlascado,n23_chk_anchofracturado_lascadomenor);

    }
    
    private void actualizarregistro(){
                int respuesta = 0;
    try {
     conexion c = new conexion();
    c.getConexion();

    respuesta = c.eliminar_actualizar("UPDATE NUCLEOS SET "
            + ""
//            
            
            + "ZONA_AMBIENTAL='"+zona_ambiental+"', "
            + "LOCALIDAD='"+localidad+"', "
            + "SITIO='"+sitio+"', "
            + "SIGLA_SITIO='"+siglasitio+"', "
            + "CAPA_NIVEL='"+capa_nivel+"', "
            + "ESTRUC_ARQ='"+estruct_arq+"', "
            + "PISO_SUBCAPA='"+piso_subcapa+"', "
            + "ESTRUC_PLANTA='"+tipo_estruct_planta+"', "
            + "NOMBRE_ESTRUC_PLANTA='"+nombre_estruct_planta+"', "
            + "EPISODIO_ESTRUC_PLANTA='"+episodio_estruct_planta+"', "
            + "CUADRO='"+cuadro+"', "
            + "MICROSECTOR='"+microsector+"', "
            
            + "SUBGRUPO='"+n3_cbx_subgrupotipologico.getSelectedItem()+"', "
            + "ANGULO_PLAT='"+n4_txt_angulo_ultima_plataforma.getText()+"', "
            + "N_PLAT='"+n5_txt_numplat.getText()+"', "
            + "PLAT_ANCHO='"+n6_txt_anchoplat.getText()+"', "
            + "PLAT_ESPESOR='"+n8_txt_espesorplat.getText()+"', "
            + "PLAT_FORMA_SUP='"+n10_cbx_formasupplat.getSelectedItem()+"', "
            + "ESTADO_BORDE_EXT='"+n11_cbx_estadobordeextrac.getSelectedItem()+"', "
            + "ESTADO_FRENTE_EXTRAC='"+n11_cbx_estadoFRENTEextrac9.getSelectedItem()+"', "
            + "LSMAY_ANCHO_TALON='"+n12_txt_anchotalon.getText()+"', "
            + "LSMAY_LARGO='"+n14_txt_largolascado.getText()+"', "
            + "LSMAY_ANCHO_LASC='"+n16_txt_ancholascado.getText()+"', "
            + "LSMAY_TAMAÑO='"+n18_txt_tamañomayorlascado.getText()+"', "
            + "LSMAY_MODULO='"+n19_txt_moduloomayorlascado.getText()+"', "
            + "LSMEN_LARGO='"+n20_txt_largomenorlascado.getText()+"', "
            + "LSMEN_ANCHO='"+n22_txt_anchomenorlascado.getText()+"', "
            + "LSMEN_TAMAÑO='"+n24_txt_tamañomenorlascado.getText()+"', "
            + "LSMEN_MODULO='"+n25_txt_modulomenorlascado.getText()+"', "
            + "PATINA='"+n26_cbx_patina.getSelectedItem()+"', "
            + "VENTIFACCION='"+n27_cbx_ventifaccion.getSelectedItem()+"', "
            + "ACTIVACION_PLAT='"+n28_cbx_reactivacion.getSelectedItem()+"', "
            + "CORTEZA='"+n29_cbx_corteza.getSelectedItem()+"', "
 


            + "OBSERVACIONES='"+n30_txta_observ.getText()+"' "




            


         +" WHERE ID_NUCLEOS="+Integer.parseInt(n1_txt_codigonucleo.getText()));
    

    c.closeconnection();



    
    } catch (NumberFormatException | SQLException e) {
    JOptionPane.showMessageDialog(null, "No se pudieron guardar las modificaciones de la pieza: " + e);
        }
    
            if(respuesta>0){
                    JOptionPane.showMessageDialog(null, "Se han actualizado los datos de la pieza: "+ n0_txt_codigopieza.getText());
    
                    InteraccionesBD interac = new InteraccionesBD();
                    interac.actualizarhoja(jTree1, selectednodeparaeliminar, "Nu", n1_txt_codigonucleo.getText(), "Pieza-"+n0_txt_codigopieza.getText()+"/Plat-"+n5_txt_numplat.getText());
                    limpiarcampos();
                    consultarid();
                    btn_eliminar_nucleo.setEnabled(false);

        }
    }
    
private void eliminar(){
    int confirma =0;
    int ID_PIEZA = Integer.parseInt(n1_txt_codigonucleo.getText());
String sql = "DELETE FROM NUCLEOS WHERE ID_NUCLEOS="+ID_PIEZA;    
            try {
            conexion c = new conexion();
            c.getConexion();

            confirma = c.eliminar_actualizar(sql);
            c.closeconnection();
         
         if(confirma>0){
         JOptionPane.showMessageDialog(null, "Se eliminó el registro de la pieza: "+ID_PIEZA +"\n Nota: La procedencia de la misma está activa para un ingreso nuevo \n Si no desea trabajar con la misma, diríjase a la sección de procedencias");
         InteraccionesBD interac = new InteraccionesBD();
         interac.eliminarhojaarbol(jTree1, selectednodeparaeliminar);
         
         ///////////////////NOTA//////////////////////////
         //////////////////MENSAJE PARA ELIMINAR TODAS LAS FICHAS DE LA PIEZA N°....
         
         limpiarcampos();
         consultarid();
         btn_eliminar_nucleo.setEnabled(false);
         }

        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se pudo eliminar el registro asociado a la pieza " + ID_PIEZA + ex);
        }
}    
private void agregarhoja(){
String Tipo_ficha = "Nu-"+n1_txt_codigonucleo.getText()+"/Pieza-"+n0_txt_codigopieza.getText()+"/Plat-"+n5_txt_numplat.getText();
DefaultMutableTreeNode general = new DefaultMutableTreeNode(Tipo_ficha);  
selectednodeparaeliminar.add(general);
model.reload();  
expandirultimarama();
}       
private void validarcampos(){
ValidarCampos v = new ValidarCampos();

        
v.validarcampostxt(n2_txt_grupotipologico);        
v.validarcampostxt(n4_txt_angulo_ultima_plataforma);        
v.validarcampostxt(n5_txt_numplat);
v.validarcampostxt(n6_txt_anchoplat);

v.validarcampostxt(n8_txt_espesorplat);
v.validarcampostxt(n12_txt_anchotalon);

v.validarcampostxt(n14_txt_largolascado);

v.validarcampostxt(n16_txt_ancholascado);
v.validarcampostxt(n18_txt_tamañomayorlascado);
v.validarcampostxt(n19_txt_moduloomayorlascado);
v.validarcampostxt(n20_txt_largomenorlascado);
v.validarcampostxt(n22_txt_anchomenorlascado);
v.validarcampostxt(n24_txt_tamañomenorlascado);
v.validarcampostxt(n25_txt_modulomenorlascado);



v.validarcamposcbx(n3_cbx_subgrupotipologico);
v.validarcamposcbx(n10_cbx_formasupplat);
v.validarcamposcbx(n11_cbx_estadobordeextrac);
v.validarcamposcbx(n11_cbx_estadoFRENTEextrac9);
v.validarcamposcbx(n28_cbx_reactivacion);
v.validarcamposcbx(n29_cbx_corteza);
v.validarcamposcbx(n26_cbx_patina);
v.validarcamposcbx(n27_cbx_ventifaccion);

v.validarcampostxtarea(n30_txta_observ);
}
    private void n16_txt_ancholascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n16_txt_ancholascadoKeyTyped
        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n16_txt_ancholascadoKeyTyped

    private void n18_txt_tamañomayorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n18_txt_tamañomayorlascadoKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n18_txt_tamañomayorlascadoKeyTyped

    private void n12_txt_anchotalonKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n12_txt_anchotalonKeyTyped
        char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n12_txt_anchotalonKeyTyped

    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
consultarid();
    }//GEN-LAST:event_formInternalFrameOpened

    private void n19_txt_moduloomayorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n19_txt_moduloomayorlascadoKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n19_txt_moduloomayorlascadoKeyTyped

    private void n22_txt_anchomenorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n22_txt_anchomenorlascadoKeyTyped
         char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            && (caracter != '.') ) {
            evt.consume();
        }
    }//GEN-LAST:event_n22_txt_anchomenorlascadoKeyTyped

    private void n24_txt_tamañomenorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n24_txt_tamañomenorlascadoKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n24_txt_tamañomenorlascadoKeyTyped

    private void n25_txt_modulomenorlascadoKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n25_txt_modulomenorlascadoKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n25_txt_modulomenorlascadoKeyTyped

    private void n30_txta_observKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n30_txta_observKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n30_txta_observKeyTyped

    private void n30_txta_observKeyPressed(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n30_txta_observKeyPressed
if (evt.getKeyChar() != evt.VK_ENTER && evt.getKeyChar() != evt.VK_TAB)
				{
				} else {
   
    evt.consume();
    }
    }//GEN-LAST:event_n30_txta_observKeyPressed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
         if((n15_chk_largofracturado_lascadomayor.isSelected()==true)||(n17_chk_anchofracturado_lascadomayor.isSelected()==true)){
             n18_txt_tamañomayorlascado.setText("N.D.");
            n19_txt_moduloomayorlascado.setText("N.D.");
        }else{
        if ((n14_txt_largolascado.getText().equals(""))||(n16_txt_ancholascado.getText().equals(""))){
            JOptionPane.showMessageDialog(null, "Debe ingresar longitud y ancho del lascado último o de mayor tamaño");
        }else{
           
            bagolini_tamaños bag = new bagolini_tamaños(n14_txt_largolascado.getText(), n16_txt_ancholascado.getText());
            n18_txt_tamañomayorlascado.setText(bag.getTamañob());
            n19_txt_moduloomayorlascado.setText(bag.getModuloLong_Ancho());
        }
            }
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
         if((n21_chk_largofracturado_lascadomenor.isSelected()==true)||(n23_chk_anchofracturado_lascadomenor.isSelected()==true)){
             n24_txt_tamañomenorlascado.setText("N.D.");
            n25_txt_modulomenorlascado.setText("N.D.");
        }else{
        if ((n20_txt_largomenorlascado.getText().equals(""))||(n22_txt_anchomenorlascado.getText().equals(""))){
            JOptionPane.showMessageDialog(null, "Debe ingresar longitud y ancho del lascado de menor tamaño");
        }else{
           
            bagolini_tamaños bag = new bagolini_tamaños(n20_txt_largomenorlascado.getText(), n22_txt_anchomenorlascado.getText());
            n24_txt_tamañomenorlascado.setText(bag.getTamañob());
            n25_txt_modulomenorlascado.setText(bag.getModuloLong_Ancho());
        }
            }
    }//GEN-LAST:event_jButton2ActionPerformed

    private void n4_txt_angulo_ultima_plataformaKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n4_txt_angulo_ultima_plataformaKeyTyped
        // TODO add your handling code here:
    }//GEN-LAST:event_n4_txt_angulo_ultima_plataformaKeyTyped

    private void n5_txt_numplatKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_n5_txt_numplatKeyTyped
         char caracter = evt.getKeyChar();
        if (((caracter < '0') || (caracter > '9')) && (caracter != evt.VK_BACK_SPACE)
            ) {
            evt.consume();
        }
    }//GEN-LAST:event_n5_txt_numplatKeyTyped

    private void btn_eliminar_nucleoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_eliminar_nucleoActionPerformed
eliminar();
    }//GEN-LAST:event_btn_eliminar_nucleoActionPerformed

    private void n7_chk_anchofracturadoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n7_chk_anchofracturadoItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n6_txt_anchoplat, n7_chk_anchofracturado);
    }//GEN-LAST:event_n7_chk_anchofracturadoItemStateChanged

    private void n9_chk_espesorfracturadoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n9_chk_espesorfracturadoItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n8_txt_espesorplat, n9_chk_espesorfracturado);
    }//GEN-LAST:event_n9_chk_espesorfracturadoItemStateChanged

    private void n13_chk_anchotalonfracturado_lascadomayorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n13_chk_anchotalonfracturado_lascadomayorItemStateChanged
 bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n12_txt_anchotalon, n13_chk_anchotalonfracturado_lascadomayor);
    }//GEN-LAST:event_n13_chk_anchotalonfracturado_lascadomayorItemStateChanged

    private void n15_chk_largofracturado_lascadomayorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n15_chk_largofracturado_lascadomayorItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n14_txt_largolascado, n15_chk_largofracturado_lascadomayor);
    }//GEN-LAST:event_n15_chk_largofracturado_lascadomayorItemStateChanged

    private void n17_chk_anchofracturado_lascadomayorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n17_chk_anchofracturado_lascadomayorItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n16_txt_ancholascado, n17_chk_anchofracturado_lascadomayor);
    }//GEN-LAST:event_n17_chk_anchofracturado_lascadomayorItemStateChanged

    private void n21_chk_largofracturado_lascadomenorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n21_chk_largofracturado_lascadomenorItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n20_txt_largomenorlascado, n21_chk_largofracturado_lascadomenor);
    }//GEN-LAST:event_n21_chk_largofracturado_lascadomenorItemStateChanged

    private void n23_chk_anchofracturado_lascadomenorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_n23_chk_anchofracturado_lascadomenorItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(n22_txt_anchomenorlascado, n23_chk_anchofracturado_lascadomenor);
    }//GEN-LAST:event_n23_chk_anchofracturado_lascadomenorItemStateChanged

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


    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JButton btn_eliminar_nucleo;
    private javax.swing.JButton btnguardar;
    private javax.swing.JButton guardarbtn;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel28;
    private javax.swing.JLabel jLabel29;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel40;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel42;
    private javax.swing.JLabel jLabel43;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JSeparator jSeparator4;
    public static javax.swing.JTextField n0_txt_codigopieza;
    private javax.swing.JComboBox<String> n10_cbx_formasupplat;
    private javax.swing.JComboBox<String> n11_cbx_estadoFRENTEextrac9;
    private javax.swing.JComboBox<String> n11_cbx_estadobordeextrac;
    private javax.swing.JTextField n12_txt_anchotalon;
    private javax.swing.JCheckBox n13_chk_anchotalonfracturado_lascadomayor;
    private javax.swing.JTextField n14_txt_largolascado;
    private javax.swing.JCheckBox n15_chk_largofracturado_lascadomayor;
    private javax.swing.JTextField n16_txt_ancholascado;
    private javax.swing.JCheckBox n17_chk_anchofracturado_lascadomayor;
    private javax.swing.JTextField n18_txt_tamañomayorlascado;
    private javax.swing.JTextField n19_txt_moduloomayorlascado;
    private javax.swing.JTextField n1_txt_codigonucleo;
    private javax.swing.JTextField n20_txt_largomenorlascado;
    private javax.swing.JCheckBox n21_chk_largofracturado_lascadomenor;
    private javax.swing.JTextField n22_txt_anchomenorlascado;
    private javax.swing.JCheckBox n23_chk_anchofracturado_lascadomenor;
    private javax.swing.JTextField n24_txt_tamañomenorlascado;
    private javax.swing.JTextField n25_txt_modulomenorlascado;
    private javax.swing.JComboBox<String> n26_cbx_patina;
    private javax.swing.JComboBox<String> n27_cbx_ventifaccion;
    private javax.swing.JComboBox<String> n28_cbx_reactivacion;
    private javax.swing.JComboBox<String> n29_cbx_corteza;
    private javax.swing.JTextField n2_txt_grupotipologico;
    private javax.swing.JTextArea n30_txta_observ;
    private javax.swing.JComboBox<String> n3_cbx_subgrupotipologico;
    private javax.swing.JTextField n4_txt_angulo_ultima_plataforma;
    private javax.swing.JTextField n5_txt_numplat;
    private javax.swing.JTextField n6_txt_anchoplat;
    private javax.swing.JCheckBox n7_chk_anchofracturado;
    private javax.swing.JTextField n8_txt_espesorplat;
    private javax.swing.JCheckBox n9_chk_espesorfracturado;
    // End of variables declaration//GEN-END:variables
}
