/*
 * 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 clases.conexion;
import com.mysql.jdbc.PreparedStatement;
import java.awt.event.ItemEvent;
import java.awt.event.KeyEvent;
import java.sql.Connection;
import java.sql.ResultSet;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;

import static arql2020.ARQL2020.*;



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.arbol_DT;
import static arql2020.DT_frame.selectednodeparaeliminar;



import clases.Cargar_MP;
import javax.swing.table.DefaultTableModel;
import clases.bagolini_tamaños;
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.jTree1;
import static arql2020.FORMATIZADOS_frame.selectednode;
import static arql2020.FORMATIZADOS_frame.model;
import static arql2020.FORMATIZADOS_frame.expandirultimarama;
import static arql2020.Internal_DT_contalon.ct16_txt_peso;
import static arql2020.Internal_DT_sintalon.btn_eliminarregistro_Dt_sintalon;
import static arql2020.Internal_DT_sintalon.st4_peso;
import clases.InteraccionesBD;
import clases.ValidarCampos;
import java.awt.PageAttributes;
import java.sql.SQLException;

public class Internal_Formatizados extends javax.swing.JInternalFrame {

    /**
     * Creates new form Internal_Formatizados
     */
    public Internal_Formatizados() {
        initComponents();
        try{
            this.setMaximum(true);
        } catch (PropertyVetoException ex) {
            Logger.getLogger(B_Composicion_puntasfilossup.class.getName()).log(Level.SEVERE, null, ex);
        }    
    ejes.add(c18_ejelascado);
    ejes.add(c19_ejemorfologico);
    }

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

        ejes = new javax.swing.ButtonGroup();
        jScrollPane1 = new javax.swing.JScrollPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel24 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jLabel25 = new javax.swing.JLabel();
        c1_txt_Codigo = new javax.swing.JTextField();
        jLabel21 = new javax.swing.JLabel();
        c2_txt_numfoto = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        c3_txt_num_inv = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        c4_txt_num_pieza = new javax.swing.JTextField();
        jPanel4 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        c5_cbxMP = new javax.swing.JComboBox<>();
        jLabel5 = new javax.swing.JLabel();
        c6_cbx_entera_fracturada = new javax.swing.JComboBox<>();
        jLabel6 = new javax.swing.JLabel();
        c7_cbx_simple_compuesta = new javax.swing.JComboBox<>();
        jLabel7 = new javax.swing.JLabel();
        c8_cbx_clase_artef = new javax.swing.JComboBox<>();
        jButton4 = new javax.swing.JButton();
        jPanel5 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        c12_cbx_forma_base = new javax.swing.JComboBox<>();
        jLabel11 = new javax.swing.JLabel();
        c13_txt_num_facetas_extrac = new javax.swing.JTextField();
        jLabel12 = new javax.swing.JLabel();
        c14_cbx_origen_extrac = new javax.swing.JComboBox<>();
        jPanel6 = new javax.swing.JPanel();
        jLabel13 = new javax.swing.JLabel();
        c15_cbx_alterac_tratam_term = new javax.swing.JComboBox<>();
        jPanel7 = new javax.swing.JPanel();
        jLabel15 = new javax.swing.JLabel();
        c16_cbx_sup_talon = new javax.swing.JComboBox<>();
        jLabel16 = new javax.swing.JLabel();
        c17_txt_ancho_talon = new javax.swing.JTextField();
        jLabel42 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jLabel17 = new javax.swing.JLabel();
        c20_txt_long = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        c22_txt_ancho = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        c24_txt_espesor = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        c26_txt_peso = new javax.swing.JTextField();
        jLabel29 = new javax.swing.JLabel();
        c27_txt_tamaño = new javax.swing.JTextField();
        jLabel30 = new javax.swing.JLabel();
        c28_txt_mod_long_ancho = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        c29_txt_mod_ancho_esp = new javax.swing.JTextField();
        jButton1 = new javax.swing.JButton();
        jLabel34 = new javax.swing.JLabel();
        jLabel35 = new javax.swing.JLabel();
        jLabel40 = new javax.swing.JLabel();
        jLabel41 = new javax.swing.JLabel();
        jPanel9 = new javax.swing.JPanel();
        c19_ejemorfologico = new javax.swing.JRadioButton();
        c18_ejelascado = new javax.swing.JRadioButton();
        c21_chk_fracturado_longitud = new javax.swing.JCheckBox();
        c23_chk_fracturado_ancho = new javax.swing.JCheckBox();
        c25_chk_fracturado_espesor = new javax.swing.JCheckBox();
        jButton2 = new javax.swing.JButton();
        jPanel8 = new javax.swing.JPanel();
        jLabel33 = new javax.swing.JLabel();
        c30_cbx_clase_tecnica = new javax.swing.JComboBox<>();
        jScrollPane2 = new javax.swing.JScrollPane();
        c36_txt_observ = new javax.swing.JTextArea();
        jLabel32 = new javax.swing.JLabel();
        jLabel37 = new javax.swing.JLabel();
        c32_txt_posicion_sust_adherida = new javax.swing.JTextField();
        jLabel38 = new javax.swing.JLabel();
        c31_cbx_sustancia_adherida = new javax.swing.JComboBox<>();
        jButton7 = new javax.swing.JButton();
        jLabel43 = new javax.swing.JLabel();
        c34_cbx_intensidad_patina = new javax.swing.JComboBox<>();
        jLabel44 = new javax.swing.JLabel();
        c35_cbx_intensidad_ventifac = new javax.swing.JComboBox<>();
        jLabel45 = new javax.swing.JLabel();
        jLabel46 = new javax.swing.JLabel();
        c33_cbx_proporcion_corteza = new javax.swing.JComboBox<>();
        jLabel47 = new javax.swing.JLabel();
        jButton3 = new javax.swing.JButton();
        btn_limpiarcampos = new javax.swing.JButton();
        btn_eliminar_formatizados = new javax.swing.JButton();

        setResizable(true);
        setTitle("DESCRIPCIÓN GENERAL de artefactos formatizados/FNRC/Núcleos");
        setToolTipText("");
        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);
            }
        });

        jPanel1.setBackground(new java.awt.Color(51, 51, 51));

        jLabel24.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabel24.setForeground(new java.awt.Color(255, 255, 255));
        jLabel24.setText("Ingrese la descripción general de la pieza");

        jLabel25.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel25.setForeground(new java.awt.Color(255, 255, 255));
        jLabel25.setText("Código ARQ:L general");

        c1_txt_Codigo.setEditable(false);
        c1_txt_Codigo.setBackground(new java.awt.Color(255, 153, 51));
        c1_txt_Codigo.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        c1_txt_Codigo.setText("02");

        jLabel21.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel21.setForeground(new java.awt.Color(255, 255, 255));
        jLabel21.setText("Número de foto");

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

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

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel1.setText("N° Inventario Museo");

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

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

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

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.TRAILING))
                .addGap(18, 18, 18)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(c3_txt_num_inv, javax.swing.GroupLayout.DEFAULT_SIZE, 491, Short.MAX_VALUE)
                    .addComponent(c4_txt_num_pieza))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(c3_txt_num_inv, 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.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(c4_txt_num_pieza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(12, Short.MAX_VALUE))
        );

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

        jLabel4.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel4.setText("Roca o materia prima*");

        c5_cbxMP.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c5_cbxMP.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "Ingresar otra materia prima" }));
        c5_cbxMP.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                c5_cbxMPItemStateChanged(evt);
            }
        });
        c5_cbxMP.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c5_cbxMPActionPerformed(evt);
            }
        });

        jLabel5.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel5.setText("Entera o fracturada");

        c6_cbx_entera_fracturada.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c6_cbx_entera_fracturada.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "1-Entera", "2-Fractura proximal angular", "3-Fractura proximal trasnversal", "4-Fractura mesial", "5-Fractura distal", "6-Fractura múltiple", "CN" }));

        jLabel6.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel6.setText("Simple o compuesta*");

        c7_cbx_simple_compuesta.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c7_cbx_simple_compuesta.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "1-Simple", "2-Compuesta", "CN" }));

        jLabel7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel7.setText("Clase artefactual*");

        c8_cbx_clase_artef.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c8_cbx_clase_artef.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione: (de Aschero-Hocsman, con modificaciones)", "AF-Artefacto formatizado", "Nu-Núcleo", "ARC-Artefacto con rastros complementarios", "NdRC-Nódulo con rastros complementarios", "NdT-Nódulos transportados", "CN" }));

        jButton4.setText("+");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGap(12, 12, 12)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel7)
                    .addComponent(jLabel6)
                    .addComponent(jLabel5)
                    .addComponent(jLabel4))
                .addGap(18, 18, 18)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(c6_cbx_entera_fracturada, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(c7_cbx_simple_compuesta, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addComponent(c5_cbxMP, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(jButton4))
                    .addComponent(c8_cbx_clase_artef, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(c5_cbxMP)
                            .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel5)
                            .addComponent(c6_cbx_entera_fracturada, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel6)
                            .addComponent(c7_cbx_simple_compuesta, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel7)
                            .addComponent(c8_cbx_clase_artef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel4Layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addComponent(jLabel4)))
                .addGap(14, 14, 14))
        );

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

        jLabel10.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel10.setText("Forma Base*");

        c12_cbx_forma_base.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c12_cbx_forma_base.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione:", "NdND-Nódulo no diferenciado", "NdTB-Nódulo con talla bipolar", "GuiS-Guijarro de sección subcircular, oval o elíptica", "GuiCh-Guijarro de secc.elíptica a largada o \"chato\"", "GuiPC-guijarro secc.plano-convexa", "HeN-Hemiguijarro natural", "NdFac-Nódulo a facetas naturales", "NdTR-Nódulo tabular rodado", "Lj-Laja (no rodada)", "BlFac-Bloque no transportable a facetas naturales", "ClAng-Clasto anguloso natural", "ConN-Concreción natural con restos de matriz", "LsNd-Lasc.nodular", "LsP-Lasca primaria o cortical", "LsS-Lasca secundaria o de descortezamiento", "LsDN-Lasca con dorso natural(gajo)", "LsAng-Lasca angular", "LsAr-Lasca de arista", "LsPl-Lasca plana", "LsCta-Lasca en cresta", "LsFNu-Lasca de flanco de núcleo", "LsTNu-Lasca de tableta de núcleo", "LsST-Lasca de semitableta de núcleo", "LsBp.Lasca bipolar (doble bulbo de percusión)", "LsND-Lasca no diferenciada", "HoArS-Hoja de arista simple", "HoArM-Hoja de arista doble o múltiple", "HoND-Hoja no diferenciada", "AFRc-Artefacto formatizado reciclado", "LsRc-Lasca reciclada", "HoRc-Hoja reciclada", "NuRc-Núcleo reciclado", "AFRcND-Artefacto reciclado no diferenciado", "FBND-Forma base no diferenciada", "CN" }));

        jLabel11.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel11.setText("N° facetas de lascado / nucleos: cant. extracciones");

        c13_txt_num_facetas_extrac.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c13_txt_num_facetas_extrac.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c13_txt_num_facetas_extracActionPerformed(evt);
            }
        });
        c13_txt_num_facetas_extrac.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c13_txt_num_facetas_extracKeyTyped(evt);
            }
        });

        jLabel12.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel12.setText("Origen de la extracción*");

        c14_cbx_origen_extrac.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c14_cbx_origen_extrac.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "Seleccione:", "Ex-Externa", "In-Interna", "RPP-Reactivacion plataforma percusión", "RFE-Reactivacion frente de extraccion", "ARB-Adelgazamiento o reduccion bifacial", "RDB-Reactivacion directa bisel formatizado", "RIB-Reactivacion inversa bisel formatizado.", "OND-Origen 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()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(c12_cbx_forma_base, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(c14_cbx_origen_extrac, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                        .addGap(19, 19, 19)
                        .addComponent(jLabel11)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(c13_txt_num_facetas_extrac)))
                .addGap(86, 86, 86))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c12_cbx_forma_base, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel10))
                .addGap(25, 25, 25)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c13_txt_num_facetas_extrac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel11))
                .addGap(18, 18, 18)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c14_cbx_origen_extrac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel12))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

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

        jLabel13.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel13.setText("Alteraciones y trat. térmico");

        c15_cbx_alterac_tratam_term.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c15_cbx_alterac_tratam_term.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione:", "Vtf-Ventifacción", "Rod-Rodamiento", "BzD-Barniz rojizo (barniz del desierto)", "CtaB-Costra blanquecina", "Lu-Cambio de coloracion/lustre", "Crq-Craqueleado", "HoC-Hoyuelos cupulares", "FrcT-Fractura por termoalteracion", "Qm-Quemada", "ND-No diferenciada", "CN" }));

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(31, 31, 31)
                .addComponent(jLabel13)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(c15_cbx_alterac_tratam_term, javax.swing.GroupLayout.PREFERRED_SIZE, 424, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c15_cbx_alterac_tratam_term, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel13))
                .addContainerGap())
        );

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

        jLabel15.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel15.setText("Superficie / estado del talón*");

        c16_cbx_sup_talon.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c16_cbx_sup_talon.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", "Rb-Rebajado", "Eli-Eliminado", "ND-No diferenciado (compatible con puntas de proy.)", "CN" }));

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

        c17_txt_ancho_talon.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c17_txt_ancho_talon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c17_txt_ancho_talonActionPerformed(evt);
            }
        });
        c17_txt_ancho_talon.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c17_txt_ancho_talonKeyTyped(evt);
            }
        });

        jLabel42.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel42.setText("cm (ej. 4.0)");

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel7Layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jLabel15)
                        .addGap(29, 29, 29))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(82, 82, 82)
                        .addComponent(jLabel16)
                        .addGap(31, 31, 31)))
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(c17_txt_ancho_talon, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel42, javax.swing.GroupLayout.DEFAULT_SIZE, 221, Short.MAX_VALUE)
                        .addGap(92, 92, 92))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(c16_cbx_sup_talon, javax.swing.GroupLayout.PREFERRED_SIZE, 445, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel15)
                    .addComponent(c16_cbx_sup_talon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
                    .addComponent(jLabel42)
                    .addComponent(c17_txt_ancho_talon, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel16))
                .addContainerGap(12, Short.MAX_VALUE))
        );

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

        jLabel17.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel17.setText("Longitud pieza");

        c20_txt_long.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c20_txt_long.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c20_txt_longActionPerformed(evt);
            }
        });
        c20_txt_long.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c20_txt_longKeyTyped(evt);
            }
        });

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

        c22_txt_ancho.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c22_txt_ancho.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c22_txt_anchoActionPerformed(evt);
            }
        });
        c22_txt_ancho.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c22_txt_anchoKeyTyped(evt);
            }
        });

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

        c24_txt_espesor.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c24_txt_espesor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c24_txt_espesorActionPerformed(evt);
            }
        });
        c24_txt_espesor.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c24_txt_espesorKeyTyped(evt);
            }
        });

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

        c26_txt_peso.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c26_txt_peso.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c26_txt_pesoActionPerformed(evt);
            }
        });
        c26_txt_peso.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                c26_txt_pesoKeyTyped(evt);
            }
        });

        jLabel29.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel29.setText("cm (ej. 10.4)");

        c27_txt_tamaño.setBackground(new java.awt.Color(255, 255, 0));
        c27_txt_tamaño.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c27_txt_tamaño.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c27_txt_tamañoActionPerformed(evt);
            }
        });

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

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

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

        c29_txt_mod_ancho_esp.setBackground(new java.awt.Color(255, 255, 0));
        c29_txt_mod_ancho_esp.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c29_txt_mod_ancho_esp.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c29_txt_mod_ancho_espActionPerformed(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);
            }
        });

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

        jLabel35.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel35.setText("cm (ej. 4.0)");

        jLabel40.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel40.setText("gramos");

        jLabel41.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel41.setText("cm (ej. 10.4)");

        jPanel9.setBackground(new java.awt.Color(255, 153, 0));
        jPanel9.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        c19_ejemorfologico.setBackground(new java.awt.Color(255, 153, 0));
        c19_ejemorfologico.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        c19_ejemorfologico.setText("Eje morfológico");

        c18_ejelascado.setBackground(new java.awt.Color(255, 153, 0));
        c18_ejelascado.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        c18_ejelascado.setText("Eje de lascado");
        c18_ejelascado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                c18_ejelascadoActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addGap(14, 14, 14)
                .addComponent(c18_ejelascado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
                .addComponent(c19_ejemorfologico)
                .addGap(22, 22, 22))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c19_ejemorfologico)
                    .addComponent(c18_ejelascado))
                .addContainerGap(15, Short.MAX_VALUE))
        );

        c21_chk_fracturado_longitud.setBackground(new java.awt.Color(255, 255, 204));
        c21_chk_fracturado_longitud.setText("Fracturado");
        c21_chk_fracturado_longitud.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                c21_chk_fracturado_longitudItemStateChanged(evt);
            }
        });

        c23_chk_fracturado_ancho.setBackground(new java.awt.Color(255, 255, 204));
        c23_chk_fracturado_ancho.setText("Fracturado");
        c23_chk_fracturado_ancho.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                c23_chk_fracturado_anchoItemStateChanged(evt);
            }
        });

        c25_chk_fracturado_espesor.setBackground(new java.awt.Color(255, 255, 204));
        c25_chk_fracturado_espesor.setText("Fracturado");
        c25_chk_fracturado_espesor.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                c25_chk_fracturado_espesorItemStateChanged(evt);
            }
        });

        jButton2.setText("Ver en gráfico");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(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()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(c22_txt_ancho, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel19)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(c24_txt_espesor, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel34)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(c27_txt_tamaño, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel20)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(c26_txt_peso, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel30)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(c28_txt_mod_long_ancho, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jLabel31)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(c29_txt_mod_ancho_esp, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel17)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(c20_txt_long, javax.swing.GroupLayout.PREFERRED_SIZE, 153, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabel40, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel41, javax.swing.GroupLayout.DEFAULT_SIZE, 97, Short.MAX_VALUE)
                            .addComponent(jLabel35, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(c21_chk_fracturado_longitud)
                            .addComponent(c23_chk_fracturado_ancho)
                            .addComponent(c25_chk_fracturado_espesor))
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 137, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jButton2)
                        .addGap(25, 25, 25))))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(c20_txt_long, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel29)
                    .addComponent(c21_chk_fracturado_longitud))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel18)
                    .addComponent(c22_txt_ancho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel35)
                    .addComponent(c23_chk_fracturado_ancho))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(c24_txt_espesor, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel41)
                    .addComponent(c25_chk_fracturado_espesor))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel20)
                    .addComponent(c26_txt_peso, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel40))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c27_txt_tamaño, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel34))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel30)
                    .addComponent(c28_txt_mod_long_ancho, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addComponent(jButton2))
                .addGap(11, 11, 11)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel31)
                    .addComponent(c29_txt_mod_ancho_esp, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(14, 14, 14))
        );

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

        jLabel33.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel33.setText("Clase técnica*");

        c30_cbx_clase_tecnica.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c30_cbx_clase_tecnica.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione: (de Aschero-Hocsman, con modificaciones)", "AAB-Artefactos con adelgazamiento bifacial", "ARB-Con reducción bifacial", "BMg-Bifaciales-marginales", "AUf-Adelgazamiento unifacial", "RUf-Reducción unifacial", "UfMg-Unifaciales marginales", "TAFB-Talla y/o adelgazamiento y/o formatización bipolar", "TEsF-Talla de extracción sin formatización", "LiUt-Litos no tallados, usados o transportados", "LsSF-Lascado simple de formatización", "SupAb-Superficie abradida", "CN" }));

        jScrollPane2.setAutoscrolls(true);

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

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

        jLabel37.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel37.setText("Sustancia adherida");

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

        jLabel38.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel38.setText("Posición sust. adherida");

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

        jButton7.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jButton7.setText("Cuadrícula");
        jButton7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton7ActionPerformed(evt);
            }
        });

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

        c34_cbx_intensidad_patina.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c34_cbx_intensidad_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");

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

        jLabel45.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel45.setText("tabular la de la forma base");

        jLabel46.setFont(new java.awt.Font("Tahoma", 2, 14)); // NOI18N
        jLabel46.setText("tabular la de la forma base");

        c33_cbx_proporcion_corteza.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        c33_cbx_proporcion_corteza.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Seleccione", "A-0%", "B-0.1-25%", "C-25.1-50%", "D-50.1-75%", "E-75.1-99%", "F-100%", "CN" }));

        jLabel47.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        jLabel47.setText("Proporción de corteza*");

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel33)
                    .addComponent(jLabel37)
                    .addComponent(jLabel38))
                .addGap(11, 11, 11)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(c32_txt_posicion_sust_adherida, javax.swing.GroupLayout.PREFERRED_SIZE, 335, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(c31_cbx_sustancia_adherida, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(c30_cbx_clase_tecnica, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(29, 29, 29))
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(25, 25, 25)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel47, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel43, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel44, javax.swing.GroupLayout.Alignment.TRAILING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(c34_cbx_intensidad_patina, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(c35_cbx_intensidad_ventifac, 0, 209, Short.MAX_VALUE)
                    .addComponent(c33_cbx_proporcion_corteza, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel45, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
                    .addComponent(jLabel46, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(0, 0, Short.MAX_VALUE))
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(515, 515, 515)
                        .addComponent(jButton7, javax.swing.GroupLayout.PREFERRED_SIZE, 103, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGap(14, 14, 14)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 666, Short.MAX_VALUE)
                            .addComponent(jLabel32))))
                .addContainerGap())
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c30_cbx_clase_tecnica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel33))
                .addGap(20, 20, 20)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel37)
                    .addComponent(c31_cbx_sustancia_adherida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c32_txt_posicion_sust_adherida, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel38)
                    .addComponent(jButton7))
                .addGap(23, 23, 23)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c33_cbx_proporcion_corteza, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel47))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(c34_cbx_intensidad_patina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel43))
                        .addGap(9, 9, 9)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(c35_cbx_intensidad_ventifac, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel44)
                            .addComponent(jLabel46)))
                    .addComponent(jLabel45))
                .addGap(51, 51, 51)
                .addComponent(jLabel32)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 133, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jButton3.setFont(new java.awt.Font("Tahoma", 0, 16)); // NOI18N
        jButton3.setText("Guardar");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

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

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

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(64, 64, 64)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                                    .addComponent(btn_eliminar_formatizados, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(71, 71, 71)
                                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addGap(35, 35, 35)
                                    .addComponent(jLabel21)
                                    .addGap(18, 18, 18)
                                    .addComponent(c2_txt_numfoto, javax.swing.GroupLayout.PREFERRED_SIZE, 520, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addGroup(jPanel1Layout.createSequentialGroup()
                                    .addComponent(jLabel25)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(c1_txt_Codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addGap(135, 135, 135)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 493, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel24))))
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(btn_limpiarcampos, javax.swing.GroupLayout.PREFERRED_SIZE, 179, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(497, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(22, 22, 22)
                .addComponent(jLabel24)
                .addGap(2, 2, 2)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c1_txt_Codigo, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel25))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(c2_txt_numfoto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel21))
                .addGap(33, 33, 33)
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .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)
                .addGap(18, 18, 18)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(33, 33, 33)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(45, 45, 45)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(37, 37, 37)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btn_limpiarcampos)
                    .addComponent(jButton3)
                    .addComponent(btn_eliminar_formatizados))
                .addContainerGap(157, Short.MAX_VALUE))
        );

        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, javax.swing.GroupLayout.DEFAULT_SIZE, 788, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1915, Short.MAX_VALUE)
                .addGap(0, 0, 0))
        );

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

    private void c5_cbxMPItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_c5_cbxMPItemStateChanged
        //              if(evt.getStateChange() == ItemEvent.SELECTED){
            //            if(this.cbxMP.getSelectedIndex()==1){
                //                    String entradaUsuario = JOptionPane.showInputDialog ( "Introduzca una nueva materia prima:" );
                //
                //
                //              //guarda el ingreso nuevo en la bd
                //PreparedStatement ps;
                //ResultSet res;
                // conexion conect = new conexion();
                // Connection con = conect.getconnection();
                //
                // try{
                    //     ps = (PreparedStatement) con.prepareStatement("INSERT into materia_prima (MP) VALUES (?)");
                    //     ps.setString(1, entradaUsuario);
                    //
                    //        int result =  ps.executeUpdate();
                    //        if (result > 0){
                        //          JOptionPane.showMessageDialog(null, "Registro ingresado");
                        //          cargarMP();
                        //        }else {
                        //                JOptionPane.showMessageDialog(null, "Error al guardar");
                        //        }
                    //
                    // }catch (Exception e){
                    //     JOptionPane.showMessageDialog(null, "No se puede ingresar la nueva materia prima");
                    // }
                //
                //
                //

                //
                //            }
            //        }
    }//GEN-LAST:event_c5_cbxMPItemStateChanged

    private void c5_cbxMPActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_c5_cbxMPActionPerformed
        //String opcionselec = cbxMP.getSelectedItem().toString();
        //            if(opcionselec.equals("Ingresar otra materia prima")){
            //                    String entradaUsuario = JOptionPane.showInputDialog ( "Introduzca una nueva materia prima:" );
            //
            //
            //              //guarda el ingreso nuevo en la bd
            //PreparedStatement ps;
            //ResultSet res;
            // conexion conect = new conexion();
            // Connection con = conect.getconnection();
            //
            // try{
                //     ps = (PreparedStatement) con.prepareStatement("INSERT into materia_prima (MP) VALUES (?)");
                //     ps.setString(1, entradaUsuario);
                //
                //        int result =  ps.executeUpdate();
                //        if (result > 0){
                    //          JOptionPane.showMessageDialog(null, "Registro ingresado");
                    //          cargarMP();
                    //        }else {
                    //                JOptionPane.showMessageDialog(null, "Error al guardar");
                    //        }
                //
                // }catch (Exception e){
                //     JOptionPane.showMessageDialog(null, "No se puede ingresar la nueva materia prima");
                // }
            //
            // }
        //
    }//GEN-LAST:event_c5_cbxMPActionPerformed

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
if(c18_ejelascado.isSelected()==true){
    
      
        
        if ((c20_txt_long.getText().equals(""))||(c22_txt_ancho.getText().equals(""))||(c24_txt_espesor.getText().equals(""))){
            JOptionPane.showMessageDialog(null, "Debe ingresar longitud,ancho y espesor de la pieza");
        }
        else{
            
            bagolini_tamaños bag = new bagolini_tamaños(c20_txt_long.getText(), c22_txt_ancho.getText(),c24_txt_espesor.getText());
            c27_txt_tamaño.setText(bag.getTamañob());
            c29_txt_mod_ancho_esp.setText(bag.getModuloanchoespesor());
            c28_txt_mod_long_ancho.setText(bag.getModuloLong_Ancho());
                
            
        }
        }
if(c19_ejemorfologico.isSelected()==true){
           int confirmado = JOptionPane.showConfirmDialog(
  null,
   "Usted ha seleccionado 'eje morfológico'. Esto implica que no se calcularán tamaño y módulos. "
           + "\n ¿Desea incluir una excepción a la regla y efectuar los cálculos de todas maneras?"
           + "\n "
           + "\n NOTA: este podría ser el caso de puntas de proyectil, "
           + "\n cuyas mediciones se efectúan sobre eje morfológico.");

if (JOptionPane.OK_OPTION == confirmado){
        if ((c20_txt_long.getText().equals(""))||(c22_txt_ancho.getText().equals(""))||(c24_txt_espesor.getText().equals(""))){
            JOptionPane.showMessageDialog(null, "Debe ingresar longitud,ancho y espesor de la pieza");
        }
        else{
            
            bagolini_tamaños bag = new bagolini_tamaños(c20_txt_long.getText(), c22_txt_ancho.getText(),c24_txt_espesor.getText());
            c27_txt_tamaño.setText(bag.getTamañob());
            c29_txt_mod_ancho_esp.setText(bag.getModuloanchoespesor());
            c28_txt_mod_long_ancho.setText(bag.getModuloLong_Ancho());
                
            
        }
                }else{
                        
            c27_txt_tamaño.setText("N.D.");
            c29_txt_mod_ancho_esp.setText("N.D.");
            c28_txt_mod_long_ancho.setText("N.D.");
                
                
                        }
    

}

if((c18_ejelascado.isSelected()==false)&&(c19_ejemorfologico.isSelected()==false)){
    JOptionPane.showMessageDialog(null, "Antes de realizar el cálculo, indique si está trabajando con eje morfológico o de lascado");
}
    }//GEN-LAST:event_jButton1ActionPerformed

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

    private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton7ActionPerformed
ventana_para_cuadricula="general";
        cuadricula cuad = new cuadricula();
        cuad.setVisible(true);
    }//GEN-LAST:event_jButton7ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
validarcampos();      

//



if(selectednodeparaeliminar==null){
 
    guardar();
    c5_cbxMP.setSelectedItem(indexMP);

}else{
    actualizarregistro();
    c5_cbxMP.setSelectedItem(indexMP);
}




expandirultimarama();
//this.dispose();
    }//GEN-LAST:event_jButton3ActionPerformed
private void actualizarregistro(){
        int respuesta = 0;
    try {
     conexion c = new conexion();
    c.getConexion();

    respuesta = c.eliminar_actualizar("UPDATE FORMATIZADOS 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+"', "
            
            + "FOTO='"+c2_txt_numfoto.getText()+"', "
            + "INVENTARIO='"+c3_txt_num_inv.getText()+"', "
            + "PIEZA='"+c4_txt_num_pieza.getText()+"', "
            + "MP='"+c5_cbxMP.getSelectedItem()+"', "
            + "ENTERA_FRACTURADA='"+c6_cbx_entera_fracturada.getSelectedItem()+"', "
            + "SIMPLE_COMPUESTA='"+c7_cbx_simple_compuesta.getSelectedItem()+"', "
            + "CLASE_ARTEF='"+c8_cbx_clase_artef.getSelectedItem()+"', "
            + "CANT_FILOS='CN', "
            + "CANT_PUNTAS='CN', "
            + "CANT_SUPERFICIES='CN', "
            + "FORMA_BASE='"+c12_cbx_forma_base.getSelectedItem()+"', "
            + "NUM_FACETAS_EXTRAC='"+c13_txt_num_facetas_extrac.getText()+"', "
            + "ORIGEN_EXTRAC='"+c14_cbx_origen_extrac.getSelectedItem()+"', "
            + "ALTERAC_TRATAM_TERM='"+c15_cbx_alterac_tratam_term.getSelectedItem()+"', "
            + "SUP_TALON='"+c16_cbx_sup_talon.getSelectedItem()+"', "
            + "ANCHO_TALON='"+c17_txt_ancho_talon.getText()+"', "
            + "EJE_LASCADO='"+c18_ejelascado.isSelected()+"', "
            + "EJE_MORFOLOGICO='"+c19_ejemorfologico.isSelected()+"', "
            + "LONGITUD='"+c20_txt_long.getText()+"', "
            + "ANCHO='"+c22_txt_ancho.getText()+"', "
            + "ESPESOR='"+c24_txt_espesor.getText()+"', "
            + "PESO='"+c26_txt_peso.getText()+"', "
            + "TAMAÑO='"+c27_txt_tamaño.getText()+"', "
            + "MODULO_LONG_ANCHO='"+c28_txt_mod_long_ancho.getText()+"', "
            + "MODULO_ANCHO_ESPESOR='"+c29_txt_mod_ancho_esp.getText()+"', "
            + "CLASE_TECNICA='"+c30_cbx_clase_tecnica.getSelectedItem()+"', "
            + "SUSTANCIA_ADHERIDA='"+c31_cbx_sustancia_adherida.getSelectedItem()+"', "
            + "POSICION_SUST_ADHERIDA='"+c32_txt_posicion_sust_adherida.getText()+"', "
            + "CORTEZA='"+c33_cbx_proporcion_corteza.getSelectedItem()+"', "
            + "PATINA='"+c34_cbx_intensidad_patina.getSelectedItem()+"', "
            + "VENTIFACCION='"+c35_cbx_intensidad_ventifac.getSelectedItem()+"', "
            + "OBSERVACIONES='"+c36_txt_observ.getText()+"' "




            


         +" WHERE ID_FORMATIZADOS="+Integer.parseInt(c1_txt_Codigo.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: "+ c4_txt_num_pieza.getText());
    
                    InteraccionesBD interac = new InteraccionesBD();
                    interac.actualizarhoja(jTree1, selectednodeparaeliminar, "Gen", c1_txt_Codigo.getText(), c4_txt_num_pieza.getText());
                    limpiarcampos();
                    consultarid();
                    btn_eliminar_formatizados.setEnabled(false);

        }
}

private void cargarhojaycarpetanueva(){
    
    String Tipo_ficha = "Gen-"+c1_txt_Codigo.getText()+"/"+c4_txt_num_pieza.getText();
    
    
        DefaultMutableTreeNode root = (DefaultMutableTreeNode)model.getRoot();
        DefaultMutableTreeNode c1 = new DefaultMutableTreeNode(c1_txt_Codigo.getText());
        DefaultMutableTreeNode general = new DefaultMutableTreeNode(Tipo_ficha);
        c1.add(general);
        root.add(c1);                
        model.reload();
        
    int j = jTree1.getRowCount();
    int i = 0;
    while (i < j) {
        jTree1.expandRow(i);
        i += 1;
        j = jTree1.getRowCount();
    }
       
    }
    
private void cargarhojanueva(String id, String rotulo){
    //ingresar al arbol
        selectednode = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();
        System.out.println("altura: "+ selectednode.getDepth());
        String Tipo_ficha = "Gen-"+id+"/"+rotulo;
        selectednode = (DefaultMutableTreeNode) jTree1.getLastSelectedPathComponent();
 //si la seleccion no está vacía
        if(selectednode!=null){
//si es que no tiene hijos, agregar nodo
            if(selectednode.getChildCount()==0){
    DefaultMutableTreeNode general = new DefaultMutableTreeNode(Tipo_ficha);  
   selectednode.add(general);
   model.reload();  
//si es que ya tiene hijos, agregar al último
            }else{
            selectednode.insert (new DefaultMutableTreeNode(Tipo_ficha),selectednode.getIndex(selectednode.getLastChild()));
            model.reload(selectednode);
        }        }
        
             int j = jTree1.getRowCount();
       int i = 0;
       while(i < j) {
           jTree1.expandRow(i);
           i += 1;
           j = jTree1.getRowCount();
       }
}

public void cargaridFormatizados (int id){
    java.sql.ResultSet rs=null;       
        try {
            conexion c = new conexion();
            c.getConexion();
            
             rs = c.consulta("SELECT * FROM FORMATIZADOS WHERE (ID_FORMATIZADOS="+id+")");
             
             while(rs.next()){
                 c1_txt_Codigo.setText(String.valueOf(rs.getInt("ID_FORMATIZADOS")));
                 c2_txt_numfoto.setText(String.valueOf(rs.getString("FOTO")));
                 c3_txt_num_inv.setText(String.valueOf(rs.getString("INVENTARIO")));
                 c4_txt_num_pieza.setText(String.valueOf(rs.getString("PIEZA")));
                 c5_cbxMP.setSelectedItem(rs.getString("MP"));
                 c6_cbx_entera_fracturada.setSelectedItem(rs.getString("ENTERA_FRACTURADA"));
                 c7_cbx_simple_compuesta.setSelectedItem(rs.getString("SIMPLE_COMPUESTA"));
                 c8_cbx_clase_artef.setSelectedItem(rs.getString("CLASE_ARTEF"));
//                 c9_txt_cant_filos.setText(String.valueOf(rs.getString("CANT_FILOS")));
//                 c10_txt_cant_puntas.setText(String.valueOf(rs.getString("CANT_PUNTAS")));
//                 c11_txt_cant_superficies.setText(String.valueOf(rs.getString("CANT_SUPERFICIES")));
                 c12_cbx_forma_base.setSelectedItem(rs.getString("FORMA_BASE"));
                 c13_txt_num_facetas_extrac.setText(rs.getString("NUM_FACETAS_EXTRAC"));
                 c14_cbx_origen_extrac.setSelectedItem(rs.getString("ORIGEN_EXTRAC"));
                 c15_cbx_alterac_tratam_term.setSelectedItem(rs.getString("ALTERAC_TRATAM_TERM"));
                 c16_cbx_sup_talon.setSelectedItem(rs.getString("SUP_TALON"));
                 c17_txt_ancho_talon.setText(rs.getString("ANCHO_TALON"));
                 boolean aux = false; 
                 if(rs.getString("EJE_LASCADO").equals("false")){
                     c18_ejelascado.setSelected(false);
                 }else{
                     c18_ejelascado.setSelected(true);
                 }
                 if(rs.getString("EJE_MORFOLOGICO").equals("false")){
                     c19_ejemorfologico.setSelected(false);
                 }else{
                     c19_ejemorfologico.setSelected(true);
                 }
                 c20_txt_long.setText(String.valueOf(rs.getString("LONGITUD")));
                 c22_txt_ancho.setText(String.valueOf(rs.getString("ANCHO")));
                 c24_txt_espesor.setText(String.valueOf(rs.getString("ESPESOR")));
                 c26_txt_peso.setText(String.valueOf(rs.getString("PESO")));
                 c27_txt_tamaño.setText(String.valueOf(rs.getString("TAMAÑO")));
                 c28_txt_mod_long_ancho.setText(String.valueOf(rs.getString("MODULO_LONG_ANCHO")));
                 c29_txt_mod_ancho_esp.setText(String.valueOf(rs.getString("MODULO_ANCHO_ESPESOR")));
                 c30_cbx_clase_tecnica.setSelectedItem(rs.getString("CLASE_TECNICA"));
                 c31_cbx_sustancia_adherida.setSelectedItem(rs.getString("SUSTANCIA_ADHERIDA"));
                 c32_txt_posicion_sust_adherida.setText(String.valueOf(rs.getString("POSICION_SUST_ADHERIDA")));
                 c33_cbx_proporcion_corteza.setSelectedItem(rs.getString("CORTEZA"));
                 c34_cbx_intensidad_patina.setSelectedItem(rs.getString("PATINA"));
                 c35_cbx_intensidad_ventifac.setSelectedItem(rs.getString("VENTIFACCION"));
                 c36_txt_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(c20_txt_long, c21_chk_fracturado_longitud );
        b.chkfracturado(c22_txt_ancho,c23_chk_fracturado_ancho);
        b.chkfracturado(c24_txt_espesor,c25_chk_fracturado_espesor);

    }
private void guardar (){
      try {
            conexion c = new conexion();
            c.getConexion();
            int aux = c.insert("insert into FORMATIZADOS(ID_FORMATIZADOS, ZONA_AMBIENTAL,"
                + "LOCALIDAD,"
                + "SITIO,"
                + "SIGLA_SITIO,"
                + "CAPA_NIVEL,"
                + "ESTRUC_ARQ,"
                + "PISO_SUBCAPA,"
                + "ESTRUC_PLANTA,"
                + "NOMBRE_ESTRUC_PLANTA,"
                + "EPISODIO_ESTRUC_PLANTA,"
                + "CUADRO,"
                + "MICROSECTOR,"
                    
                + "FOTO,"
                + "INVENTARIO,"
                + "PIEZA,"
                + "MP,"
                + "ENTERA_FRACTURADA,"
                + "SIMPLE_COMPUESTA,"
                + "CLASE_ARTEF,"
                + "CANT_FILOS,"
                + "CANT_PUNTAS,"
                + "CANT_SUPERFICIES,"
                + "FORMA_BASE,"
                + "NUM_FACETAS_EXTRAC,"
                + "ORIGEN_EXTRAC,"
                + "ALTERAC_TRATAM_TERM,"
                + "SUP_TALON,"
                + "ANCHO_TALON,"
                + "EJE_LASCADO,"
                + "EJE_MORFOLOGICO,"
                + "LONGITUD,"
                + "ANCHO,"
                + "ESPESOR,"
                + "PESO,"
                + "TAMAÑO,"
                + "MODULO_LONG_ANCHO,"
                + "MODULO_ANCHO_ESPESOR,"
                + "CLASE_TECNICA,"
                + "SUSTANCIA_ADHERIDA,"
                + "POSICION_SUST_ADHERIDA,"
                + "CORTEZA,"
                + "PATINA,"
                + "VENTIFACCION,"
                + "OBSERVACIONES"
                +") Values ("+Integer.parseInt(c1_txt_Codigo.getText())+","
                +"'"+zona_ambiental+"',"
                +"'"+localidad+"',"
                +"'"+sitio+"',"
                +"'"+siglasitio+"',"
                +"'"+capa_nivel+"',"
                +"'"+estruct_arq+"',"
                +"'"+piso_subcapa+"',"
                +"'"+tipo_estruct_planta+"',"
                +"'"+nombre_estruct_planta+"',"
                +"'"+episodio_estruct_planta+"',"
                +"'"+cuadro+"',"
                +"'"+microsector+"',"

                +"'"+c2_txt_numfoto.getText()+"',"
                +"'"+c3_txt_num_inv.getText()+"',"
                +"'"+c4_txt_num_pieza.getText()+"',"
                +"'"+c5_cbxMP.getSelectedItem()+"',"
                +"'"+c6_cbx_entera_fracturada.getSelectedItem()+"',"
                +"'"+c7_cbx_simple_compuesta.getSelectedItem()+"',"
                +"'"+c8_cbx_clase_artef.getSelectedItem()+"',"
                +"'CN',"
                +"'CN',"
                +"'CN',"
                +"'"+c12_cbx_forma_base.getSelectedItem()+"',"
                +"'"+c13_txt_num_facetas_extrac.getText()+"',"
                +"'"+c14_cbx_origen_extrac.getSelectedItem()+"',"
                +"'"+c15_cbx_alterac_tratam_term.getSelectedItem()+"',"
                +"'"+c16_cbx_sup_talon.getSelectedItem()+"',"
                +"'"+c17_txt_ancho_talon.getText()+"',"
                +"'"+c18_ejelascado.isSelected()+"',"
                +"'"+c19_ejemorfologico.isSelected()+"',"
                +"'"+c20_txt_long.getText()+"',"
                +"'"+c22_txt_ancho.getText()+"',"
                +"'"+c24_txt_espesor.getText()+"',"
                +"'"+c26_txt_peso.getText()+"',"
                +"'"+c27_txt_tamaño.getText()+"',"
                +"'"+c28_txt_mod_long_ancho.getText()+"',"
                +"'"+c29_txt_mod_ancho_esp.getText()+"',"
                +"'"+c30_cbx_clase_tecnica.getSelectedItem()+"',"
                +"'"+c31_cbx_sustancia_adherida.getSelectedItem()+"',"
                +"'"+c32_txt_posicion_sust_adherida.getText()+"',"
                +"'"+c33_cbx_proporcion_corteza.getSelectedItem()+"',"
                +"'"+c34_cbx_intensidad_patina.getSelectedItem()+"',"
                +"'"+c35_cbx_intensidad_ventifac.getSelectedItem()+"',"
                +"'"+c36_txt_observ.getText()+"'"
               
                + ")");

            c.closeconnection();
            if (aux>0){
//                cargarhojanueva(c1_txt_Codigo.getText(), c3_txt_num_inv.getText());
                cargarhojaycarpetanueva();
                limpiarcampos();
                consultarid();
                btn_eliminar_formatizados.setEnabled(false);
            }
        

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

    private void consultarid(){
    InteraccionesBD inter = new InteraccionesBD();
    int id = inter.obtenersiguienteID("FORMATIZADOS", "ID_FORMATIZADOS");
    c1_txt_Codigo.setText(String.valueOf(id));
}  
private void validarcampos(){
    ValidarCampos v = new ValidarCampos();

v.validarcampostxt(c1_txt_Codigo);        
v.validarcampostxt(c2_txt_numfoto);        
v.validarcampostxt(c3_txt_num_inv);        
v.validarcampostxt(c4_txt_num_pieza);        
//v.validarcampostxt(c9_txt_cant_filos);        
//v.validarcampostxt(c10_txt_cant_puntas);        
//v.validarcampostxt(c11_txt_cant_superficies);                
v.validarcampostxt(c13_txt_num_facetas_extrac);        
v.validarcampostxt(c17_txt_ancho_talon);        
v.validarcampostxt(c20_txt_long);        
v.validarcampostxt(c22_txt_ancho);        
v.validarcampostxt(c24_txt_espesor);        
v.validarcampostxt(c26_txt_peso);        
v.validarcampostxt(c27_txt_tamaño);        
v.validarcampostxt(c28_txt_mod_long_ancho);        
v.validarcampostxt(c29_txt_mod_ancho_esp);        
   
v.validarcampostxt(c32_txt_posicion_sust_adherida);        
v.validarcampostxtarea(c36_txt_observ);        
        

v.validarcamposcbx(c5_cbxMP);        
v.validarcamposcbx(c6_cbx_entera_fracturada);        
v.validarcamposcbx(c7_cbx_simple_compuesta);        
v.validarcamposcbx(c8_cbx_clase_artef);        
v.validarcamposcbx(c12_cbx_forma_base);        
v.validarcamposcbx(c14_cbx_origen_extrac);        
v.validarcamposcbx(c15_cbx_alterac_tratam_term);        
v.validarcamposcbx(c16_cbx_sup_talon);        
v.validarcamposcbx(c30_cbx_clase_tecnica);        
v.validarcamposcbx(c31_cbx_sustancia_adherida);        
v.validarcamposcbx(c33_cbx_proporcion_corteza);        
v.validarcamposcbx(c34_cbx_intensidad_patina);        
v.validarcamposcbx(c35_cbx_intensidad_ventifac);  
}
    private void formInternalFrameOpened(javax.swing.event.InternalFrameEvent evt) {//GEN-FIRST:event_formInternalFrameOpened
Cargar_MP cargartodasMP = new Cargar_MP();
cargartodasMP.cargar_todas_mp(c5_cbxMP);
consultarid();
c5_cbxMP.setSelectedItem(indexMP);
    }//GEN-LAST:event_formInternalFrameOpened

    private void btn_limpiarcamposActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_limpiarcamposActionPerformed
limpiarcampos();
    }//GEN-LAST:event_btn_limpiarcamposActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed

if((!c20_txt_long.getText().equals(""))&&(!c22_txt_ancho.getText().equals(""))&&(!c24_txt_espesor.getText().equals(""))){
    

if((c21_chk_fracturado_longitud.isSelected()==false)&&(c23_chk_fracturado_ancho.isSelected()==false)&&(c25_chk_fracturado_espesor.isSelected()==false)){
Bagolini_new bag = new Bagolini_new();
bag.setVisible(true);
Bagolini_new.Escritorio.removeAll();
Internal_Bagolini bagol = new Internal_Bagolini();
Bagolini_new.Escritorio.add(bagol);
bagol.show();
bagol.calculoautombagolini(c20_txt_long.getText(), c22_txt_ancho.getText(), c24_txt_espesor.getText());
}else{
    JOptionPane.showMessageDialog(null, "No se puede cargar el gráfico porque existe alguna dimensión fracturada");
}
}else{
    JOptionPane.showMessageDialog(null, "Para ver el gráfico, debe ingresar largo, ancho y espesor máximo de la pieza");
}




    }//GEN-LAST:event_jButton2ActionPerformed

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

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

private void eliminar(){
    int confirma =0;
    int ID_PIEZA = Integer.parseInt(c1_txt_Codigo.getText());
String sql = "DELETE FROM FORMATIZADOS WHERE ID_FORMATIZADOS="+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");
         deleteSegmentales(ID_PIEZA);
         deletePuntas(ID_PIEZA);
         deleteNucleos(ID_PIEZA);
         
         DefaultMutableTreeNode leaf = (DefaultMutableTreeNode)selectednodeparaeliminar.getParent();
         InteraccionesBD interac = new InteraccionesBD();
         interac.eliminarhojaarbol(jTree1, selectednodeparaeliminar);
         interac.eliminarhojaarbol(jTree1, leaf);
         ///////////////////NOTA//////////////////////////
         //////////////////MENSAJE PARA ELIMINAR TODAS LAS FICHAS DE LA PIEZA N°....
         
         limpiarcampos();
         consultarid();
         btn_eliminar_formatizados.setEnabled(false);
         }

        } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se pudo eliminar el registro asociado a la pieza " + ID_PIEZA + ex);
        }
}    

private void deleteSegmentales(int id){
  int confirma =0;
  
        String sql = "DELETE FROM SEGMENTAL_ESTANDAR2 WHERE ID_FORMATIZADOS="+id;    
            try {
            conexion c = new conexion();
            c.getConexion();

            confirma = c.eliminar_actualizar(sql);
            c.closeconnection();
                  if(confirma>0){
         JOptionPane.showMessageDialog(null, "Se eliminaron las fichas segmentales estandar de la pieza: "+id );
         
         }
    } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se pudieron eliminar las fichas segmentales estandar asociadas a la pieza " + id +" / "+ ex);
        }
}
private void deletePuntas(int id){
  int confirma =0;
  
        String sql = "DELETE FROM PUNTAS_DE_PROYECTIL2 WHERE ID_FORMATIZADOS="+id;    
            try {
            conexion c = new conexion();
            c.getConexion();

            confirma = c.eliminar_actualizar(sql);
            c.closeconnection();
                  if(confirma>0){
         JOptionPane.showMessageDialog(null, "Se eliminaron las fichas de puntas de proy. de la pieza: "+id );
         
         }
    } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se pudieron eliminar las fichas puntas de proy. asociadas a la pieza " + id +" / "+ ex);
        }
}
private void deleteNucleos(int id){
  int confirma =0;
  
        String sql = "DELETE FROM NUCLEOS WHERE ID_FORMATIZADOS="+id;    
            try {
            conexion c = new conexion();
            c.getConexion();

            confirma = c.eliminar_actualizar(sql);
            c.closeconnection();
                  if(confirma>0){
         JOptionPane.showMessageDialog(null, "Se eliminaron las fichas de núcleos de la pieza: "+id );
         
         }
    } catch (SQLException ex) {
            JOptionPane.showMessageDialog(null, "No se pudieron eliminar las fichas núcleos asociadas a la pieza " + id +" / "+ ex);
        }
}
    private void c36_txt_observKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_c36_txt_observKeyTyped
  if (c36_txt_observ.getText().length()== 500){
    evt.consume();
}
    }//GEN-LAST:event_c36_txt_observKeyTyped

    private void c21_chk_fracturado_longitudItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_c21_chk_fracturado_longitudItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(c20_txt_long, c21_chk_fracturado_longitud);
    }//GEN-LAST:event_c21_chk_fracturado_longitudItemStateChanged

    private void c23_chk_fracturado_anchoItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_c23_chk_fracturado_anchoItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(c22_txt_ancho, c23_chk_fracturado_ancho);
    }//GEN-LAST:event_c23_chk_fracturado_anchoItemStateChanged

    private void c25_chk_fracturado_espesorItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_c25_chk_fracturado_espesorItemStateChanged
bagolini_tamaños bag = new bagolini_tamaños();
bag.fracturado(c24_txt_espesor, c25_chk_fracturado_espesor);
    }//GEN-LAST:event_c25_chk_fracturado_espesorItemStateChanged

    private void c18_ejelascadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_c18_ejelascadoActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_c18_ejelascadoActionPerformed
private void limpiarcampos(){
c2_txt_numfoto.setText("");
c3_txt_num_inv.setText("");
c4_txt_num_pieza.setText("");
c5_cbxMP.setSelectedIndex(0);
c6_cbx_entera_fracturada.setSelectedIndex(0);
c7_cbx_simple_compuesta.setSelectedIndex(0);
c8_cbx_clase_artef.setSelectedIndex(0);

c12_cbx_forma_base.setSelectedIndex(0);
c13_txt_num_facetas_extrac.setText("");
c14_cbx_origen_extrac.setSelectedIndex(0);
c15_cbx_alterac_tratam_term.setSelectedIndex(0);
c16_cbx_sup_talon.setSelectedIndex(0);
c17_txt_ancho_talon.setText("");
c18_ejelascado.setSelected(false);
c19_ejemorfologico.setSelected(false);

c20_txt_long.setText("");
c21_chk_fracturado_longitud.setSelected(false);
c22_txt_ancho.setText("");
c23_chk_fracturado_ancho.setSelected(false);
c24_txt_espesor.setText("");
c25_chk_fracturado_espesor.setSelected(false);
c26_txt_peso.setText("");
c27_txt_tamaño.setText("");
c28_txt_mod_long_ancho.setText("");
c29_txt_mod_ancho_esp.setText("");
c30_cbx_clase_tecnica.setSelectedIndex(0);

c31_cbx_sustancia_adherida.setSelectedIndex(0);
c32_txt_posicion_sust_adherida.setText("");
c33_cbx_proporcion_corteza.setSelectedIndex(0);
c34_cbx_intensidad_patina.setSelectedIndex(0);
c35_cbx_intensidad_ventifac.setSelectedIndex(0);
c36_txt_observ.setText("");
}

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public static javax.swing.JButton btn_eliminar_formatizados;
    private javax.swing.JButton btn_limpiarcampos;
    private javax.swing.JComboBox<String> c12_cbx_forma_base;
    private javax.swing.JTextField c13_txt_num_facetas_extrac;
    private javax.swing.JComboBox<String> c14_cbx_origen_extrac;
    private javax.swing.JComboBox<String> c15_cbx_alterac_tratam_term;
    private javax.swing.JComboBox<String> c16_cbx_sup_talon;
    private javax.swing.JTextField c17_txt_ancho_talon;
    private javax.swing.JRadioButton c18_ejelascado;
    private javax.swing.JRadioButton c19_ejemorfologico;
    private javax.swing.JTextField c1_txt_Codigo;
    private javax.swing.JTextField c20_txt_long;
    private javax.swing.JCheckBox c21_chk_fracturado_longitud;
    private javax.swing.JTextField c22_txt_ancho;
    private javax.swing.JCheckBox c23_chk_fracturado_ancho;
    private javax.swing.JTextField c24_txt_espesor;
    private javax.swing.JCheckBox c25_chk_fracturado_espesor;
    private javax.swing.JTextField c26_txt_peso;
    private javax.swing.JTextField c27_txt_tamaño;
    private javax.swing.JTextField c28_txt_mod_long_ancho;
    private javax.swing.JTextField c29_txt_mod_ancho_esp;
    private javax.swing.JTextField c2_txt_numfoto;
    private javax.swing.JComboBox<String> c30_cbx_clase_tecnica;
    private javax.swing.JComboBox<String> c31_cbx_sustancia_adherida;
    public static javax.swing.JTextField c32_txt_posicion_sust_adherida;
    private javax.swing.JComboBox<String> c33_cbx_proporcion_corteza;
    private javax.swing.JComboBox<String> c34_cbx_intensidad_patina;
    private javax.swing.JComboBox<String> c35_cbx_intensidad_ventifac;
    private javax.swing.JTextArea c36_txt_observ;
    private javax.swing.JTextField c3_txt_num_inv;
    private javax.swing.JTextField c4_txt_num_pieza;
    private javax.swing.JComboBox<String> c5_cbxMP;
    private javax.swing.JComboBox<String> c6_cbx_entera_fracturada;
    private javax.swing.JComboBox<String> c7_cbx_simple_compuesta;
    private javax.swing.JComboBox<String> c8_cbx_clase_artef;
    private javax.swing.ButtonGroup ejes;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    public javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton7;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    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 jLabel24;
    private javax.swing.JLabel jLabel25;
    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 jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel4;
    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.JLabel jLabel45;
    private javax.swing.JLabel jLabel46;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    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.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    // End of variables declaration//GEN-END:variables
}
