text:
<repo_name>fip3torrejon/videoBuster<file_sep>/src/vista/Ventana.java
package vista;

/*
 * 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.
 */

import controlador.exceptions.*;
import controlador.*;
import oracle.jdbc.OracleDriver;
import java.sql.*;
import javax.swing.*;
import javax.swing.table.*;
import modelo.*;
import java.util.ArrayList;

/**
 *
 * @author <NAME>
 */
public class Ventana extends javax.swing.JFrame {

    /**
     * Creates new form Ventana
     */
    public Ventana() {
        initComponents();
        initCategoria();
        mostrarListado();
        listarCategoria();
    }

    public void mostrarListado(){
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("CODIGO");
        modelo.addColumn("NOMBRE");
        modelo.addColumn("CATEGORIA");
        modelo.addColumn("PRECIO");
        modelo.addColumn("FORMATO 4K");
        jTabla.setModel(modelo);

        ArrayList<Pelicula> listado;
        listado = Registro.listarPeliculas();
        String[] entrada = new String[5];

        for(Pelicula p : listado) {
            entrada[0] = String.valueOf(p.getCodigo());
            entrada[1] = p.getNombre();
            entrada[2] = Registro.buscarCategoria(p.getIdCategoria()).getDescripcion();
            entrada[3] = String.valueOf(p.getPrecio());
            entrada[4] = p.getFormato4k();

            modelo.addRow(entrada);
        }

        jTabla.setModel(modelo);
    }

    public void listarCategoria(){
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("ID");
        modelo.addColumn("DESCRIPCION");
        jTablaCat.setModel(modelo);

        ArrayList<Categoria> listado;
        listado = Registro.listarCategoriaId();
        String[] entrada = new String[2];

        for(Categoria cat : listado) {
            entrada[0] = String.valueOf(cat.getId());
            entrada[1] = cat.getDescripcion();

            modelo.addRow(entrada);
        }

        jTablaCat.setModel(modelo);
    }

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

        jPopupMenu1 = new javax.swing.JPopupMenu();
        jEliminarCat = new javax.swing.JMenuItem();
        jPanelIngreso = new javax.swing.JTabbedPane();
        jIngresar = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jAgregar = new javax.swing.JButton();
        jLabel4 = new javax.swing.JLabel();
        jCodigo = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jNombre = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jPrecio = new javax.swing.JTextField();
        jCategoria = new javax.swing.JComboBox<>();
        jLabel10 = new javax.swing.JLabel();
        jFormato = new javax.swing.JCheckBox();
        jPanel2 = new javax.swing.JPanel();
        jModificar = new javax.swing.JButton();
        jLabel13 = new javax.swing.JLabel();
        jCodigoM = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jNombreM = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jPrecioM = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jFormatoM = new javax.swing.JCheckBox();
        jBuscar = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jCategoriaM = new javax.swing.JComboBox<>();
        jTexto = new javax.swing.JTextField();
        jAyuda = new javax.swing.JButton();
        jLimpiar = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTablaCat = new javax.swing.JTable();
        jLabel12 = new javax.swing.JLabel();
        jDescripcion = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jId = new javax.swing.JTextField();
        jLabel18 = new javax.swing.JLabel();
        jAgregarCategoria = new javax.swing.JButton();
        jSeparator2 = new javax.swing.JSeparator();
        jListar = new javax.swing.JPanel();
        jCategoriaL = new javax.swing.JComboBox<>();
        jLabel7 = new javax.swing.JLabel();
        jEliminar = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTabla = new javax.swing.JTable();
        jCodigoE = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jTextoBuscar = new javax.swing.JTextField();
        jBuscarNombre = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jMenu = new javax.swing.JMenuBar();
        jOpciones = new javax.swing.JMenu();
        jSalir = new javax.swing.JMenuItem();

        jEliminarCat.setText("Eliminar");
        jEliminarCat.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jEliminarCatActionPerformed(evt);
            }
        });
        jPopupMenu1.add(jEliminarCat);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);

        jPanelIngreso.setTabPlacement(javax.swing.JTabbedPane.BOTTOM);
        jPanelIngreso.setToolTipText("");
        jPanelIngreso.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jPanelIngreso.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jPanelIngresoMouseClicked(evt);
            }
        });

        jLabel3.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel3.setForeground(new java.awt.Color(153, 153, 153));
        jLabel3.setText("AGREGAR VIDEO");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jAgregar.setText("AGREGAR");
        jAgregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAgregarActionPerformed(evt);
            }
        });

        jLabel4.setText("CODIGO");

        jLabel6.setText("NOMBRE");

        jLabel8.setText("PRECIO");

        jLabel10.setText("CATEGORIA");

        jFormato.setText("FORMATO 4K");
        jFormato.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFormatoActionPerformed(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()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel6)
                    .addComponent(jLabel8)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addGap(27, 27, 27)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPrecio, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jNombre, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jCategoria, javax.swing.GroupLayout.Alignment.TRAILING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jCodigo)))
                    .addComponent(jFormato))
                .addGap(8, 8, 8))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(96, 96, 96)
                .addComponent(jAgregar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jCodigo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(jNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jPrecio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(jCategoria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jFormato)
                .addGap(18, 18, 18)
                .addComponent(jAgregar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jModificar.setText("MODIFICAR");
        jModificar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jModificarActionPerformed(evt);
            }
        });

        jLabel13.setText("CODIGO");

        jLabel14.setText("NOMBRE");

        jLabel15.setText("PRECIO");

        jLabel17.setText("CATEGORIA");

        jFormatoM.setText("FORMATO 4K");
        jFormatoM.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jFormatoMActionPerformed(evt);
            }
        });

        jBuscar.setText("BUSCAR");
        jBuscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBuscarActionPerformed(evt);
            }
        });

        jCategoriaM.setEditable(true);

        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.LEADING)
                    .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel13)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
                        .addComponent(jCodigoM, javax.swing.GroupLayout.PREFERRED_SIZE, 190, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jBuscar))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel15)
                        .addGap(53, 53, 53)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCategoriaM, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jPrecioM)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jFormatoM)
                            .addComponent(jLabel17))
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addComponent(jLabel14)
                        .addGap(49, 49, 49)
                        .addComponent(jNombreM)))
                .addContainerGap())
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jModificar)
                .addGap(138, 138, 138))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jBuscar)
                    .addComponent(jLabel13)
                    .addComponent(jCodigoM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 5, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jNombreM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel14))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel15)
                    .addComponent(jPrecioM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(jCategoriaM, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jFormatoM)
                .addGap(18, 18, 18)
                .addComponent(jModificar)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jAyuda.setText("AYUDA");
        jAyuda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAyudaActionPerformed(evt);
            }
        });

        jLimpiar.setText("LIMPIAR");
        jLimpiar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jLimpiarActionPerformed(evt);
            }
        });

        jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jScrollPane2.setComponentPopupMenu(jPopupMenu1);

        jTablaCat.setModel(new javax.swing.table.DefaultTableModel(

        ));
        jTablaCat.setComponentPopupMenu(jPopupMenu1);
        jScrollPane2.setViewportView(jTablaCat);

        jLabel12.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel12.setForeground(new java.awt.Color(153, 153, 153));
        jLabel12.setText("AGREGAR CATEGORIA");

        jLabel16.setText("ID");

        jLabel18.setText("DESCRIPCION");

        jAgregarCategoria.setText("Agregar Categoria");
        jAgregarCategoria.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jAgregarCategoriaActionPerformed(evt);
            }
        });

        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()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(jLabel12)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 243, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel18)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jPanel3Layout.createSequentialGroup()
                                .addComponent(jLabel16)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(jPanel3Layout.createSequentialGroup()
                                        .addComponent(jId, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(39, 39, 39)
                                        .addComponent(jAgregarCategoria))
                                    .addComponent(jDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)))
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 294, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel12)
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jAgregarCategoria)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jId, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel16)))
                        .addGap(18, 18, 18)
                        .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel18)
                            .addComponent(jDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(0, 34, Short.MAX_VALUE)))
                .addContainerGap())
        );

        javax.swing.GroupLayout jIngresarLayout = new javax.swing.GroupLayout(jIngresar);
        jIngresar.setLayout(jIngresarLayout);
        jIngresarLayout.setHorizontalGroup(
            jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jIngresarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jIngresarLayout.createSequentialGroup()
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(jIngresarLayout.createSequentialGroup()
                        .addGroup(jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jIngresarLayout.createSequentialGroup()
                                .addComponent(jTexto)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLimpiar)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jAyuda))
                            .addGroup(jIngresarLayout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(jIngresarLayout.createSequentialGroup()
                                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(11, 11, 11))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jIngresarLayout.createSequentialGroup()
                        .addComponent(jSeparator2)
                        .addContainerGap())))
        );
        jIngresarLayout.setVerticalGroup(
            jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jIngresarLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jAyuda)
                        .addComponent(jLimpiar))
                    .addGroup(jIngresarLayout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jIngresarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jTexto, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(28, 28, 28)
                .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanelIngreso.addTab("Registro", jIngresar);

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

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jLabel7.setForeground(new java.awt.Color(153, 153, 153));
        jLabel7.setText("INVENTARIO VIDEO BUSTER");

        jEliminar.setText("ELIMINAR");
        jEliminar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jEliminarActionPerformed(evt);
            }
        });

        jTabla.setModel(new javax.swing.table.DefaultTableModel());
        jScrollPane1.setViewportView(jTabla);

        jLabel5.setText("Codigo Pelicula");

        jLabel9.setText("Buscar por Categoría:");

        jLabel11.setText("Buscar por Nombre:");

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

        jBuscarNombre.setText("Buscar");
        jBuscarNombre.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBuscarNombreActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jListarLayout = new javax.swing.GroupLayout(jListar);
        jListar.setLayout(jListarLayout);
        jListarLayout.setHorizontalGroup(
            jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jListarLayout.createSequentialGroup()
                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jListarLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 695, Short.MAX_VALUE)
                            .addGroup(jListarLayout.createSequentialGroup()
                                .addComponent(jLabel7)
                                .addGap(0, 0, Short.MAX_VALUE))))
                    .addGroup(jListarLayout.createSequentialGroup()
                        .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jListarLayout.createSequentialGroup()
                                .addGap(160, 160, 160)
                                .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jCodigoE, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(jEliminar))
                            .addGroup(jListarLayout.createSequentialGroup()
                                .addContainerGap()
                                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(jLabel9, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(jLabel11))
                                .addGap(26, 26, 26)
                                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(jTextoBuscar)
                                    .addComponent(jCategoriaL, 0, 288, Short.MAX_VALUE))
                                .addGap(18, 18, 18)
                                .addComponent(jBuscarNombre)))
                        .addGap(0, 175, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jListarLayout.setVerticalGroup(
            jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jListarLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel7)
                .addGap(11, 11, 11)
                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jCategoriaL, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(jTextoBuscar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jBuscarNombre))
                .addGap(18, 18, 18)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jListarLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jEliminar)
                    .addComponent(jCodigoE, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5))
                .addContainerGap())
        );

        jPanelIngreso.addTab("Búsqueda", jListar);

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(153, 153, 153));
        jLabel1.setText("VIDEO BUSTER");

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        jLabel2.setForeground(new java.awt.Color(102, 102, 102));
        jLabel2.setText("PLATAFORMA  DE REGISTROS");

        jOpciones.setText("Opciones");

        jSalir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.CTRL_MASK));
        jSalir.setText("Salir");
        jSalir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jSalirActionPerformed(evt);
            }
        });
        jOpciones.add(jSalir);

        jMenu.add(jOpciones);

        setJMenuBar(jMenu);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanelIngreso)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(173, 173, 173)
                .addComponent(jLabel2)
                .addGap(174, 174, 174)
                .addComponent(jLabel1)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(jLabel2))
                .addGap(18, 18, 18)
                .addComponent(jPanelIngreso)
                .addContainerGap())
        );

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

    private void initCategoria(){

        ArrayList<Categoria> lc = Registro.listarCategoria();
        String[] entrada = new String[lc.size()];

        String[] entradaL = new String[lc.size() + 1];
        entradaL[0] = "Todas";

        for(int i = 0; i < entrada.length; i++) {
            entrada[i] = lc.get(i).getDescripcion();
            entradaL[i+1] = lc.get(i).getDescripcion();
        }

        DefaultComboBoxModel cbm = new DefaultComboBoxModel<>(entrada);
        DefaultComboBoxModel cbmM = new DefaultComboBoxModel<>(entrada);
        DefaultComboBoxModel cbmL = new DefaultComboBoxModel<>(entradaL);

        jCategoria.setModel(cbm);
        jCategoriaM.setModel(cbmM);
        jCategoriaL.setModel(cbmL);

        jCategoria.setSelectedItem(null);
        jCategoriaM.setSelectedItem(null);
        jCategoriaL.setSelectedItem("Todas");
    }

    private void jSalirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSalirActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jSalirActionPerformed

    private void jPanelIngresoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelIngresoMouseClicked

    }//GEN-LAST:event_jPanelIngresoMouseClicked

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

        try {

            if(jCodigoE.getText().equals("")){
                throw new NullPointerException();
            }

            if(Integer.parseInt(jCodigoE.getText().trim()) < 10000 || Integer.parseInt(jCodigoE.getText().trim()) >= 100000 ){
                throw new ExcepcionCodigoNoValido();
            }

            if(Registro.eliminarPelicula(Integer.parseInt(jCodigoE.getText().trim()))){
                JOptionPane.showMessageDialog(this, "Registro eliminado");
            } else {
                JOptionPane.showMessageDialog(this, "Registro no encontrado. No se pudo eliminar");
            }
            mostrarListado();

        } catch (NullPointerException ne){
            JOptionPane.showMessageDialog(this, "Debes rellenar todos los campos");
            System.out.println("Error de campos vacios -- " + ne.getMessage());
        } catch (ExcepcionCodigoNoValido ec){
            JOptionPane.showMessageDialog(this, "El codigo debe poseer 5 digitos");
            System.out.println("Error de codigo no valido -- " + ec.getMessage());
        }
    }//GEN-LAST:event_jEliminarActionPerformed

    private void jCategoriaLActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCategoriaLActionPerformed
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("CODIGO");
        modelo.addColumn("NOMBRE");
        modelo.addColumn("CATEGORIA");
        modelo.addColumn("PRECIO");
        modelo.addColumn("FORMATO 4K");

        jTabla.setModel(modelo);

        String cat = jCategoriaL.getSelectedItem().toString();

        ArrayList<Pelicula> listado = new ArrayList<>();

        if (cat.equals("Todas")){
            mostrarListado();
        } else {
            listado = Registro.buscarPeliculaPorCategoria(Registro.buscarCategoria(cat).getId());
            String[] entrada = new String[5];

            for(Pelicula p : listado) {
                entrada[0] = String.valueOf(p.getCodigo());
                entrada[1] = p.getNombre();
                entrada[2] = Registro.buscarCategoria(p.getIdCategoria()).getDescripcion();
                entrada[3] = String.valueOf(p.getPrecio());
                entrada[4] = p.getFormato4k();

                modelo.addRow(entrada);
            }

            jTabla.setModel(modelo);
        }
    }//GEN-LAST:event_jCategoriaLActionPerformed

    private void jLimpiarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jLimpiarActionPerformed
        jNombre.setText("");
        jPrecio.setText("");
        jFormato.setSelected(false);
        jCategoria.setSelectedItem(null);
        jCodigo.setText("");
        jNombreM.setText("");
        jPrecioM.setText("");
        jFormatoM.setSelected(false);
        jCategoriaM.setSelectedItem(null);
        jCodigoM.setText("");
        jTexto.setText("");
        jCodigo.requestFocusInWindow();
    }//GEN-LAST:event_jLimpiarActionPerformed

    private void jAyudaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAyudaActionPerformed
        jNombre.setText("Ingrese nombre de Pelicula");
        jPrecio.setText("Precio superior a 1000");
        jCodigo.setText("Codigo numerico de 5 digitos");
        jNombreM.setText("Ingrese nombre de Pelicula");
        jPrecioM.setText("Precio superior a 1000");
        jCodigoM.setText("Codigo numerico de 5 digitos");
        jTexto.setText("Escoja Categoria, ej: ACCION // Escoja Formato 4k sí es ALTA DEFINICION");

    }//GEN-LAST:event_jAyudaActionPerformed

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

        try {

            if(jCodigoM.getText().equals("")){
                throw new NullPointerException();
            }

            if(Integer.parseInt(jCodigoM.getText().trim()) < 10000 || Integer.parseInt(jCodigoM.getText().trim()) >= 100000 ){
                throw new ExcepcionCodigoNoValido();
            }

            if(!Registro.peliculaExiste(Integer.parseInt(jCodigoM.getText().trim()))){
                throw new ExcepcionPeliculaNoExiste();
            }

            Pelicula p = Registro.buscarPelicula(Integer.parseInt(jCodigoM.getText().trim()));

            jNombreM.setText(p.getNombre());
            jPrecioM.setText(String.valueOf(p.getPrecio()));
            jFormatoM.setSelected(p.getFormato4k().equals("S"));
            jCategoriaM.setSelectedItem(Registro.buscarCategoria(p.getIdCategoria()).getDescripcion());
        } catch (NullPointerException ne){
            jNombreM.setText("");
            jPrecioM.setText("");
            jFormatoM.setSelected(false);
            jCategoriaM.setSelectedItem(null);
            JOptionPane.showMessageDialog(this, "Ingrese codigo a buscar");
        } catch (NumberFormatException | ExcepcionCodigoNoValido ec){
            jNombreM.setText("");
            jPrecioM.setText("");
            jFormatoM.setSelected(false);
            jCategoriaM.setSelectedItem(null);
            JOptionPane.showMessageDialog(this, "El codigo debe poseer 5 digitos");
            System.out.println("Error de codigo no valido -- " + ec.getMessage());
        } catch (ExcepcionPeliculaNoExiste epnx){
            jNombreM.setText("");
            jPrecioM.setText("");
            jFormatoM.setSelected(false);
            jCategoriaM.setSelectedItem(null);
            JOptionPane.showMessageDialog(this, "Codigo no está registrado");
        }

    }//GEN-LAST:event_jBuscarActionPerformed

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

    private void jModificarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jModificarActionPerformed
        try {

            jTexto.setText(jCategoriaM.getEditor().getItem().toString());

            if(jCategoriaM.getEditor().getItem().toString() != "" && Registro.buscarCategoria(jCategoriaM.getEditor().getItem().toString()).getId() == 0){
                throw new ExcepcionCategoriaNoExiste();
            }

            if(!Registro.peliculaExiste(Integer.parseInt(jCodigoM.getText().trim()))){
                throw new ExcepcionPeliculaNoExiste();
            }

            if(Integer.parseInt(jCodigoM.getText().trim()) < 10000 || Integer.parseInt(jCodigoM.getText().trim()) >= 100000 ){
                throw new ExcepcionCodigoNoValido();
            }

            if(jCodigoM.getText().equals("") || jNombreM.getText().equals("") || jPrecioM.getText().equals("") ){
                throw new NullPointerException();
            }

            if(jNombreM.getText().trim().length() < 3){
                throw new ExcepcionNombreNoValido();
            }

            if(Integer.parseInt(jPrecioM.getText().trim()) <= 1000){
                throw new ExcepcionPrecioNoValido();
            }

            Pelicula p = new Pelicula();

            Object catcb = jCategoriaM.getSelectedItem();

            p.setCodigo(Integer.parseInt(jCodigoM.getText().trim()));
            p.setPrecio(Integer.parseInt(jPrecioM.getText().trim()));
            p.setIdCategoria(Registro.buscarCategoria(catcb.toString()).getId());
            p.setNombre(jNombreM.getText().trim());
            if (jFormatoM.isSelected()){
                p.setFormato4k("S");
            } else {
                p.setFormato4k("N");
            }

            if(Registro.modificarPelicula(p)){
                JOptionPane.showMessageDialog(this, "Registro modificado con exito");
                jTexto.setText("Registro modificado exitosamente");
                mostrarListado();
            } else {
                JOptionPane.showMessageDialog(this, "Registro no se ha modificado");
                jTexto.setText("Registro no se modificó");
            }

        } catch (ExcepcionCategoriaNoExiste ecnx) {
            JOptionPane.showMessageDialog(this, "Categoria no existe");
            System.out.println("Error de categoria no existente -- " + ecnx.getMessage());
        } catch (ExcepcionPeliculaNoExiste epnx){
            JOptionPane.showMessageDialog(this, "Pelicula no está registrada");
        } catch (NullPointerException ne){
            JOptionPane.showMessageDialog(this, "Debes rellenar todos los campos");
            System.out.println("Error de campos vacios -- " + ne.getMessage());
        } catch (ExcepcionNombreNoValido en){
            JOptionPane.showMessageDialog(this, "El nombre debe tener 3 caracteres como minimo ");
            System.out.println("Error de largo de nombre -- " + en.getMessage());
        } catch (ExcepcionPrecioNoValido ep){
            JOptionPane.showMessageDialog(this, "El precio debe ser mayor a $1000");
            System.out.println("Error de rango de precio -- " + ep.getMessage());
        } catch (ExcepcionCodigoNoValido ec){
            JOptionPane.showMessageDialog(this, "El codigo debe poseer 5 digitos");
            System.out.println("Error de codigo no valido -- " + ec.getMessage());
        } catch (NumberFormatException nfe){
            JOptionPane.showMessageDialog(this, "Precio y Codigo deben ser numéricos");
            System.out.println("Error de caracter no valido -- " + nfe.getMessage());
        }
    }//GEN-LAST:event_jModificarActionPerformed

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

    private void jAgregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAgregarActionPerformed
        try {

            if(jCodigo.getText().equals("") || jNombre.getText().equals("") || jPrecio.getText().equals("") ){
                throw new NullPointerException();
            }

            if(!Registro.peliculaExiste(Integer.parseInt(jCodigo.getText().trim()))){
                throw new ExcepcionCodigoExistente();
            }

            if(Integer.parseInt(jCodigo.getText().trim()) < 10000 || Integer.parseInt(jCodigo.getText().trim()) >= 100000 ){
                throw new ExcepcionCodigoNoValido();
            }

            if(jNombre.getText().trim().length() < 3){
                throw new ExcepcionNombreNoValido();
            }

            if(Integer.parseInt(jPrecio.getText().trim()) <= 1000){
                throw new ExcepcionPrecioNoValido();
            }

            Pelicula p = new Pelicula();

            Object catcb = jCategoria.getSelectedItem();

            p.setCodigo(Integer.parseInt(jCodigo.getText().trim()));
            p.setPrecio(Integer.parseInt(jPrecio.getText().trim()));
            p.setIdCategoria(Registro.buscarCategoria(catcb.toString()).getId());
            p.setNombre(jNombre.getText().trim());
            if (jFormato.isSelected()){
                p.setFormato4k("S");
            } else {
                p.setFormato4k("N");
            }

            if(Registro.agregarPelicula(p)){
                JOptionPane.showMessageDialog(this, "Registro ingresado con exito");
                jTexto.setText("Registro ingresado exitosamente");
                mostrarListado();
            } else {
                JOptionPane.showMessageDialog(this, "Registro no ingresado");
                jTexto.setText("Error al ingresar registro");
            }

        } catch (NullPointerException ne){
            JOptionPane.showMessageDialog(this, "Debes rellenar todos los campos");
            System.out.println("Error de campos vacios -- " + ne.getMessage());
        } catch(ExcepcionCodigoExistente ex){
            JOptionPane.showMessageDialog(this, "Ya existe una película asociada al código.");
            System.out.println("Error de campos vacios -- " + ex.getMessage());
        } catch (ExcepcionCodigoNoValido ec){
            JOptionPane.showMessageDialog(this, "El codigo debe:\n - poseer 5 digitos.\n - no comenzar con 0 (cero)");
            System.out.println("Error de codigo no valido -- " + ec.getMessage());
        } catch (ExcepcionNombreNoValido en){
            JOptionPane.showMessageDialog(this, "El nombre debe tener 3 caracteres como minimo ");
            System.out.println("Error de largo de nombre -- " + en.getMessage());
        } catch (ExcepcionPrecioNoValido ep){
            JOptionPane.showMessageDialog(this, "El precio debe ser mayor a $1000");
            System.out.println("Error de rango de precio -- " + ep.getMessage());
        } catch (NumberFormatException nfe){
            JOptionPane.showMessageDialog(this, "Precio y Codigo deben ser numéricos");
            System.out.println("Error de caracter no valido -- " + nfe.getMessage());
        }

    }//GEN-LAST:event_jAgregarActionPerformed

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

    private void jBuscarNombreActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBuscarNombreActionPerformed
        DefaultTableModel modelo = new DefaultTableModel();
        modelo.addColumn("CODIGO");
        modelo.addColumn("NOMBRE");
        modelo.addColumn("CATEGORIA");
        modelo.addColumn("PRECIO");
        modelo.addColumn("FORMATO 4K");

        jTabla.setModel(modelo);

        String cat = jCategoriaL.getSelectedItem().toString();

        ArrayList<Pelicula> listado = new ArrayList<>();

        if (jTextoBuscar.getText().equals("")){
            mostrarListado();
        } else {
            listado = Registro.buscarPelicula(jTextoBuscar.getText());
            String[] entrada = new String[5];

            for(Pelicula p : listado) {
                entrada[0] = String.valueOf(p.getCodigo());
                entrada[1] = p.getNombre();
                entrada[2] = Registro.buscarCategoria(p.getIdCategoria()).getDescripcion();
                entrada[3] = String.valueOf(p.getPrecio());
                entrada[4] = p.getFormato4k();

                modelo.addRow(entrada);
            }

            jTabla.setModel(modelo);
        }
    }//GEN-LAST:event_jBuscarNombreActionPerformed

    private void jAgregarCategoriaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jAgregarCategoriaActionPerformed
        try {

            if(jId.getText().equals("") || jDescripcion.getText().equals("")){
                throw new NullPointerException();
            }

            if(Registro.categoriaExiste(Integer.parseInt(jId.getText().trim()))){
                throw new ExcepcionCodigoExistente();
            }

            if(Integer.parseInt(jId.getText().trim()) < 100 || Integer.parseInt(jId.getText().trim()) >= 1000 ){
                throw new ExcepcionCodigoNoValido();
            }

            if(jDescripcion.getText().trim().length() < 3){
                throw new ExcepcionNombreNoValido();
            }

            Categoria cat = new Categoria();

            cat.setId(Integer.parseInt(jId.getText().trim()));
            cat.setDescripcion(jDescripcion.getText().trim());

            if(Registro.agregarCategoria(cat)){
                JOptionPane.showMessageDialog(this, "Categoria ingresada con exito");
                listarCategoria();
            } else {
                JOptionPane.showMessageDialog(this, "Registro no ingresado");
                listarCategoria();
            }

        } catch (NullPointerException ne){
            JOptionPane.showMessageDialog(this, "Debes rellenar todos los campos");
            System.out.println("Error de campos vacios -- " + ne.getMessage());
        } catch(ExcepcionCodigoExistente ex){
            JOptionPane.showMessageDialog(this, "Ya existe una categoria con ese Id.");
            System.out.println("Error de campos vacios -- " + ex.getMessage());
        } catch (ExcepcionCodigoNoValido ec){
            JOptionPane.showMessageDialog(this, "El id debe estar entre 100 y 999");
            System.out.println("Error de id no valido -- " + ec.getMessage());
        } catch (ExcepcionNombreNoValido en){
            JOptionPane.showMessageDialog(this, "La descripcion debe tener 3 caracteres como minimo ");
            System.out.println("Error de largo de descripcion -- " + en.getMessage());
        } catch (NumberFormatException nfe){
            JOptionPane.showMessageDialog(this, "ID debe ser numérico");
            System.out.println("Error de caracter no valido -- " + nfe.getMessage());
        }
    }//GEN-LAST:event_jAgregarCategoriaActionPerformed

    private void jEliminarCatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jEliminarCatActionPerformed
        try {

            if(jTablaCat.getValueAt(jTablaCat.getSelectedRow(), jTablaCat.getSelectedColumn()).toString().equals("")){
                throw new NullPointerException();
            }

            if(Registro.eliminarCategoria(Integer.parseInt(jTablaCat.getValueAt(jTablaCat.getSelectedRow(), 0).toString()))){
                JOptionPane.showMessageDialog(this, "Registro eliminado");
            } else {
                JOptionPane.showMessageDialog(this, "Registro no encontrado. No se pudo eliminar");
            }
            listarCategoria();

        } catch (NullPointerException ne){
            JOptionPane.showMessageDialog(this, "Debes rellenar todos los campos");
            System.out.println("Error de campos vacios -- " + ne.getMessage());
        }
    }//GEN-LAST:event_jEliminarCatActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Ventana.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Ventana().setVisible(true);
            }

        });

    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jAgregar;
    private javax.swing.JButton jAgregarCategoria;
    private javax.swing.JButton jAyuda;
    private javax.swing.JButton jBuscar;
    private javax.swing.JButton jBuscarNombre;
    private javax.swing.JComboBox<String> jCategoria;
    private javax.swing.JComboBox<String> jCategoriaL;
    private javax.swing.JComboBox<String> jCategoriaM;
    private javax.swing.JTextField jCodigo;
    private javax.swing.JTextField jCodigoE;
    private javax.swing.JTextField jCodigoM;
    private javax.swing.JTextField jDescripcion;
    private javax.swing.JButton jEliminar;
    private javax.swing.JMenuItem jEliminarCat;
    private javax.swing.JCheckBox jFormato;
    private javax.swing.JCheckBox jFormatoM;
    private javax.swing.JTextField jId;
    private javax.swing.JPanel jIngresar;
    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 jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JButton jLimpiar;
    private javax.swing.JPanel jListar;
    private javax.swing.JMenuBar jMenu;
    private javax.swing.JButton jModificar;
    private javax.swing.JTextField jNombre;
    private javax.swing.JTextField jNombreM;
    private javax.swing.JMenu jOpciones;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JTabbedPane jPanelIngreso;
    private javax.swing.JPopupMenu jPopupMenu1;
    private javax.swing.JTextField jPrecio;
    private javax.swing.JTextField jPrecioM;
    private javax.swing.JMenuItem jSalir;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JTable jTabla;
    private javax.swing.JTable jTablaCat;
    private javax.swing.JTextField jTexto;
    private javax.swing.JTextField jTextoBuscar;
    // End of variables declaration//GEN-END:variables
}
<file_sep>/src/basedatos/Conexion.java
/*
 * 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 basedatos;

import java.sql.*;
import oracle.jdbc.driver.OracleDriver;

/**
 *
 * @author felip
 */
public class Conexion {
    private final String USUARIO = "felipe";
    //Contraseña del usuario de la bd
    private final String PASS = "<PASSWORD>";
    //SID de la bd, este lo registramos en la instalacion
    private final String SID = "XE";
    //Host donde se encuentra la bd
    private final String HOST = "localhost";
    //puerto 1521 es el estandar para este tipo de instalaciones
    private final int PUERTO = 1521;
    //Objeto donde se almacenará la conexión
    private Connection connection;

    public Connection getConnection() {
        return connection;
    }

    /*
     * Instanciar objeto de tipo OracleDriver para regitrar y posterior uso de él
     * Este objeto lo provee el driver que se agrega al principio
     */
    public void registrarDriver() throws SQLException {
        OracleDriver oracleDriver = new oracle.jdbc.driver.OracleDriver();
        DriverManager.registerDriver(oracleDriver);
    }

    /*
     * Conexion a la bd.para esto nos
     * Asegurar que el objeto este null o que este cerrada la conexion.
     *
     * cadenaConexion: string que se contruye a partir de los atributos
     * definidos.
     *
     * Obtener conexion.
     * El metodo "getConnection" lanza excepcion la cual propagamos "throws SQLException".
     */
    public void conectar() throws SQLException {
        if (connection == null || connection.isClosed() == true) {
            String cadenaConexion = "jdbc:oracle:thin:@" + HOST + ":" + PUERTO + ":" + SID;
            registrarDriver();
            connection = DriverManager.getConnection(cadenaConexion, USUARIO, PASS);

        }
    }

    /*
     * Método que cierra conexion, una vez hayamos terminado de usar la bd
     */
    public void cerrar() throws SQLException {
        if (connection != null && connection.isClosed() == false) {
            connection.close();
        }
    }

}
<file_sep>/nbproject/private/private.properties
compile.on.save=true
file.reference.ojdbc7.jar=C:\\Users\\ftorrejon\\Downloads\\ojdbc8.jar
user.properties.file=C:\\Users\\ftorrejon\\AppData\\Roaming\\NetBeans\\8.2\\build.properties
<file_sep>/src/modelo/Pelicula.java
/*
 * 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 modelo;

import java.util.Objects;

/**
 *
 * @author felip
 */
public class Pelicula {
    private int codigo;
    private int precio;
    private int idCategoria;
    private String formato4k;
    private String nombre;

    public Pelicula() {
    }

    public Pelicula(int codigo, int precio, int id_categoria, String formato4k, String nombre) {
        this.codigo = codigo;
        this.precio = precio;
        this.idCategoria = id_categoria;
        this.formato4k = formato4k;
        this.nombre = nombre;
    }

    public int getCodigo() {
        return codigo;
    }

    public void setCodigo(int codigo) {
        this.codigo = codigo;
    }

    public int getPrecio() {
        return precio;
    }

    public void setPrecio(int precio) {
        this.precio = precio;
    }

    public int getIdCategoria() {
        return idCategoria;
    }

    public void setIdCategoria(int idCategoria) {
        this.idCategoria = idCategoria;
    }

    public String getFormato4k() {
        return formato4k;
    }

    public void setFormato4k(String formato4k) {
        this.formato4k = formato4k;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    @Override
    public String toString() {
        return "Pelicula{" + "codigo=" + codigo + ", precio=" + precio + ", idCategoria=" + idCategoria + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7; //Double.hashCode(Math.random());
        return hash;
    }

    @Override
    public boolean equals(Object obj) {

        if (this == obj) {
            return true;
        }

        if (obj == null) {
            return false;
        }

        if (getClass() != obj.getClass()) {
            return false;
        }
        final Pelicula other = (Pelicula) obj;
        if (this.codigo != other.codigo) {
            return false;
        }
        if (this.precio != other.precio) {
            return false;
        }
        if (this.idCategoria != other.idCategoria) {
            return false;
        }
        if (!Objects.equals(this.formato4k, other.formato4k)) {
            return false;
        }
        return Objects.equals(this.nombre, other.nombre);
    }

}
<file_sep>/README.md
# videoBuster
plataforma de inventario de video del curso MilProgramadores

languages: Java Markdown INI


text:
<repo_name>Astro36/word-vector-models<file_sep>/src/requirements.txt
boto==2.48.0
boto3==1.5.20
botocore==1.8.34
bz2file==0.98
certifi==2018.1.18
chardet==3.0.4
docutils==0.14
gensim==3.2.0
idna==2.6
jmespath==0.9.3
konlpy==0.4.4
lxml==4.1.1
nltk==3.2.5
numpy==1.14.0
python-crfsuite==0.9.5
python-dateutil==2.6.1
pyvi==0.0.8.0
regex==2018.1.10
requests==2.18.4
s3transfer==0.1.12
scikit-learn==0.19.1
scipy==1.0.0
six==1.11.0
sklearn-crfsuite==0.3.6
smart-open==1.5.6
tabulate==0.8.2
tqdm==4.19.5
urllib3==1.22<file_sep>/README.md
# Word Vector Models

> Pre-trained Word Vector Models of 30+ Languages

This project has two purposes. First of all, I'd like to share some of my experience in nlp tasks such as segmentation or word vectors. The other, which is more important, is that probably some people are searching for pre-trained word vector models for non-English languages. Alas! English has gained much more attention than any other languages has done. Check [this](https://github.com/3Top/word2vec-api) to see how easily you can get a variety of pre-trained English word vectors without efforts. I think it's time to turn our eyes to a multi language version of this.

## Requirements

Required Python 3.

See [requirements](./src/requirements.txt)

### Language Supports

If using below language, you also need additional library.

* Chinese: `jieba`
* Japanese: `mecab`
* Korean: `konlpy`
* Thai: `pythai`
* Vietnamese: `pyvi`

### Word Embeddings

If training your own model, you have to install below library.

* fastText: [fasttext](https://github.com/facebookresearch/fastText)
* Word2Vec: `gensim`

## Background / References

* Check [this](https://en.wikipedia.org/wiki/Word_embedding) to know what word embedding is.
* Check [this](https://en.wikipedia.org/wiki/Word2vec) to quickly get a picture of Word2vec.
* Check [this](https://github.com/facebookresearch/fastText) to install fastText.
* Watch [this](https://www.youtube.com/watch?v=T8tQZChniMk&index=2&list=PL_6hBtWGKk2KdY3ANaEYbxL3N5YhRN9i0) to really understand what's happening under the hood of Word2vec.
* Go get various English word vectors [here](https://github.com/3Top/word2vec-api) if needed.

## Work Flow

* STEP 1-1. Download the [wikipedia database backup dumps](https://dumps.wikimedia.org/backup-index.html) of the language you want (For example, for english wiki go to [https://dumps.wikimedia.org/enwiki/](https://dumps.wikimedia.org/enwiki/), click the latest timestamp, and download the `enwiki-YYYYMMDD-pages-articles-multistream.xml.bz2` file).
* STEP 1-2. Install requirements packages.
* STEP 2. Extract running texts to `./data` directory.
* STEP 3. Run `./src/build_corpus.py`.

```bash
python build_corpus.py --lcode=ko
```

* STEP 4-1. Run `./src/train_word2vec.py` to get Word2Vec word vectors:

```bash
python train_word2vec.py --lcode=en --vector_size=300 --window_size=5 --vocab_size=50000 --num_negative=5
```

* STEP 4-2. Run `./script/fasttext.sh` to get fastText word vectors.

## Pre-trained models

Two types of pre-trained models are provided. `w` and `f` represent `word2vec` and `fastText` respectively.

Check language code [here](./Language.md).

| Language | ISO 639-1 | Vector Size | Corpus Size | Vocabulary Size |
| -------- | --------- | ----------- | ----------- | --------------- |
|[Bengali(w)](https://drive.google.com/open?id=0B0ZXk88koS2KX01rR2dyRWpHNTA) & [Bengali(f)](https://www.dropbox.com/s/xmi5xhqlu60bwfa/bn.tar.gz?dl=0)| bn | 300 | 147M | 10059 |
|[Catalan(w)](https://drive.google.com/open?id=0B0ZXk88koS2KYkd5OVExR3o1V1k) & [Catalan(f)](https://www.dropbox.com/s/pd59l1mwvg4hocp/ca.tar.gz?dl=0) | ca | 300 | 967M | 50013 |
|[Chinese(w)](https://drive.google.com/open?id=0B0ZXk88koS2KNER5UHNDY19pbzQ) & [Chinese(f)](https://www.dropbox.com/s/il7syxqmnusul8c/zh.tar.gz?dl=0) | zh | 300 | 1G | 50101 |
|[Danish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KcW1aTGloZnpCMGM) & [Danish(f)](https://www.dropbox.com/s/x2ekc79m8p6ycue/da.tar.gz?dl=0) | da | 300 | 295M | 30134 |
|[Dutch(w)](https://drive.google.com/open?id=0B0ZXk88koS2KQnNvcm9UUUxPVXc) & [Dutch(f)](https://www.dropbox.com/s/8i6y29f38b7nb5s/nl.tar.gz?dl=0) | nl | 300 | 1G | 50160 |
|[Esperanto(w)](https://drive.google.com/open?id=0B0ZXk88koS2KblhZYmdReE9vMXM) & [Esperanto(f)](https://www.dropbox.com/s/pomn7ozppq3xmi1/eo.tar.gz?dl=0) | eo | 300 | 1G | 50597 |
|[Finnish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KVnFyem4yQkxJUFk) & [Finnish(f)](https://www.dropbox.com/s/ex0ne7rel49wtl2/fi.tar.gz?dl=0) | fi | 300 | 467M | 30029 |
|[French(w)](https://drive.google.com/open?id=0B0ZXk88koS2KM0pVTktxdG15TkE) & [French(f)](https://www.dropbox.com/s/iz3qo3cwbba0qfz/fr.tar.gz?dl=0) | fr | 300 | 1G | 50130 |
|[German(w)](https://drive.google.com/open?id=0B0ZXk88koS2KLVVLRWt0a3VmbDg) & [German(f)](https://www.dropbox.com/s/jy6taiacmptr537/de.tar.gz?dl=0) | de | 300 | 1G | 50006 |
|[Hindi(w)](https://drive.google.com/open?id=0B0ZXk88koS2KZkhLLXJvbXVhbzQ) & [Hindi(f)](https://www.dropbox.com/s/pq50ca4o3phi9ks/hi.tar.gz?dl=0) | hi | 300 | 323M | 30393 |
|[Hungarian(w)](https://drive.google.com/open?id=0B0ZXk88koS2KX2xLamRlRDJ3N1U) & [Hungarian(f)](https://www.dropbox.com/s/jtshcott8othxf2/hu.tar.gz?dl=0) | hu | 300 | 692M | 40122 |
|[Indonesian(w)](https://drive.google.com/open?id=0B0ZXk88koS2KQWxEemNNUHhnTWc) & [Indonesian(f)](https://www.dropbox.com/s/9vabe1vci7cnt57/id.tar.gz?dl=0) | id | 300 | 402M | 30048 |
|[Italian(w)](https://drive.google.com/open?id=0B0ZXk88koS2KTlM3Qm1Ta2FBaTg) & [Italian(f)](https://www.dropbox.com/s/orqfu6mb9cj9ewr/it.tar.gz?dl=0) | it | 300 | 1G | 50031 |
|[Japanese(w)](https://drive.google.com/open?id=0B0ZXk88koS2KMzRjbnE4ZHJmcWM) & [Japanese(f)](https://www.dropbox.com/s/7digqy9ag3b9xeu/ja.tar.gz?dl=0) | ja | 300 | 1G | 50108 |
|[Javanese(w)](https://drive.google.com/open?id=0B0ZXk88koS2KVVNDS0lqdGNOSGM) & [Javanese(f)](https://www.dropbox.com/s/a9kmi5r7lr35kji/jv.tar.gz?dl=0) | jv | 100 | 31M | 10019 |
|[Korean(w)](https://drive.google.com/open?id=0B0ZXk88koS2KbDhXdWg1Q2RydlU) & [Korean(f)](https://www.dropbox.com/s/stt4y0zcp2c0iyb/ko.tar.gz?dl=0) | ko | 200 | 339M | 30185 |
|[Malay(w)](https://drive.google.com/open?id=0B0ZXk88koS2KelpKdHktXzlNQzQ) & [Malay(f)](https://www.dropbox.com/s/nl3ljdgxsgbsm6l/ms.tar.gz?dl=0) | ms | 100 | 173M | 10010 |
|[Norwegian(w)](https://drive.google.com/open?id=0B0ZXk88koS2KOEZ4OThyS3gxZHM) & [Norwegian(f)](https://www.dropbox.com/s/mag6beltx2q23aa/no.tar.gz?dl=0) | no | 300 | 1G | 50209 |
|[Norwegian Nynorsk(w)](https://drive.google.com/open?id=0B0ZXk88koS2KOWdOYk5KaVhrX2c) & [Norwegian Nynorsk(f)](https://www.dropbox.com/s/1qsywdv3zqybklm/nn.tar.gz?dl=0) | nn | 100 | 114M | 10036 |
|[Polish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KbFlmMy1PUHBSZ0E) & [Polish(f)](https://www.dropbox.com/s/cibxhnsqk6gn1d8/pl.tar.gz?dl=0) | pl | 300 | 1G | 50035 |
|[Portuguese(w)](https://drive.google.com/open?id=0B0ZXk88koS2KRDcwcV9IVWFTeUE) & [Portuguese(f)](https://www.dropbox.com/s/nl7l8kqky0x94cv/pt.tar.gz?dl=0) | pt | 300 | 1G | 50246 |
|[Russian(w)](https://drive.google.com/open?id=0B0ZXk88koS2KMUJxZ0w0WjRGdnc) & [Russian(f)](https://www.dropbox.com/s/0x7oxso6x93efzj/ru.tar.gz?dl=0) | ru | 300 | 1G | 50102 |
|[Spanish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KNGNrTE4tVXRUZFU) & [Spanish(f)](https://www.dropbox.com/s/irpirphmieg4klv/es.tar.gz?dl=0) | es | 300 | 1G | 50003 |
|[Swahili(w)](https://drive.google.com/open?id=0B0ZXk88koS2Kcl90XzBYZ0lxMkE) & [Swahili(f)](https://dl.dropboxusercontent.com/u/42868014/wordvectors/fasttext/models/sw.tar.gz) | sw | 100 | 24M | 10222 |
|[Swedish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KNk1odTJtNkUxcEk) & [Swedish(f)](https://www.dropbox.com/s/7tbm0a0u31lvw25/sw.tar.gz?dl=0) | sv | 300 | 1G | 50052 |
|[Tagalog(w)](https://drive.google.com/open?id=0B0ZXk88koS2KajRzX2VuYkVtYzQ) & [Tagalog(f)](https://www.dropbox.com/s/4dm7k4sq43dqovx/tl.tar.gz?dl=0) | tl | 100 | 38M | 10068 |
|[Thai(w)](https://drive.google.com/open?id=0B0ZXk88koS2KV1FJN0xRX1FxaFE) & [Thai(f)](https://www.dropbox.com/s/xj1ujw3es0umvzh/th.tar.gz?dl=0) | th | 300 | 696M | 30225 |
|[Turkish(w)](https://drive.google.com/open?id=0B0ZXk88koS2KVDNLallXdlVQbUE) & [Turkish(f)](https://www.dropbox.com/s/9v6h6mz3dv5xgsh/tr.tar.gz?dl=0) | tr | 200 | 370M | 30036 |
|[Vietnamese(w)](https://drive.google.com/open?id=0B0ZXk88koS2KUHZZZkVwd1RoVmc) & [Vietnamese(f)](https://www.dropbox.com/s/7de79czdc85pe8u/vi.tar.gz?dl=0) | vi | 100 | 74M | 10087 |

## License

```text
WordVectorModels
Copyright (c) 2018 <NAME>, Astro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

WordVectorModels is forked from [wordvectors](https://github.com/Kyubyong/wordvectors).
<file_sep>/Language.md
# Language

> ISO 639-1 Language Code List

- Catalan: ca
- Chinese: zh
- Danish: da
- Dutch: nl
- Esperanto: eo
- Finnish: fi
- French: fr
- German: de
- Hungarian: hu
- Indonesian: id
- Italian: it
- Japanese: ja
- Javanese: jv
- Korean: ko
- Malay: ms
- Norwegian: no
- Norwegian Nynorsk: nn
- Polish: pl
- Portuguese: pt
- Russian: ru
- Spanish: es
- Swahili: sw
- Swedish: sv
- Tagalog: tl
- Thai: th
- Turkish: tr
- Vietnamese: vi

branch_name: refs/heads/master

languages: Markdown Text

repo_language: Markdown


text:
<repo_name>bharatchhabra339/React-Native-Theme<file_sep>/src/Screens/HomeScreen.js
import * as React from 'react';
import { TouchableOpacity, View, StyleSheet, Image } from 'react-native';
import { ApplicationProvider, Layout, Text } from '@ui-kitten/components'
import { ThemeColors, useTheme } from 'react-navigation';

function HomeScreen() {
    return (
        <Layout style = {{flex : 1,justifyContent : 'center',alignItems : 'center'}}>
            <View>
                <Image source={{ uri: "https://bootdey.com/img/Content/avatar/avatar6.png" }} style={{ height: 200, width: 200 }} />
            </View>
            <TouchableOpacity style = {{marginTop : 20}}>
                <Text >My Profile</Text>
            </TouchableOpacity>
        </Layout>
    );
}
const styles = StyleSheet.create({
    header: {
        backgroundColor: "#00BFFF",
        height: 200,
    },
    avatar: {
        width: 130,
        height: 130,
        borderRadius: 63,
        borderWidth: 4,
        borderColor: "white",
        marginBottom: 10,
        alignSelf: 'center',
        position: 'absolute',
        marginTop: 130
    },
    name: {
        fontSize: 22,
        color: "#FFFFFF",
        fontWeight: '600',
    },
    body: {
        marginTop: 40,
    },
    bodyContent: {
        flex: 1,
        alignItems: 'center',
        padding: 30,
    },
    name: {
        fontSize: 28,
        color: "#696969",
        fontWeight: "600"
    },
    info: {
        fontSize: 16,
        color: "#00BFFF",
        marginTop: 10
    },
    description: {
        fontSize: 16,
        color: "#696969",
        marginTop: 10,
        textAlign: 'center'
    },
    buttonContainer: {
        marginTop: 10,
        height: 45,
        flexDirection: 'row',
        justifyContent: 'center',
        alignItems: 'center',
        marginBottom: 20,
        width: 250,
        borderRadius: 30,
        backgroundColor: "#00BFFF",
    },
});

export default HomeScreen<file_sep>/README.md
# React-Native-Theme

languages: Markdown JavaScript


text:
<repo_name>aarongolliver/LoZscreensaver<file_sep>/application.windows64/source/LoZscreensaver.pde
PImage img;

int imgPos = 0;

int imgHeight;
int imgWidth;
double scaleFactor;
int scaledWidth;
int scaledHeight;

void setup() {
  size(displayWidth,displayHeight);
  noCursor();

  img = loadImage("loz.jpg");
  imgWidth = img.width;
  imgHeight = img.height;
  scaleFactor = (double) displayWidth / (double) imgWidth;
  scaledWidth = (int)(imgWidth * scaleFactor);
  scaledHeight = (int)(imgHeight * scaleFactor);

  frameRate(60);
}

void draw() {
  background(0);
  image(img,0,imgPos               ,scaledWidth,scaledHeight);
  image(img,0,imgPos + scaledHeight,scaledWidth,scaledHeight);

 imgPos -= 1;
 imgPos = imgPos % scaledHeight;
}

void mouseMoved(){
  if(frameCount > 1) exit();
}
void keyPressed(){
  if(frameCount > 1) exit();
}

repo_language: Processing

repo_name: aarongolliver/LoZscreensaver