Esempio n. 1
0
 private void llenarCombo() throws Exception {
   bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
   produccionBBSector1 = new shrimp.produccion.beanbinding.ProduccionBBSector();
   eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listaPrdListaSectorTO}");
   org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
       org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
           org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
           produccionBBSector1,
           eLProperty,
           jcboCP);
   bindingGroup.addBinding(jComboBoxBinding);
   this.bindingGroup.bind();
   this.produccionBBSector1.setPrdListaSectorTO(
       shrimp.produccion.delegate.ProduccionDelegate.getInstance()
           .getListaSectorTO(sisUsuarioEmpresaTO.getEmpCodigo(), false));
   this.bindingGroup.bind();
   this.jcboCP.updateUI();
   this.jcboCP.setSelectedIndex(0);
   codigoSector =
       "'"
           + produccionBBSector1
               .getListaPrdListaSectorTO()
               .get(jcboCP.getSelectedIndex())
               .getSecCodigo()
           + "'";
   jcboCP.requestFocus();
 }
Esempio n. 2
0
  private void jbtnReconstruirActualizarActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
    try {
      eventoKeyPressPadre();
      this.accion = "AMBOS";
      manejoControlesBotones(false);
      desde =
          jftfDesde.getValue() == null
              ? null
              : "'"
                  + validaciones.Validacion.fecha(jftfDesde.getText(), "dd-MM-yyyy", "yyyy-MM-dd")
                  + "'";
      hasta =
          jftfHasta.getValue() == null
              ? null
              : "'"
                  + validaciones.Validacion.fecha(jftfHasta.getText(), "dd-MM-yyyy", "yyyy-MM-dd")
                  + "'";
      this.jbtnActualizar.setEnabled(false);
      // hilo.init(this, bbResumenCorrida1, empresa, codigoSector, desde, hasta, tipoResumen);
      // hilo.start();
      Long tiempoInicio = System.currentTimeMillis();
      bbResumenCorrida1.setPrdListaResumenCorridaTO(
          ProduccionDelegate.getInstance()
              .getListaResumenCorridaTO(empresa, codigoSector, desde, hasta, tipoResumen));
      llenarjTable();
      long tiempoTotal = System.currentTimeMillis() - tiempoInicio;
      lbTimeEjecucion.setText(
          "Filas: "
              + jtable.getRowCount()
              + "  Tiempo: "
              + FormatoNumero.redondear(((double) tiempoTotal / 1000), 2)
              + " s");
      if (jtable.getRowCount() > 0) {
        jtable.requestFocus();
        jtable.changeSelection(0, 0, false, false);
        barraEstado(true);
        manejoControlesBotones(false);
      } else {
        javax.swing.JOptionPane.showMessageDialog(this, "No hay resultados que mostrar...");
      }

    } catch (Exception ex) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          ex, getClass().getName(), mDIShrimp.getSisInfoTO());
    }
  }
  private void llenarComboSector() throws Exception {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listaPrdListaSectorTO}");
    jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            bbProduccionSector1,
            eLProperty,
            jcboSector);
    bindingGroup.addBinding(jComboBoxBinding);

    this.bbProduccionSector1.setPrdListaSectorTO(
        shrimp.produccion.delegate.ProduccionDelegate.getInstance()
            .getListaSectorTO(empresa, false));
    this.bindingGroup.bind();
    this.jcboSector.updateUI();
    this.jcboSector.setSelectedItem(null);
    jcboSector.setRenderer(new shrimp.validaciones.ComboTooltipRenderer());
  }
Esempio n. 4
0
  /** Creates new form JIFResumenPesca */
  public JIFResumenPesca(shrimp.componentes.GUI.MDIShrimp mDIShrimp, String titulo) {

    mDIShrimp.jTabbedPane.setVisible(false);
    this.mDIShrimp = mDIShrimp;
    this.sisUsuarioEmpresaTO = mDIShrimp.getSisUsuarioEmpresaTO();
    empresa = this.sisUsuarioEmpresaTO.getEmpCodigo();
    try {
      eventoKeyPressPadre();
      initComponents();
      super.inicializar();
      this.setTitle(titulo);
      initCombos();
      jPanel1.setBounds(0, 0, 350, 110);
      jPanelDatos.add(jPanel1);
      teclasBotonesCalientes();
      eventosKeyFormulario();
      tabulacion();
      eventoKeyPress();
      barraEstado(false);
      manejoControlesBotones(true);

      desde = null;
      hasta = null;
      empresa = "¬";

      llenarBindingGroup();
      empresa = sisUsuarioEmpresaTO.getEmpCodigo();
      llenarCombo();

      fechaServidor = ProduccionDelegate.getInstance().consultarFechaMaxMin(empresa, tipoResumen);
      if (!fechaServidor.trim().isEmpty()) {
        desdeOriginal = fechaServidor.substring(0, fechaServidor.indexOf(",") - 1);
        hastaOriginal = fechaServidor.substring(fechaServidor.indexOf(",") + 1);
        jftfDesde.setValue(
            validaciones.Validacion.fecha(desdeOriginal, "yyyy-MM-dd", "dd-MM-yyyy"));
        jftfHasta.setValue(
            validaciones.Validacion.fecha(hastaOriginal, "yyyy-MM-dd", "dd-MM-yyyy"));
        this.setVisible(true);
        mDIShrimp.desktopPane.add(this);
      } else {
        JOptionPane.showMessageDialog(null, "No existen datos en corrida");
      }
      jbtnActualizar.addActionListener(
          new java.awt.event.ActionListener() {

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

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

            public void actionPerformed(java.awt.event.ActionEvent evt) {
              jbtnExportarActionPerformed(evt);
            }
          });

      try {
        String aux = codigoSector;
        this.codigoSector = "'@'";
        llenarjTable();
        this.codigoSector = aux;
      } catch (Exception ex) {
        shrimp.helper.Excepciones.guardarExcepcionesAC(
            ex, getClass().getName(), mDIShrimp.getSisInfoTO());
      }
    } catch (java.rmi.RemoteException re) {
      JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
    } catch (javax.ejb.EJBException eje) {
      JOptionPane.showMessageDialog(
          null, "Se perdio la conexion. Contacte con el administrador...");
    } catch (NameNotFoundException nnfe) {
      JOptionPane.showMessageDialog(
          null, "El programa servidor no esta listo. Intente mas tarde...");
    } catch (Exception e) {
      shrimp.helper.Excepciones.guardarExcepcionesAC(
          e, getClass().getName(), mDIShrimp.getSisInfoTO());
    }

    try {
      robot = new Robot();
      robot.keyPress(KeyEvent.VK_ESCAPE);
      robot.keyRelease(KeyEvent.VK_ESCAPE);
    } catch (Exception ex) {
    }
  }