Java tutorial
/* * 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 proyecto4; import java.awt.Dimension; import java.util.ArrayList; import javax.swing.DefaultComboBoxModel; import javax.swing.JFrame; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; import edu.uci.ics.jung.algorithms.layout.FRLayout; import edu.uci.ics.jung.algorithms.layout.Layout; import edu.uci.ics.jung.algorithms.shortestpath.DijkstraShortestPath; import edu.uci.ics.jung.graph.SparseMultigraph; import edu.uci.ics.jung.graph.util.EdgeType; import edu.uci.ics.jung.visualization.BasicVisualizationServer; import edu.uci.ics.jung.visualization.decorators.ToStringLabeller; import edu.uci.ics.jung.visualization.renderers.Renderer; import java.util.List; import org.apache.commons.collections15.Transformer; /** * * @author jordi */ public class Principal extends javax.swing.JFrame { int numero_de_ordenes = 0; double total_vendido = 0; int dia = 1; /** * Creates new form Principal */ public Principal() { initComponents(); this.rootPane = null; this.setLocationRelativeTo(this.rootPane); setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); Lugar p = new Lugar("Salmans"); Lugar p1 = new Lugar("Salmans1"); Lugar p2 = new Lugar("Salmans2"); Lugar p3 = new Lugar("Salmans3"); Lugar p4 = new Lugar("Salmans4"); Lugar p5 = new Lugar("Salmans5"); Lugar p6 = new Lugar("Salmans6"); Lugar p7 = new Lugar("Salmans7"); Lugar p8 = new Lugar("Salmans8"); Lugar p9 = new Lugar("Salmans9"); lista_lugares.add(p); lista_lugares.add(p1); lista_lugares.add(p2); lista_lugares.add(p3); lista_lugares.add(p4); lista_lugares.add(p5); lista_lugares.add(p6); lista_lugares.add(p7); lista_lugares.add(p8); lista_lugares.add(p9); } /** * 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() { jd_agregar_ingrediente = new javax.swing.JDialog(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); txt_nom_ingre = new javax.swing.JTextField(); btn_agregar_ingrediente = new javax.swing.JButton(); jd_eliminar_ingrediente = new javax.swing.JDialog(); jLabel3 = new javax.swing.JLabel(); cb_elimi_ingre = new javax.swing.JComboBox(); jLabel4 = new javax.swing.JLabel(); btn_eliminar_ingre = new javax.swing.JButton(); jd_agregar_producto = new javax.swing.JDialog(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel(); jLabel8 = new javax.swing.JLabel(); jLabel9 = new javax.swing.JLabel(); txt_nom_prod = new javax.swing.JTextField(); txt_prec_prod = new javax.swing.JTextField(); txt_tiempo_prep = new javax.swing.JTextField(); jScrollPane2 = new javax.swing.JScrollPane(); jt_agre_ingre = new javax.swing.JTable(); btn_agregar_prod_a_lista_espera = new javax.swing.JButton(); jd_modif_productos = new javax.swing.JDialog(); jLabel12 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel(); txt_nom_prod_modif = new javax.swing.JTextField(); txt_prec_prod_modif = new javax.swing.JTextField(); jLabel14 = new javax.swing.JLabel(); jLabel15 = new javax.swing.JLabel(); txt_tiempo_prep_prod_modif = new javax.swing.JTextField(); jLabel16 = new javax.swing.JLabel(); jScrollPane3 = new javax.swing.JScrollPane(); jt_agre_ingre_modif = new javax.swing.JTable(); btn_modif = new javax.swing.JButton(); cb_modif_prod = new javax.swing.JComboBox(); jd_eliminar_prod = new javax.swing.JDialog(); jLabel10 = new javax.swing.JLabel(); jLabel11 = new javax.swing.JLabel(); cb_eliminar_prod = new javax.swing.JComboBox(); btn_eliminar_productos = new javax.swing.JButton(); jd_cocineros = new javax.swing.JDialog(); jLabel17 = new javax.swing.JLabel(); jLabel18 = new javax.swing.JLabel(); jLabel19 = new javax.swing.JLabel(); lbCocinero1 = new javax.swing.JLabel(); jProgressBar1 = new javax.swing.JProgressBar(); jTextField1 = new javax.swing.JTextField(); lbCocinero2 = new javax.swing.JLabel(); jProgressBar2 = new javax.swing.JProgressBar(); jTextField2 = new javax.swing.JTextField(); lbCocinero3 = new javax.swing.JLabel(); jProgressBar3 = new javax.swing.JProgressBar(); jTextField3 = new javax.swing.JTextField(); lbCocinero4 = new javax.swing.JLabel(); jProgressBar4 = new javax.swing.JProgressBar(); jTextField4 = new javax.swing.JTextField(); lbCocinero5 = new javax.swing.JLabel(); jProgressBar5 = new javax.swing.JProgressBar(); jTextField5 = new javax.swing.JTextField(); cb_lista_productos_cocineros = new javax.swing.JComboBox(); jButton1 = new javax.swing.JButton(); jLabel20 = new javax.swing.JLabel(); jd_camiones = new javax.swing.JDialog(); jScrollPane1 = new javax.swing.JScrollPane(); jt_ordenes_camiones = new javax.swing.JTable(); cb_camiones = new javax.swing.JComboBox(); btn_aceptar_ordenes_camiones = new javax.swing.JButton(); jLabel21 = new javax.swing.JLabel(); jd_dijsktra = new javax.swing.JDialog(); jLabel22 = new javax.swing.JLabel(); jLabel23 = new javax.swing.JLabel(); txt_recorrido_de = new javax.swing.JTextField(); txt_recorrido_a = new javax.swing.JTextField(); jLabel24 = new javax.swing.JLabel(); jScrollPane4 = new javax.swing.JScrollPane(); ta_pizarra = new javax.swing.JTextArea(); jLabel25 = new javax.swing.JLabel(); jd_de_donde_a_donde = new javax.swing.JDialog(); cb_de = new javax.swing.JComboBox(); jLabel26 = new javax.swing.JLabel(); jLabel27 = new javax.swing.JLabel(); cb_a = new javax.swing.JComboBox(); btn_dijkstra = new javax.swing.JButton(); jLabel32 = new javax.swing.JLabel(); jd_crear_relaciones = new javax.swing.JDialog(); btn_agregar_relaciones = new javax.swing.JButton(); jLabel28 = new javax.swing.JLabel(); js_nivel = new javax.swing.JSpinner(); cb_a_relacion = new javax.swing.JComboBox(); jLabel29 = new javax.swing.JLabel(); jLabel30 = new javax.swing.JLabel(); cb_de_relacion = new javax.swing.JComboBox(); jLabel31 = new javax.swing.JLabel(); jd_caja = new javax.swing.JDialog(); jLabel33 = new javax.swing.JLabel(); jLabel34 = new javax.swing.JLabel(); jLabel35 = new javax.swing.JLabel(); jLabel36 = new javax.swing.JLabel(); txt_total_ventas = new javax.swing.JTextField(); txt_total_impuesto = new javax.swing.JTextField(); txt_total = new javax.swing.JTextField(); btn_cerrar_caja = new javax.swing.JButton(); jLabel37 = new javax.swing.JLabel(); txt_ordenes_vendidas = new javax.swing.JTextField(); jl_dia = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel38 = new javax.swing.JLabel(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenu2 = new javax.swing.JMenu(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem4 = new javax.swing.JMenuItem(); jCheckBoxMenuItem1 = new javax.swing.JCheckBoxMenuItem(); jMenu6 = new javax.swing.JMenu(); jMenuItem6 = new javax.swing.JMenuItem(); jMenu5 = new javax.swing.JMenu(); jMenuItem7 = new javax.swing.JMenuItem(); jMenu4 = new javax.swing.JMenu(); jMenuItem9 = new javax.swing.JMenuItem(); jMenuItem5 = new javax.swing.JMenuItem(); jMenuItem8 = new javax.swing.JMenuItem(); jMenu3 = new javax.swing.JMenu(); jMenuItem10 = new javax.swing.JMenuItem(); jLabel1.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel1.setText("Agregar Ingrediente"); jLabel2.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel2.setText("Nombre:"); txt_nom_ingre.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N btn_agregar_ingrediente.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_agregar_ingrediente.setText("Agregar"); btn_agregar_ingrediente.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_agregar_ingredienteMouseClicked(evt); } }); javax.swing.GroupLayout jd_agregar_ingredienteLayout = new javax.swing.GroupLayout( jd_agregar_ingrediente.getContentPane()); jd_agregar_ingrediente.getContentPane().setLayout(jd_agregar_ingredienteLayout); jd_agregar_ingredienteLayout.setHorizontalGroup( jd_agregar_ingredienteLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_agregar_ingredienteLayout.createSequentialGroup().addContainerGap() .addGroup(jd_agregar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jLabel1) .addGroup(jd_agregar_ingredienteLayout.createSequentialGroup() .addComponent(jLabel2).addGap(18, 18, 18) .addComponent(txt_nom_ingre, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(btn_agregar_ingrediente, javax.swing.GroupLayout.PREFERRED_SIZE, 110, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jd_agregar_ingredienteLayout.setVerticalGroup(jd_agregar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_agregar_ingredienteLayout.createSequentialGroup().addContainerGap() .addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jd_agregar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addGroup(jd_agregar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txt_nom_ingre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_agregar_ingrediente))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jLabel3.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel3.setText("Eliminar Ingrediente"); cb_elimi_ingre.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel4.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel4.setText("Elija Ingrediente a eliminar:"); btn_eliminar_ingre.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_eliminar_ingre.setText("Eliminar"); btn_eliminar_ingre.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_eliminar_ingreMouseClicked(evt); } }); javax.swing.GroupLayout jd_eliminar_ingredienteLayout = new javax.swing.GroupLayout( jd_eliminar_ingrediente.getContentPane()); jd_eliminar_ingrediente.getContentPane().setLayout(jd_eliminar_ingredienteLayout); jd_eliminar_ingredienteLayout.setHorizontalGroup(jd_eliminar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_eliminar_ingredienteLayout.createSequentialGroup() .addGroup(jd_eliminar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_eliminar_ingredienteLayout.createSequentialGroup().addGap(95, 95, 95) .addComponent(jLabel3)) .addGroup(jd_eliminar_ingredienteLayout.createSequentialGroup() .addComponent(jLabel4).addGap(18, 18, 18) .addComponent(cb_elimi_ingre, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18).addComponent(btn_eliminar_ingre))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jd_eliminar_ingredienteLayout.setVerticalGroup(jd_eliminar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_eliminar_ingredienteLayout.createSequentialGroup().addContainerGap() .addGroup(jd_eliminar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jd_eliminar_ingredienteLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel4) .addComponent(cb_elimi_ingre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_eliminar_ingre)) .addGroup(jd_eliminar_ingredienteLayout.createSequentialGroup() .addComponent(jLabel3).addGap(38, 38, 38))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jLabel5.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel5.setText("Agregar Productos"); jLabel6.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel6.setText("Nombre:"); jLabel7.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel7.setText("Precio:"); jLabel8.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel8.setText("Tiempo de Preparacion:"); jLabel9.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel9.setText("Lista de Ingredientes:"); txt_nom_prod.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N txt_prec_prod.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N txt_tiempo_prep.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jt_agre_ingre.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jt_agre_ingre.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "", "Ingredientes" }) { Class[] types = new Class[] { java.lang.Boolean.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } }); jScrollPane2.setViewportView(jt_agre_ingre); btn_agregar_prod_a_lista_espera.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_agregar_prod_a_lista_espera.setText("Agregar"); btn_agregar_prod_a_lista_espera.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_agregar_prod_a_lista_esperaMouseClicked(evt); } }); javax.swing.GroupLayout jd_agregar_productoLayout = new javax.swing.GroupLayout( jd_agregar_producto.getContentPane()); jd_agregar_producto.getContentPane().setLayout(jd_agregar_productoLayout); jd_agregar_productoLayout.setHorizontalGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_agregar_productoLayout.createSequentialGroup().addContainerGap() .addGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jd_agregar_productoLayout.createSequentialGroup() .addComponent(jLabel8) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt_tiempo_prep)) .addComponent(jLabel9) .addGroup(jd_agregar_productoLayout.createSequentialGroup() .addGroup(jd_agregar_productoLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel6).addComponent(jLabel7)) .addGap(74, 74, 74) .addGroup(jd_agregar_productoLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jLabel5).addComponent(txt_nom_prod) .addComponent(txt_prec_prod)))) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(13, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_agregar_productoLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_agregar_prod_a_lista_espera, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(156, 156, 156))); jd_agregar_productoLayout.setVerticalGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_agregar_productoLayout.createSequentialGroup().addContainerGap() .addGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jd_agregar_productoLayout.createSequentialGroup().addComponent(jLabel5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6).addComponent(txt_nom_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel7)) .addComponent(txt_prec_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jd_agregar_productoLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel8).addComponent(txt_tiempo_prep, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel9).addGap(18, 18, 18) .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btn_agregar_prod_a_lista_espera) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jLabel12.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel12.setText("Modificar Productos"); jLabel13.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel13.setText("Nombre:"); txt_nom_prod_modif.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N txt_prec_prod_modif.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel14.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel14.setText("Precio:"); jLabel15.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel15.setText("Tiempo de Preparacion:"); txt_tiempo_prep_prod_modif.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel16.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jLabel16.setText("Lista de Ingredientes:"); jt_agre_ingre_modif.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N jt_agre_ingre_modif.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "", "Ingredientes" }) { Class[] types = new Class[] { java.lang.Boolean.class, java.lang.String.class }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } }); jScrollPane3.setViewportView(jt_agre_ingre_modif); btn_modif.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N btn_modif.setText("Aceptar"); cb_modif_prod.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 12)); // NOI18N javax.swing.GroupLayout jd_modif_productosLayout = new javax.swing.GroupLayout( jd_modif_productos.getContentPane()); jd_modif_productos.getContentPane().setLayout(jd_modif_productosLayout); jd_modif_productosLayout.setHorizontalGroup( jd_modif_productosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_modif_productosLayout.createSequentialGroup().addGap(154, 154, 154) .addComponent(jLabel12).addGap(52, 52, 52) .addComponent(cb_modif_prod, 0, 120, Short.MAX_VALUE).addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_modif_productosLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( btn_modif, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_modif_productosLayout.createSequentialGroup().addContainerGap() .addGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_modif_productosLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jd_modif_productosLayout.createSequentialGroup() .addComponent(jLabel15) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(txt_tiempo_prep_prod_modif, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)) .addComponent(jLabel16) .addGroup(jd_modif_productosLayout.createSequentialGroup() .addGroup(jd_modif_productosLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel13) .addComponent(jLabel14)) .addGap(74, 74, 74) .addGroup(jd_modif_productosLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txt_nom_prod_modif) .addComponent(txt_prec_prod_modif, javax.swing.GroupLayout.DEFAULT_SIZE, 125, Short.MAX_VALUE)))) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); jd_modif_productosLayout.setVerticalGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_modif_productosLayout.createSequentialGroup().addContainerGap() .addGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel12).addComponent(cb_modif_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 247, Short.MAX_VALUE) .addComponent(btn_modif).addContainerGap()) .addGroup(jd_modif_productosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_modif_productosLayout.createSequentialGroup().addGap(34, 34, 34) .addGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jd_modif_productosLayout.createSequentialGroup() .addGroup(jd_modif_productosLayout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel13).addComponent(txt_nom_prod_modif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel14)) .addComponent(txt_prec_prod_modif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(jd_modif_productosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel15).addComponent(txt_tiempo_prep_prod_modif, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(jLabel16).addGap(18, 18, 18) .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(43, Short.MAX_VALUE)))); jLabel10.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel10.setText("Eliminar Productos"); jLabel11.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel11.setText("Elija Prodcuto a eliminar:"); cb_eliminar_prod.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_eliminar_productos.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_eliminar_productos.setText("Aceptar"); btn_eliminar_productos.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_eliminar_productosMouseClicked(evt); } }); javax.swing.GroupLayout jd_eliminar_prodLayout = new javax.swing.GroupLayout( jd_eliminar_prod.getContentPane()); jd_eliminar_prod.getContentPane().setLayout(jd_eliminar_prodLayout); jd_eliminar_prodLayout.setHorizontalGroup(jd_eliminar_prodLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_eliminar_prodLayout.createSequentialGroup().addGap(151, 151, 151) .addComponent(jLabel10).addContainerGap(214, Short.MAX_VALUE)) .addGroup(jd_eliminar_prodLayout.createSequentialGroup().addGap(2, 2, 2) .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 202, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(cb_eliminar_prod, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btn_eliminar_productos, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(23, 23, 23))); jd_eliminar_prodLayout.setVerticalGroup(jd_eliminar_prodLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_eliminar_prodLayout.createSequentialGroup().addContainerGap().addComponent(jLabel10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_eliminar_prodLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel11) .addComponent(cb_eliminar_prod, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btn_eliminar_productos)) .addContainerGap(32, Short.MAX_VALUE))); jLabel17.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N jLabel17.setText("Estado del Cocinero"); jLabel18.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N jLabel18.setText("Tiempo"); jLabel19.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N jLabel19.setText("Nombre de la Orden"); lbCocinero1.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N lbCocinero1.setText("Inactivo"); jTextField1.setEnabled(false); lbCocinero2.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N lbCocinero2.setText("Inactivo"); jTextField2.setEnabled(false); lbCocinero3.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N lbCocinero3.setText("Inactivo"); jTextField3.setEnabled(false); lbCocinero4.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N lbCocinero4.setText("Inactivo"); jTextField4.setEnabled(false); lbCocinero5.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N lbCocinero5.setText("Inactivo"); jTextField5.setEnabled(false); jButton1.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 11)); // NOI18N jButton1.setText("Agregar a un cocinero"); jButton1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { jButton1MouseClicked(evt); } }); jLabel20.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 36)); // NOI18N jLabel20.setText("COCINA"); javax.swing.GroupLayout jd_cocinerosLayout = new javax.swing.GroupLayout(jd_cocineros.getContentPane()); jd_cocineros.getContentPane().setLayout(jd_cocinerosLayout); jd_cocinerosLayout.setHorizontalGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup().addContainerGap().addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout .createSequentialGroup().addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 97, Short.MAX_VALUE) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout .createSequentialGroup() .addComponent(lbCocinero3, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout .createSequentialGroup() .addComponent(lbCocinero4, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout .createSequentialGroup() .addComponent(lbCocinero5, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout .createSequentialGroup() .addComponent(lbCocinero2, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addGroup(jd_cocinerosLayout.createSequentialGroup().addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup() .addComponent(cb_lista_productos_cocineros, javax.swing.GroupLayout.PREFERRED_SIZE, 141, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup() .addComponent(lbCocinero1, javax.swing.GroupLayout.PREFERRED_SIZE, 97, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jd_cocinerosLayout.createSequentialGroup() .addComponent(jLabel17).addGap(52, 52, 52) .addComponent(jLabel18)))) .addGroup(jd_cocinerosLayout.createSequentialGroup().addComponent(jLabel20) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup().addGap(32, 32, 32) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jd_cocinerosLayout.createSequentialGroup().addGap(24, 24, 24) .addComponent(jLabel19))))) .addGap(38, 38, 38))); jd_cocinerosLayout.setVerticalGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup().addContainerGap().addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cocinerosLayout.createSequentialGroup().addComponent(jLabel20).addGap(2, 2, 2) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel17).addComponent(jLabel18)) .addGap(12, 12, 12)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cocinerosLayout.createSequentialGroup().addComponent(jLabel19).addGap(18, 18, 18))) .addGroup(jd_cocinerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbCocinero1).addComponent(cb_lista_productos_cocineros, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_cocinerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jProgressBar2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbCocinero2).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_cocinerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jProgressBar3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(jd_cocinerosLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbCocinero3).addComponent(jButton1)) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_cocinerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jProgressBar4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbCocinero4).addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_cocinerosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jProgressBar5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbCocinero5).addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(91, Short.MAX_VALUE))); jt_ordenes_camiones.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jt_ordenes_camiones.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "", "Ordenes" }) { Class[] types = new Class[] { java.lang.Boolean.class, java.lang.Object.class }; boolean[] canEdit = new boolean[] { true, false }; public Class getColumnClass(int columnIndex) { return types[columnIndex]; } public boolean isCellEditable(int rowIndex, int columnIndex) { return canEdit[columnIndex]; } }); jScrollPane1.setViewportView(jt_ordenes_camiones); cb_camiones.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N cb_camiones.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Camion1", "Camion2", "Camion3", "Camion4", "Camion5", "Camion6", "Camion7", "Camion8", "Camion9", "Camion10" })); btn_aceptar_ordenes_camiones.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_aceptar_ordenes_camiones.setText("Aceptar"); btn_aceptar_ordenes_camiones.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_aceptar_ordenes_camionesMouseClicked(evt); } }); jLabel21.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 36)); // NOI18N jLabel21.setText("CARGAR CAMIONES"); javax.swing.GroupLayout jd_camionesLayout = new javax.swing.GroupLayout(jd_camiones.getContentPane()); jd_camiones.getContentPane().setLayout(jd_camionesLayout); jd_camionesLayout.setHorizontalGroup(jd_camionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_camionesLayout.createSequentialGroup() .addGroup(jd_camionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cb_camiones, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jd_camionesLayout.createSequentialGroup().addContainerGap().addComponent( btn_aceptar_ordenes_camiones, javax.swing.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE))) .addGap(18, 18, 18) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 375, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32)) .addGroup(jd_camionesLayout.createSequentialGroup().addGap(97, 97, 97).addComponent(jLabel21) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jd_camionesLayout.setVerticalGroup(jd_camionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_camionesLayout.createSequentialGroup() .addContainerGap().addComponent(jLabel21) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 43, Short.MAX_VALUE) .addGroup(jd_camionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addGroup(jd_camionesLayout.createSequentialGroup() .addComponent(cb_camiones, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btn_aceptar_ordenes_camiones)) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(78, 78, 78))); jLabel22.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 24)); // NOI18N jLabel22.setText("De:"); jLabel23.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 24)); // NOI18N jLabel23.setText("A:"); txt_recorrido_de.setEditable(false); txt_recorrido_de.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N txt_recorrido_a.setEditable(false); txt_recorrido_a.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel24.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 24)); // NOI18N jLabel24.setText("Recorrido:"); ta_pizarra.setEditable(false); ta_pizarra.setColumns(20); ta_pizarra.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N ta_pizarra.setRows(5); jScrollPane4.setViewportView(ta_pizarra); jLabel25.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 36)); // NOI18N jLabel25.setText("Recorrido Dijkstra"); javax.swing.GroupLayout jd_dijsktraLayout = new javax.swing.GroupLayout(jd_dijsktra.getContentPane()); jd_dijsktra.getContentPane().setLayout(jd_dijsktraLayout); jd_dijsktraLayout.setHorizontalGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_dijsktraLayout.createSequentialGroup().addContainerGap().addGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 552, Short.MAX_VALUE) .addGroup(jd_dijsktraLayout.createSequentialGroup().addComponent(jLabel24).addGap(0, 0, Short.MAX_VALUE)) .addGroup(jd_dijsktraLayout.createSequentialGroup() .addGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel22).addComponent(jLabel23)) .addGap(18, 18, 18) .addGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(txt_recorrido_a).addComponent(txt_recorrido_de)))) .addContainerGap()) .addGroup(jd_dijsktraLayout.createSequentialGroup().addGap(90, 90, 90) .addComponent(jLabel25, javax.swing.GroupLayout.PREFERRED_SIZE, 377, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jd_dijsktraLayout.setVerticalGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_dijsktraLayout.createSequentialGroup() .addContainerGap().addComponent(jLabel25) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_dijsktraLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jd_dijsktraLayout.createSequentialGroup() .addGroup(jd_dijsktraLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel22).addComponent(txt_recorrido_de, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(txt_recorrido_a, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel23)) .addGap(16, 16, 16).addComponent(jLabel24) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(32, Short.MAX_VALUE))); cb_de.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N cb_de.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_deItemStateChanged(evt); } }); jLabel26.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel26.setText("De:"); jLabel27.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel27.setText("A:"); cb_a.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N btn_dijkstra.setBackground(new java.awt.Color(204, 204, 255)); btn_dijkstra.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N btn_dijkstra.setText("Encontrar camino mas corto"); btn_dijkstra.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_dijkstraActionPerformed(evt); } }); jLabel32.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel32.setText("DIJKSTRA"); javax.swing.GroupLayout jd_de_donde_a_dondeLayout = new javax.swing.GroupLayout( jd_de_donde_a_donde.getContentPane()); jd_de_donde_a_donde.getContentPane().setLayout(jd_de_donde_a_dondeLayout); jd_de_donde_a_dondeLayout.setHorizontalGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_de_donde_a_dondeLayout.createSequentialGroup().addGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_de_donde_a_dondeLayout.createSequentialGroup().addGap(157, 157, 157) .addComponent(jLabel32)) .addGroup(jd_de_donde_a_dondeLayout.createSequentialGroup().addContainerGap() .addGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel27).addComponent(jLabel26)) .addGap(18, 18, 18) .addGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(cb_a, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(cb_de, javax.swing.GroupLayout.PREFERRED_SIZE, 229, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_de_donde_a_dondeLayout.createSequentialGroup().addGap(0, 22, Short.MAX_VALUE) .addComponent(btn_dijkstra).addContainerGap(31, Short.MAX_VALUE))); jd_de_donde_a_dondeLayout.setVerticalGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_de_donde_a_dondeLayout .createSequentialGroup().addContainerGap().addComponent(jLabel32) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cb_de, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel26)) .addGap(18, 18, 18) .addGroup(jd_de_donde_a_dondeLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel27).addComponent(cb_a, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(btn_dijkstra, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(31, Short.MAX_VALUE))); btn_agregar_relaciones.setBackground(new java.awt.Color(204, 204, 255)); btn_agregar_relaciones.setFont(new java.awt.Font("Arial Rounded MT Bold", 0, 18)); // NOI18N btn_agregar_relaciones.setText("Add"); btn_agregar_relaciones.setOpaque(false); btn_agregar_relaciones.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_agregar_relacionesActionPerformed(evt); } }); jLabel28.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel28.setText("Peso:"); js_nivel.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N js_nivel.setValue(1); cb_a_relacion.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N jLabel29.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel29.setText("A:"); jLabel30.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel30.setText("De:"); cb_de_relacion.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N cb_de_relacion.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(java.awt.event.ItemEvent evt) { cb_de_relacionItemStateChanged(evt); } }); jLabel31.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 18)); // NOI18N jLabel31.setText("Agregar una Relacion"); javax.swing.GroupLayout jd_crear_relacionesLayout = new javax.swing.GroupLayout( jd_crear_relaciones.getContentPane()); jd_crear_relaciones.getContentPane().setLayout(jd_crear_relacionesLayout); jd_crear_relacionesLayout.setHorizontalGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_crear_relacionesLayout.createSequentialGroup().addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_crear_relacionesLayout.createSequentialGroup().addGap(87, 87, 87) .addComponent(jLabel31)) .addGroup(jd_crear_relacionesLayout.createSequentialGroup().addGap(141, 141, 141) .addComponent(btn_agregar_relaciones, javax.swing.GroupLayout.PREFERRED_SIZE, 109, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(jd_crear_relacionesLayout.createSequentialGroup().addComponent(jLabel28) .addGap(29, 29, 29) .addComponent(js_nivel, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(117, 117, 117)) .addGroup(jd_crear_relacionesLayout.createSequentialGroup() .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel30).addComponent(jLabel29)) .addGap(27, 27, 27) .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(cb_a_relacion, javax.swing.GroupLayout.PREFERRED_SIZE, 303, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(cb_de_relacion, javax.swing.GroupLayout.PREFERRED_SIZE, 303, javax.swing.GroupLayout.PREFERRED_SIZE))))) .addContainerGap(30, Short.MAX_VALUE))); jd_crear_relacionesLayout.setVerticalGroup( jd_crear_relacionesLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_crear_relacionesLayout.createSequentialGroup().addGap(18, 18, 18) .addComponent(jLabel31) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cb_de_relacion, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel30, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(14, 14, 14) .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(cb_a_relacion, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel29, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(18, 18, 18) .addGroup(jd_crear_relacionesLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel28) .addComponent(js_nivel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addComponent(btn_agregar_relaciones, javax.swing.GroupLayout.PREFERRED_SIZE, 44, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); jLabel33.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 24)); // NOI18N jLabel33.setText("Caja"); jLabel34.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel34.setText("Total Vendido:"); jLabel35.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel35.setText("Total Impuesto:"); jLabel35.setToolTipText(""); jLabel36.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel36.setText("TOTAL:"); txt_total_ventas.setEditable(false); txt_total_ventas.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N txt_total_impuesto.setEditable(false); txt_total_impuesto.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N txt_total.setEditable(false); txt_total.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_cerrar_caja.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N btn_cerrar_caja.setText("Cerrar Caja"); btn_cerrar_caja.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { btn_cerrar_cajaMouseClicked(evt); } }); jLabel37.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jLabel37.setText("Total Ordenes Vendidas:"); txt_ordenes_vendidas.setEditable(false); txt_ordenes_vendidas.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jl_dia.setFont(new java.awt.Font("Arial Rounded MT Bold", 3, 14)); // NOI18N jl_dia.setText("jLabel38"); javax.swing.GroupLayout jd_cajaLayout = new javax.swing.GroupLayout(jd_caja.getContentPane()); jd_caja.getContentPane().setLayout(jd_cajaLayout); jd_cajaLayout.setHorizontalGroup( jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, jd_cajaLayout .createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( btn_cerrar_caja, javax.swing.GroupLayout.PREFERRED_SIZE, 145, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(76, 76, 76)) .addGroup(jd_cajaLayout.createSequentialGroup().addContainerGap().addGroup(jd_cajaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cajaLayout.createSequentialGroup() .addGroup(jd_cajaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel34).addComponent(jLabel35) .addComponent(jLabel36)) .addGap(29, 29, 29) .addGroup(jd_cajaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(txt_total_ventas, javax.swing.GroupLayout.DEFAULT_SIZE, 160, Short.MAX_VALUE) .addComponent(txt_total_impuesto).addComponent(txt_total)) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(jd_cajaLayout.createSequentialGroup().addComponent(jLabel37) .addGap(29, 29, 29).addComponent(txt_ordenes_vendidas, javax.swing.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE))) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jd_cajaLayout.createSequentialGroup().addGap(0, 0, Short.MAX_VALUE) .addGroup(jd_cajaLayout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jl_dia, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel33, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(119, 119, 119))); jd_cajaLayout.setVerticalGroup(jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jd_cajaLayout.createSequentialGroup().addContainerGap().addComponent(jLabel33) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jl_dia) .addGap(19, 19, 19) .addGroup(jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel37).addComponent(txt_ordenes_vendidas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 11, Short.MAX_VALUE) .addGroup(jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel34).addComponent(txt_total_ventas, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(22, 22, 22) .addGroup(jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel35).addComponent(txt_total_impuesto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(23, 23, 23) .addGroup(jd_cajaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel36).addComponent(txt_total, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18).addComponent(btn_cerrar_caja, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setIconImages(null); jLabel38.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel38.setIcon(new javax.swing.ImageIcon(getClass().getResource("/proyecto4/images.jpg"))); // NOI18N javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout .setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addGap(20, 20, 20) .addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, 561, Short.MAX_VALUE) .addGap(66, 66, 66))); jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup().addContainerGap() .addComponent(jLabel38, javax.swing.GroupLayout.DEFAULT_SIZE, 163, Short.MAX_VALUE) .addGap(277, 277, 277))); jMenu1.setText("Ingredientes"); jMenuItem1.setText("Agregar Ingrediente"); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuItem2.setText("Eliminar Ingrediente"); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu1.add(jMenuItem2); jMenuBar1.add(jMenu1); jMenu2.setText("Productos o Ordenes"); jMenuItem3.setText("Agregar"); jMenuItem3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem3ActionPerformed(evt); } }); jMenu2.add(jMenuItem3); jMenuItem4.setText("Modificar"); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem4ActionPerformed(evt); } }); jMenu2.add(jMenuItem4); jCheckBoxMenuItem1.setText("Eliminar"); jCheckBoxMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jCheckBoxMenuItem1ActionPerformed(evt); } }); jMenu2.add(jCheckBoxMenuItem1); jMenuBar1.add(jMenu2); jMenu6.setText("Cocineros"); jMenuItem6.setText("Cocinar"); jMenuItem6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem6ActionPerformed(evt); } }); jMenu6.add(jMenuItem6); jMenuBar1.add(jMenu6); jMenu5.setText("Camion"); jMenuItem7.setText("Cargar Camion"); jMenuItem7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem7ActionPerformed(evt); } }); jMenu5.add(jMenuItem7); jMenuBar1.add(jMenu5); jMenu4.setText("Mapa"); jMenuItem9.setText("Crear Relaciones"); jMenuItem9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem9ActionPerformed(evt); } }); jMenu4.add(jMenuItem9); jMenuItem5.setText("Ver Mapa"); jMenuItem5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem5ActionPerformed(evt); } }); jMenu4.add(jMenuItem5); jMenuItem8.setText("Dijsktra"); jMenuItem8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem8ActionPerformed(evt); } }); jMenu4.add(jMenuItem8); jMenuBar1.add(jMenu4); jMenu3.setText("Cerrar Caja"); jMenu3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenu3ActionPerformed(evt); } }); jMenuItem10.setText("Ver "); jMenuItem10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem10ActionPerformed(evt); } }); jMenu3.add(jMenuItem10); jMenuBar1.add(jMenu3); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addContainerGap())); layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap())); pack(); }// </editor-fold>//GEN-END:initComponents private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed // TODO add your handling code here: jd_agregar_ingrediente.setModal(true); jd_agregar_ingrediente.pack(); jd_agregar_ingrediente.setVisible(true); }//GEN-LAST:event_jMenuItem1ActionPerformed private void btn_agregar_ingredienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_agregar_ingredienteMouseClicked // TODO add your handling code here: try { String nom_ingrediente = txt_nom_ingre.getText(); lista_ingredientes.add(new Ingredientes(nom_ingrediente)); txt_nom_ingre.setText(""); JOptionPane.showMessageDialog(this, "Ingrediente agregado"); } catch (Exception e) { JOptionPane.showMessageDialog(this, "No ah sido agregado"); } }//GEN-LAST:event_btn_agregar_ingredienteMouseClicked private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed // TODO add your handling code here: DefaultComboBoxModel modelo = new DefaultComboBoxModel(); for (int i = 0; i < lista_ingredientes.size(); i++) { modelo.addElement(lista_ingredientes.get(i).toString()); } cb_elimi_ingre.setModel(modelo); jd_eliminar_ingrediente.setModal(true); jd_eliminar_ingrediente.pack(); jd_eliminar_ingrediente.setVisible(true); }//GEN-LAST:event_jMenuItem2ActionPerformed private void btn_eliminar_ingreMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_eliminar_ingreMouseClicked // TODO add your handling code here: //System.out.println(lista_ingredientes.toString()); try { int elim = cb_elimi_ingre.getSelectedIndex(); lista_ingredientes.remove(elim); cb_elimi_ingre.removeItem(elim); DefaultComboBoxModel modelo = new DefaultComboBoxModel(); for (int i = 0; i < lista_ingredientes.size(); i++) { modelo.addElement(lista_ingredientes.get(i).toString()); } cb_elimi_ingre.setModel(modelo); JOptionPane.showMessageDialog(this, "Ingrediente eliminado"); } catch (Exception e) { JOptionPane.showMessageDialog(this, "Ingrediente no ah sido eliminado"); } //System.out.println(lista_ingredientes.toString()); }//GEN-LAST:event_btn_eliminar_ingreMouseClicked private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem4ActionPerformed // TODO add your handling code here: DefaultComboBoxModel modelo = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_modif_prod.setModel(modelo); jd_modif_productos.setModal(true); jd_modif_productos.pack(); jd_modif_productos.setVisible(true); }//GEN-LAST:event_jMenuItem4ActionPerformed private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed // TODO add your handling code here: DefaultTableModel modelo1 = (DefaultTableModel) jt_agre_ingre.getModel(); for (int i = 0; i < modelo1.getRowCount(); i++) { modelo1.removeRow(i); } for (int i = 0; i < lista_ingredientes.size(); i++) { modelo1.addRow(new Object[] { false, lista_ingredientes.get(i).toString() }); } jd_agregar_producto.setModal(true); jd_agregar_producto.pack(); jd_agregar_producto.setVisible(true); }//GEN-LAST:event_jMenuItem3ActionPerformed private void btn_agregar_prod_a_lista_esperaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_agregar_prod_a_lista_esperaMouseClicked // TODO add your handling code here: try { System.out.println(lista_ingredientes.toString()); String nom = txt_nom_prod.getText(); int time = Integer.parseInt(txt_tiempo_prep.getText()); double precio = Double.parseDouble(txt_prec_prod.getText()); DefaultTableModel modelo = (DefaultTableModel) jt_agre_ingre.getModel(); ArrayList temp = new ArrayList(); for (int i = 0; i < modelo.getRowCount(); i++) { temp.add((jt_agre_ingre.getValueAt(i, 1).toString())); } lista_ordenes_espera.add(new Producto_O_Orden(nom, precio, time, temp)); JOptionPane.showMessageDialog(this, "Producto ah sido agregado"); for (int i = 0; i < lista_ordenes_espera.size(); i++) { for (int j = 0; j < lista_ingredientes.size(); j++) { if (lista_ordenes_espera.get(i).getLista().toString() .contains(lista_ingredientes.get(j).getNombre())) { lista_ingredientes.remove(lista_ingredientes.get(j)); } } } DefaultTableModel modelo1 = (DefaultTableModel) jt_agre_ingre.getModel(); for (int i = 0; i < modelo1.getRowCount(); i++) { modelo1.removeRow(i); } System.out.println(lista_ingredientes.toString()); txt_nom_prod.setText(""); txt_prec_prod.setText(""); txt_tiempo_prep.setText(""); } catch (Exception e) { JOptionPane.showMessageDialog(this, "No ah sido agregado"); } }//GEN-LAST:event_btn_agregar_prod_a_lista_esperaMouseClicked private void jCheckBoxMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckBoxMenuItem1ActionPerformed // TODO add your handling code here: DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_eliminar_prod.setModel(modelo1); jd_eliminar_prod.setModal(true); jd_eliminar_prod.pack(); jd_eliminar_prod.setVisible(true); }//GEN-LAST:event_jCheckBoxMenuItem1ActionPerformed private void btn_eliminar_productosMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_eliminar_productosMouseClicked // TODO add your handling code here: try { int elim = cb_eliminar_prod.getSelectedIndex(); lista_ordenes_espera.remove(elim); cb_eliminar_prod.removeItem(elim); DefaultComboBoxModel modelo = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_eliminar_prod.setModel(modelo); JOptionPane.showMessageDialog(this, "Producto ah sido agregado"); } catch (Exception e) { JOptionPane.showMessageDialog(this, "No ah sido eliminado"); } }//GEN-LAST:event_btn_eliminar_productosMouseClicked private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem5ActionPerformed // TODO add your handling code here: for (int i = 0; i < lista_lugares.size(); i++) { grafo.addVertex(lista_lugares.get(i)); } for (int i = 0; i < lista_lugares.size(); i++) { for (int j = 0; j < lista_lugares.get(i).vecinos.size(); j++) { grafo.addEdge(lista_lugares.get(i).vecinos.get(j).getWeight(), lista_lugares.get(i), lista_lugares.get(i).vecinos.get(j).getLugar(), EdgeType.DIRECTED); } } for (int i = 0; i < lista_lugares.size(); i++) { grafo1.addVertex(lista_lugares.get(i)); } for (int i = 0; i < lista_lugares.size(); i++) { for (int j = 0; j < lista_lugares.get(i).vecinos.size(); j++) { grafo1.addEdge(lista_lugares.get(i).vecinos.get(j).getPeso(), lista_lugares.get(i), lista_lugares.get(i).vecinos.get(j).getLugar(), EdgeType.DIRECTED); } } this.rootPane = null; this.setLocationRelativeTo(this.rootPane); setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); Layout<String, String> layout = new FRLayout(grafo); layout.setSize(new Dimension(this.getWidth(), this.getHeight())); BasicVisualizationServer<String, String> visualization = new BasicVisualizationServer<>(layout); visualization.setPreferredSize(new Dimension(this.getWidth(), this.getHeight())); visualization.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); visualization.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller()); visualization.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); JFrame frame = new JFrame("Lugares de Salmans"); frame.getContentPane().add(visualization).setBackground(jPanel2.getBackground()); frame.pack(); frame.setVisible(true); }//GEN-LAST:event_jMenuItem5ActionPerformed private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem6ActionPerformed // TODO add your handling code here: DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); jd_cocineros.setModal(true); jd_cocineros.pack(); jd_cocineros.setVisible(true); }//GEN-LAST:event_jMenuItem6ActionPerformed private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked // TODO add your handling code here: int escojio = cb_lista_productos_cocineros.getSelectedIndex(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { if (i == escojio) { lista_ordenes_cocineros .add(new Producto_O_Orden(lista_ordenes_espera.get(escojio).getNombre().toString(), lista_ordenes_espera.get(escojio).getPrecio(), lista_ordenes_espera.get(escojio).getTiempo(), lista_ordenes_espera.get(escojio).getLista())); } } if (lbCocinero1.getText().contentEquals("Inactivo")) { lbCocinero1.setText("Activo"); int tiempo_prep = lista_ordenes_cocineros.get(0).getTiempo(); String nom = lista_ordenes_cocineros.get(0).getNombre(); jTextField1.setText(nom); total_vendido += lista_ordenes_cocineros.get(0).getPrecio(); numero_de_ordenes += 1; AdministrarBarra ab = new AdministrarBarra(jProgressBar1, tiempo_prep, lbCocinero1, nom, jTextField1); ab.start(); lista_ordenes_espera.remove(escojio); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); } else if (lbCocinero2.getText().contentEquals("Inactivo")) { lbCocinero2.setText("Activo"); int tiempo_prep = lista_ordenes_cocineros.get(1).getTiempo(); String nom = lista_ordenes_cocineros.get(1).getNombre(); jTextField2.setText(nom); total_vendido += lista_ordenes_cocineros.get(1).getPrecio(); numero_de_ordenes += 1; AdministrarBarra ab = new AdministrarBarra(jProgressBar2, tiempo_prep, lbCocinero2, nom, jTextField2); ab.start(); lista_ordenes_espera.remove(escojio); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); } else if (lbCocinero3.getText().contentEquals("Inactivo")) { lbCocinero3.setText("Activo"); int tiempo_prep = lista_ordenes_cocineros.get(2).getTiempo(); String nom = lista_ordenes_cocineros.get(2).getNombre(); jTextField3.setText(nom); total_vendido += lista_ordenes_cocineros.get(2).getPrecio(); numero_de_ordenes += 1; AdministrarBarra ab = new AdministrarBarra(jProgressBar3, tiempo_prep, lbCocinero3, nom, jTextField3); ab.start(); lista_ordenes_espera.remove(escojio); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); } else if (lbCocinero4.getText().contentEquals("Inactivo")) { lbCocinero4.setText("Activo"); int tiempo_prep = lista_ordenes_cocineros.get(3).getTiempo(); String nom = lista_ordenes_cocineros.get(3).getNombre(); jTextField4.setText(nom); total_vendido += lista_ordenes_cocineros.get(3).getPrecio(); numero_de_ordenes += 1; AdministrarBarra ab = new AdministrarBarra(jProgressBar4, tiempo_prep, lbCocinero4, nom, jTextField4); ab.start(); lista_ordenes_espera.remove(escojio); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); } else if (lbCocinero5.getText().contentEquals("Inactivo")) { lbCocinero5.setText("Activo"); int tiempo_prep = lista_ordenes_cocineros.get(4).getTiempo(); String nom = lista_ordenes_cocineros.get(4).getNombre(); jTextField5.setText(nom); total_vendido += lista_ordenes_cocineros.get(4).getPrecio(); numero_de_ordenes += 1; AdministrarBarra ab = new AdministrarBarra(jProgressBar5, tiempo_prep, lbCocinero5, nom, jTextField5); ab.start(); lista_ordenes_espera.remove(escojio); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_ordenes_espera.size(); i++) { modelo1.addElement(lista_ordenes_espera.get(i).getNombre().toString()); } cb_lista_productos_cocineros.setModel(modelo1); } else { JOptionPane.showMessageDialog(this, "TODOS COCINEROS OCUPADOS,espere que uno termine"); } }//GEN-LAST:event_jButton1MouseClicked private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem7ActionPerformed // TODO add your handling code here: DefaultTableModel modelo1 = (DefaultTableModel) jt_ordenes_camiones.getModel(); for (int i = 0; i < modelo1.getRowCount(); i++) { modelo1.removeRow(i); } for (int i = 0; i < lista_ordenes_cocineros.size(); i++) { modelo1.addRow(new Object[] { false, lista_ordenes_cocineros.get(i).getNombre().toString() }); } jd_camiones.setModal(true); jd_camiones.pack(); jd_camiones.setVisible(true); }//GEN-LAST:event_jMenuItem7ActionPerformed private void btn_aceptar_ordenes_camionesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_aceptar_ordenes_camionesMouseClicked // TODO add your handling code here: String camion = (String) cb_camiones.getSelectedItem(); ArrayList temp = new ArrayList(9); DefaultTableModel modelo = (DefaultTableModel) jt_ordenes_camiones.getModel(); for (int i = 0; i < modelo.getRowCount(); i++) { for (int j = 0; j < temp.size(); j++) { if (temp.size() <= 9) { System.out.println(j); if (jt_ordenes_camiones.getValueAt(i, 0).equals(true)) { System.out.println("valida si el coso es true y agrega"); temp.add((jt_ordenes_camiones.getValueAt(i, 1).toString())); } } else { JOptionPane.showMessageDialog(this, "Camion full, elija otro"); } } } lista_camiones.add(new Camion(camion, temp)); System.out.println(lista_camiones.toString()); temp = new ArrayList(9); }//GEN-LAST:event_btn_aceptar_ordenes_camionesMouseClicked private void jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem8ActionPerformed // TODO add your handling code here: DefaultComboBoxModel modelo = new DefaultComboBoxModel(); for (int i = 0; i < lista_lugares.size(); i++) { modelo.addElement(lista_lugares.get(i).getNombre()); } cb_de.setModel(modelo); DefaultComboBoxModel modelo1 = new DefaultComboBoxModel(); for (int i = 0; i < lista_lugares.size(); i++) { modelo1.addElement(lista_lugares.get(i).getNombre()); } cb_a.setModel(modelo1); jd_de_donde_a_donde.setModal(true); jd_de_donde_a_donde.pack(); jd_de_donde_a_donde.setVisible(true); }//GEN-LAST:event_jMenuItem8ActionPerformed private void cb_deItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_deItemStateChanged cb_a.removeAllItems(); for (int i = 0; i < lista_lugares.size(); i++) { if (cb_de.getSelectedItem().toString().equals(lista_lugares.get(i).getNombre())) { } else { cb_a.addItem(lista_lugares.get(i).toString()); } } }//GEN-LAST:event_cb_deItemStateChanged private void btn_dijkstraActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_dijkstraActionPerformed txt_recorrido_de.setText(""); txt_recorrido_a.setText(""); ta_pizarra.setText(""); Transformer<Relacion, Integer> wtTransformer = new Transformer<Relacion, Integer>() { public Integer transform(Relacion union) { return union.getLevel(); } }; DijkstraShortestPath<Lugar, Relacion> alg = new DijkstraShortestPath(grafo1, wtTransformer); Lugar to = new Lugar(); for (int i = 0; i < lista_lugares.size(); i++) { if (cb_a.getSelectedItem().toString().equals(lista_lugares.get(i).nombre)) { to = lista_lugares.get(i); break; } } List lista = alg.getPath(lista_lugares.get(cb_de.getSelectedIndex()), to); txt_recorrido_de.setText(lista_lugares.get(cb_de.getSelectedIndex()).toString()); txt_recorrido_a.setText(to.toString()); ta_pizarra.setText(lista.toString()); jd_dijsktra.setModal(true); jd_dijsktra.pack(); jd_dijsktra.setVisible(true); for (int i = 0; i < lista_lugares.size(); i++) { grafo.addVertex(lista_lugares.get(i)); } for (int i = 0; i < lista_lugares.size(); i++) { for (int j = 0; j < lista_lugares.get(i).vecinos.size(); j++) { grafo.addEdge(lista_lugares.get(i).vecinos.get(j).getWeight(), lista_lugares.get(i), lista_lugares.get(i).vecinos.get(j).getLugar(), EdgeType.DIRECTED); } } for (int i = 0; i < lista_lugares.size(); i++) { grafo1.addVertex(lista_lugares.get(i)); } for (int i = 0; i < lista_lugares.size(); i++) { for (int j = 0; j < lista_lugares.get(i).vecinos.size(); j++) { grafo1.addEdge(lista_lugares.get(i).vecinos.get(j).getPeso(), lista_lugares.get(i), lista_lugares.get(i).vecinos.get(j).getLugar(), EdgeType.DIRECTED); } } this.rootPane = null; this.setLocationRelativeTo(this.rootPane); setExtendedState(java.awt.Frame.MAXIMIZED_BOTH); Layout<String, String> layout = new FRLayout(grafo); layout.setSize(new Dimension(this.getWidth(), this.getHeight())); BasicVisualizationServer<String, String> visualization = new BasicVisualizationServer<>(layout); visualization.setPreferredSize(new Dimension(this.getWidth(), this.getHeight())); visualization.getRenderContext().setVertexLabelTransformer(new ToStringLabeller()); visualization.getRenderContext().setEdgeLabelTransformer(new ToStringLabeller()); visualization.getRenderer().getVertexLabelRenderer().setPosition(Renderer.VertexLabel.Position.CNTR); JFrame frame = new JFrame("Lugares de Salmans"); frame.getContentPane().add(visualization).setBackground(jPanel2.getBackground()); frame.pack(); frame.setVisible(true); }//GEN-LAST:event_btn_dijkstraActionPerformed private void btn_agregar_relacionesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_agregar_relacionesActionPerformed try { Lugar de = lista_lugares.get(cb_de_relacion.getSelectedIndex()); Lugar a = lista_vecinos.get(cb_a_relacion.getSelectedIndex()); int weight = (Integer) js_nivel.getValue(); Relacion_a_vecino level = new Relacion_a_vecino(weight, a); Relacion nivel = new Relacion(weight, a); de.vecinos.add(new Vecinos(a, level)); JOptionPane.showMessageDialog(this.getFrames()[0], a.nombre + " es ahora vecino de " + de); js_nivel.setValue(1); grafo.addEdge(level, de, a, EdgeType.DIRECTED); grafo1.addEdge(nivel, de, a, EdgeType.DIRECTED); cb_a_relacion.removeAllItems(); lista_vecinos.clear(); for (int i = 0; i < lista_lugares.size(); i++) { if (cb_de_relacion.getSelectedItem().toString().equals(lista_lugares.get(i).nombre)) { } else { boolean vecinos = false; for (int j = 0; j < lista_lugares.get(cb_de_relacion.getSelectedIndex()).vecinos.size(); j++) { vecinos = false; if (lista_lugares.get(cb_de_relacion.getSelectedIndex()).vecinos.get(j).lugar.nombre .equals(lista_lugares.get(i).nombre)) { vecinos = true; break; } } if (vecinos == false) { cb_a_relacion.addItem(lista_lugares.get(i)); lista_vecinos.add(lista_lugares.get(i)); } } } } catch (Exception e) { e.printStackTrace(); } }//GEN-LAST:event_btn_agregar_relacionesActionPerformed private void cb_de_relacionItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cb_de_relacionItemStateChanged cb_a_relacion.removeAllItems(); lista_vecinos.clear(); for (int i = 0; i < lista_lugares.size(); i++) { if (cb_de_relacion.getSelectedItem().toString().equals(lista_lugares.get(i).getNombre())) { continue; } else { boolean vecinos = false; for (int j = 0; j < lista_lugares.get(cb_de_relacion.getSelectedIndex()).vecinos.size(); j++) { vecinos = false; if (lista_lugares.get(cb_de_relacion.getSelectedIndex()).vecinos.get(j).lugar.getNombre() .equals(lista_lugares.get(i).getNombre())) { vecinos = true; break; } } if (vecinos == false) { cb_a_relacion.addItem(lista_lugares.get(i)); lista_vecinos.add(lista_lugares.get(i)); } } } }//GEN-LAST:event_cb_de_relacionItemStateChanged private void jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem9ActionPerformed // TODO add your handling code here: for (int i = 0; i < lista_lugares.size(); i++) { cb_de_relacion.addItem(lista_lugares.get(i).toString()); } jd_crear_relaciones.setModal(true); jd_crear_relaciones.pack(); jd_crear_relaciones.setVisible(true); }//GEN-LAST:event_jMenuItem9ActionPerformed private void btn_cerrar_cajaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btn_cerrar_cajaMouseClicked // TODO add your handling code here: JOptionPane.showMessageDialog(this, "CAJA CERRADA POR HOY"); dia += 1; jl_dia.setText(Integer.toString(dia)); txt_ordenes_vendidas.setText(""); txt_total_ventas.setText(""); txt_total_impuesto.setText(""); txt_total.setText(""); numero_de_ordenes = 0; total_vendido = 0; }//GEN-LAST:event_btn_cerrar_cajaMouseClicked private void jMenu3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenu3ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jMenu3ActionPerformed private void jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem10ActionPerformed // TODO add your handling code here: txt_ordenes_vendidas.setText(Integer.toString(numero_de_ordenes)); txt_total_ventas.setText(Double.toString(total_vendido)); double imp = total_vendido * 0.15; txt_total_impuesto.setText(Double.toString(imp)); double total = total_vendido + imp; txt_total.setText(Double.toString(total)); jl_dia.setText(Integer.toString(dia)); jd_caja.setModal(true); jd_caja.pack(); jd_caja.setVisible(true); }//GEN-LAST:event_jMenuItem10ActionPerformed /** * @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(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Principal().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btn_aceptar_ordenes_camiones; private javax.swing.JButton btn_agregar_ingrediente; private javax.swing.JButton btn_agregar_prod_a_lista_espera; private javax.swing.JButton btn_agregar_relaciones; private javax.swing.JButton btn_cerrar_caja; private javax.swing.JButton btn_dijkstra; private javax.swing.JButton btn_eliminar_ingre; private javax.swing.JButton btn_eliminar_productos; private javax.swing.JButton btn_modif; private javax.swing.JComboBox cb_a; private javax.swing.JComboBox cb_a_relacion; private javax.swing.JComboBox cb_camiones; private javax.swing.JComboBox cb_de; private javax.swing.JComboBox cb_de_relacion; private javax.swing.JComboBox cb_elimi_ingre; private javax.swing.JComboBox cb_eliminar_prod; private javax.swing.JComboBox cb_lista_productos_cocineros; private javax.swing.JComboBox cb_modif_prod; private javax.swing.JButton jButton1; private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem1; 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 jLabel19; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel20; private javax.swing.JLabel jLabel21; private javax.swing.JLabel jLabel22; private javax.swing.JLabel jLabel23; private javax.swing.JLabel jLabel24; private javax.swing.JLabel jLabel25; private javax.swing.JLabel jLabel26; private javax.swing.JLabel jLabel27; private javax.swing.JLabel jLabel28; private javax.swing.JLabel jLabel29; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel30; private javax.swing.JLabel jLabel31; private javax.swing.JLabel jLabel32; private javax.swing.JLabel jLabel33; private javax.swing.JLabel jLabel34; private javax.swing.JLabel jLabel35; private javax.swing.JLabel jLabel36; private javax.swing.JLabel jLabel37; private javax.swing.JLabel jLabel38; private javax.swing.JLabel 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.JMenu jMenu1; private javax.swing.JMenu jMenu2; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenu jMenu5; private javax.swing.JMenu jMenu6; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem10; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JMenuItem jMenuItem5; private javax.swing.JMenuItem jMenuItem6; private javax.swing.JMenuItem jMenuItem7; private javax.swing.JMenuItem jMenuItem8; private javax.swing.JMenuItem jMenuItem9; private javax.swing.JPanel jPanel2; private javax.swing.JProgressBar jProgressBar1; private javax.swing.JProgressBar jProgressBar2; private javax.swing.JProgressBar jProgressBar3; private javax.swing.JProgressBar jProgressBar4; private javax.swing.JProgressBar jProgressBar5; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JScrollPane jScrollPane2; private javax.swing.JScrollPane jScrollPane3; private javax.swing.JScrollPane jScrollPane4; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; private javax.swing.JDialog jd_agregar_ingrediente; private javax.swing.JDialog jd_agregar_producto; private javax.swing.JDialog jd_caja; private javax.swing.JDialog jd_camiones; private javax.swing.JDialog jd_cocineros; private javax.swing.JDialog jd_crear_relaciones; private javax.swing.JDialog jd_de_donde_a_donde; private javax.swing.JDialog jd_dijsktra; private javax.swing.JDialog jd_eliminar_ingrediente; private javax.swing.JDialog jd_eliminar_prod; private javax.swing.JDialog jd_modif_productos; private javax.swing.JLabel jl_dia; private javax.swing.JSpinner js_nivel; private javax.swing.JTable jt_agre_ingre; private javax.swing.JTable jt_agre_ingre_modif; private javax.swing.JTable jt_ordenes_camiones; private javax.swing.JLabel lbCocinero1; private javax.swing.JLabel lbCocinero2; private javax.swing.JLabel lbCocinero3; private javax.swing.JLabel lbCocinero4; private javax.swing.JLabel lbCocinero5; private javax.swing.JTextArea ta_pizarra; private javax.swing.JTextField txt_nom_ingre; private javax.swing.JTextField txt_nom_prod; private javax.swing.JTextField txt_nom_prod_modif; private javax.swing.JTextField txt_ordenes_vendidas; private javax.swing.JTextField txt_prec_prod; private javax.swing.JTextField txt_prec_prod_modif; private javax.swing.JTextField txt_recorrido_a; private javax.swing.JTextField txt_recorrido_de; private javax.swing.JTextField txt_tiempo_prep; private javax.swing.JTextField txt_tiempo_prep_prod_modif; private javax.swing.JTextField txt_total; private javax.swing.JTextField txt_total_impuesto; private javax.swing.JTextField txt_total_ventas; // End of variables declaration//GEN-END:variables SparseMultigraph<Lugar, Relacion_a_vecino> grafo = new SparseMultigraph<Lugar, Relacion_a_vecino>(); SparseMultigraph<Lugar, Relacion> grafo1 = new SparseMultigraph<Lugar, Relacion>(); ArrayList<Ingredientes> lista_ingredientes = new ArrayList(); ArrayList<Producto_O_Orden> lista_ordenes_espera = new ArrayList(); ArrayList<Producto_O_Orden> lista_ordenes_cocineros = new ArrayList(); ArrayList<Camion> lista_camiones = new ArrayList(); ArrayList<Lugar> lista_lugares = new ArrayList(); ArrayList<Lugar> lista_vecinos = new ArrayList(); }