Пример #1
0
  private void llenarBindingGroup() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    contabilidadBBTipo1 = new shrimp.contabilidad.beanbinding.ContabilidadBBTipo();
    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${listaConTipoTO}");
    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            contabilidadBBTipo1,
            eLProperty,
            jcboTipo);
    bindingGroup.addBinding(jComboBoxBinding);

    sistemaBBPeriodo1 = new shrimp.sistema.beanbinding.SistemaBBPeriodo();
    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${listaPeriodoTO}");
    jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            sistemaBBPeriodo1,
            eLProperty,
            jcboPeriodo);
    bindingGroup.addBinding(jComboBoxBinding);
    bindingGroup.bind();
  }
  private void doBindings() {
    BindingGroup bindingGroup = new BindingGroup();

    Binding binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            ELProperty.create("${registroEditado.descricao}"),
            descricaoField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);

    binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            ELProperty.create("${registroEditado.valor}"),
            valorField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);

    bindingGroup.bind();
  }
Пример #3
0
 private void llenarBindingGroup() {
   bindingGroup = new org.jdesktop.beansbinding.BindingGroup();
   org.jdesktop.beansbinding.ELProperty eLProperty =
       org.jdesktop.beansbinding.ELProperty.create(
           "${listaPrdListaResumenCorridaTO}"); // listaPrdListaResumenCorridaTO
   bindingGroup.bind();
 }
Пример #4
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();
 }
Пример #5
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jToolBar1 = new javax.swing.JToolBar();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTable1 = new javax.swing.JTable();

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${Dispose_On_Close}"),
            this,
            org.jdesktop.beansbinding.BeanProperty.create("defaultCloseOperation"));
    bindingGroup.addBinding(binding);

    getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jToolBar1.setBorder(new javax.swing.border.MatteBorder(null));
    jToolBar1.setRollover(true);
    getContentPane()
        .add(jToolBar1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 770, 100));

    jTable1.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null},
              {null, null, null, null}
            },
            new String[] {"Nombre", "Apelllido", "Edad", "Dni"}));
    jScrollPane1.setViewportView(jTable1);

    getContentPane()
        .add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 770, 410));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
Пример #6
0
  private void doBindings() {
    BindingGroup bindingGroup = new BindingGroup();

    Binding binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ,
            model,
            ELProperty.create("${registroEditado.idveiculo}"),
            idVeiculoField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);

    binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            ELProperty.create("${registroEditado.placa}"),
            placaField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);

    binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            ELProperty.create("${registroEditado.modelo}"),
            modeloField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);

    binding =
        Bindings.createAutoBinding(
            AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            ELProperty.create("${registroEditado.cor}"),
            corField,
            BeanProperty.create("text"));
    binding.setSourceUnreadableValue("");
    bindingGroup.addBinding(binding);
    bindingGroup.bind();
  }
Пример #7
0
  public void refresh() throws IOException {

    blookupService.setServiceName("/getByLookupId");
    bLookups =
        new ObjectMapper()
            .readValue(
                new RESTfulClientUtil()
                    .restFullService(
                        blookupService.getServerUrl(),
                        blookupService.getServiceName(),
                        new ObjectMapper().writeValueAsString(lookup.getId())),
                new TypeReference<List<BLookup>>() {});

    JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            bLookups,
            mainTable,
            "");
    JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${code}"));
    columnBinding.setColumnName("CODE");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
    columnBinding.setColumnName("NAME");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${persianName}"));
    columnBinding.setColumnName("PERSIANNAME");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("DESC");
    columnBinding.setColumnClass(String.class);
    BindingGroup bindingGroup = new BindingGroup();
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
  }
 /**
  * It changes the availability of buttons based in the selected bean
  *
  * @param selectedSource
  */
 private void customizePanel(SpatialBean selectedSource) {
   cmdRemove.setEnabled(selectedSource != null);
   org.jdesktop.beansbinding.ELProperty eLProperty =
       org.jdesktop.beansbinding.ELProperty.create("${beanList}");
   org.jdesktop.swingbinding.JTableBinding jTableBinding =
       org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
           org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
           cadastreObjectListBean,
           eLProperty,
           tableCadastreObject);
   org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${nameFirstpart}"));
   columnBinding.setColumnName("Name Firstpart");
   columnBinding.setColumnClass(String.class);
   columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${nameLastpart}"));
   columnBinding.setColumnName("Name Lastpart");
   columnBinding.setColumnClass(String.class);
   columnBinding.setEditable(true);
   columnBinding =
       jTableBinding.addColumnBinding(
           org.jdesktop.beansbinding.ELProperty.create("${officialArea}"));
   columnBinding.setColumnName("Official Area");
   columnBinding.setColumnClass(Double.class);
   bindingGroup.addBinding(jTableBinding);
   jTableBinding.bind();
   org.jdesktop.beansbinding.Binding binding =
       org.jdesktop.beansbinding.Bindings.createAutoBinding(
           org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
           cadastreObjectListBean,
           org.jdesktop.beansbinding.ELProperty.create("${selectedBean}"),
           tableCadastreObject,
           org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
   bindingGroup.addBinding(binding);
 }
  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());
  }
Пример #10
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    model = model; // model should be injected;
    sysIdLabel = new javax.swing.JLabel();
    sysIdField = new javax.swing.JTextField();
    nameLabel = new javax.swing.JLabel();
    nameField = new javax.swing.JTextField();
    synonymsLabel = new javax.swing.JLabel();
    jScrollPane1 = new javax.swing.JScrollPane();
    synonymsList = new org.jdesktop.swingx.JXList();
    jScrollPane2 = new javax.swing.JScrollPane();
    productsList = new org.jdesktop.swingx.JXList();
    removeProductButton = new javax.swing.JButton();
    addProductButton = new javax.swing.JButton();
    jComboBox1 = new javax.swing.JComboBox();
    removeSynonymButton = new javax.swing.JButton();
    addSynonymButton = new javax.swing.JButton();
    newSynonymField = new javax.swing.JTextField();
    productLabel = new javax.swing.JLabel();
    autoStorePreviousCheckBox = new javax.swing.JCheckBox();
    locationField = new javax.swing.JTextField();
    locationLabel = new javax.swing.JLabel();
    okButton = new javax.swing.JButton();
    cancelButton = new javax.swing.JButton();
    oldNameLabel = new javax.swing.JLabel();
    jScrollPane4 = new javax.swing.JScrollPane();
    oldNamesList = new org.jdesktop.swingx.JXList();
    addOldNameButton = new javax.swing.JButton();
    removeOldNameButton = new javax.swing.JButton();
    prevSystematicIdLabel = new javax.swing.JLabel();
    jScrollPane5 = new javax.swing.JScrollPane();
    prevSystematicIdsList = new org.jdesktop.swingx.JXList();
    addPrevSystematicIdButton = new javax.swing.JButton();
    removePrevSystematicIdButton = new javax.swing.JButton();
    addPrevSystematicIdField = new javax.swing.JTextField();
    addOldNameField = new javax.swing.JTextField();
    refreshStateButton = new javax.swing.JButton();
    jScrollPane3 = new javax.swing.JScrollPane();
    changeArea = new javax.swing.JTextArea();

    sysIdLabel.setText("Systematic Id");

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            org.jdesktop.beansbinding.ELProperty.create("${gene.uniqueName}"),
            sysIdField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    nameLabel.setText("Name");

    synonymsLabel.setText("Synonyms");

    synonymsList.setModel(
        new javax.swing.AbstractListModel() {
          String[] strings = {"Item 1", "Item 2", "Item 3", "Item 4", "Item 5"};

          public int getSize() {
            return strings.length;
          }

          public Object getElementAt(int i) {
            return strings[i];
          }
        });
    synonymsList.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            synonymsListValueChanged(evt);
          }
        });
    jScrollPane1.setViewportView(synonymsList);

    productsList.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            productsListValueChanged(evt);
          }
        });
    jScrollPane2.setViewportView(productsList);

    removeProductButton.setText("Remove");
    removeProductButton.setEnabled(false);

    addProductButton.setText("Add");

    jComboBox1.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"Item 1", "Item 2", "Item 3", "Item 4"}));

    removeSynonymButton.setText("Remove");
    removeSynonymButton.setEnabled(false);
    removeSynonymButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeSynonymButtonActionPerformed(evt);
          }
        });

    addSynonymButton.setText("Add");

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            newSynonymField,
            org.jdesktop.beansbinding.ELProperty.create("${!empty text}"),
            addSynonymButton,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

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

    productLabel.setText("Product");

    autoStorePreviousCheckBox.setText(
        "<html>Automatically store old values <br>of systematic id and name</html>");

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            model,
            org.jdesktop.beansbinding.ELProperty.create("${autoAddOldNames}"),
            autoStorePreviousCheckBox,
            org.jdesktop.beansbinding.BeanProperty.create("selected"));
    bindingGroup.addBinding(binding);

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

    locationField.setText(" ");
    locationField.setName("locationField"); // NOI18N

    locationLabel.setText("Location");

    okButton.setText("OK");

    cancelButton.setText("Cancel");

    oldNameLabel.setText("Old names");

    oldNamesList.setName("oldNamesList"); // NOI18N
    oldNamesList.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            oldNamesListValueChanged(evt);
          }
        });
    jScrollPane4.setViewportView(oldNamesList);

    addOldNameButton.setText("Add");

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            addOldNameField,
            org.jdesktop.beansbinding.ELProperty.create("${!empty text}"),
            addOldNameButton,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    removeOldNameButton.setText("Remove");
    removeOldNameButton.setEnabled(false);

    prevSystematicIdLabel.setText("<html>Previous<br>systematic id</html>");

    prevSystematicIdsList.setName("prevSystematicIdsList"); // NOI18N
    prevSystematicIdsList.addListSelectionListener(
        new javax.swing.event.ListSelectionListener() {
          public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
            prevSystematicIdsListValueChanged(evt);
          }
        });
    jScrollPane5.setViewportView(prevSystematicIdsList);

    addPrevSystematicIdButton.setText("Add");

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            addPrevSystematicIdField,
            org.jdesktop.beansbinding.ELProperty.create("${!empty text}"),
            addPrevSystematicIdButton,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    removePrevSystematicIdButton.setText("Remove");
    removePrevSystematicIdButton.setEnabled(false);

    addPrevSystematicIdField.setName("newPrevSystematicId"); // NOI18N

    addOldNameField.setName("newOldNameField"); // NOI18N

    refreshStateButton.setText("Refresh Changes");

    changeArea.setColumns(20);
    changeArea.setRows(5);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            addPrevSystematicIdField,
            org.jdesktop.beansbinding.ELProperty.create("${text.length}"),
            changeArea,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jScrollPane3.setViewportView(changeArea);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(320, 320, 320)
                                    .addComponent(okButton)
                                    .addGap(18, 18, 18)
                                    .addComponent(cancelButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        210,
                                        Short.MAX_VALUE)
                                    .addComponent(refreshStateButton))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(locationLabel)
                                            .addComponent(prevSystematicIdLabel)
                                            .addComponent(oldNameLabel)
                                            .addComponent(productLabel)
                                            .addComponent(nameLabel)
                                            .addComponent(sysIdLabel)
                                            .addComponent(synonymsLabel))
                                    .addGap(12, 12, 12)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        jScrollPane5,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        336,
                                                        Short.MAX_VALUE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED))
                                            .addComponent(
                                                jScrollPane4,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                336,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                jScrollPane2,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                336,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                nameField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                336,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                jScrollPane1,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                336,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                sysIdField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                336,
                                                Short.MAX_VALUE)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        locationField,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        336,
                                                        Short.MAX_VALUE)
                                                    .addPreferredGap(
                                                        javax.swing.LayoutStyle.ComponentPlacement
                                                            .RELATED)))
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGap(7, 7, 7)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addGap(6, 6, 6)
                                                                    .addComponent(
                                                                        autoStorePreviousCheckBox,
                                                                        javax.swing.GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        293,
                                                                        Short.MAX_VALUE))
                                                            .addGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .TRAILING,
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addGroup(
                                                                        layout
                                                                            .createParallelGroup(
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .Alignment
                                                                                    .LEADING)
                                                                            .addComponent(
                                                                                removeSynonymButton)
                                                                            .addGroup(
                                                                                layout
                                                                                    .createSequentialGroup()
                                                                                    .addComponent(
                                                                                        addSynonymButton)
                                                                                    .addPreferredGap(
                                                                                        javax.swing
                                                                                            .LayoutStyle
                                                                                            .ComponentPlacement
                                                                                            .RELATED)
                                                                                    .addComponent(
                                                                                        newSynonymField,
                                                                                        javax.swing
                                                                                            .GroupLayout
                                                                                            .DEFAULT_SIZE,
                                                                                        250,
                                                                                        Short
                                                                                            .MAX_VALUE))
                                                                            .addComponent(
                                                                                removeProductButton)
                                                                            .addGroup(
                                                                                layout
                                                                                    .createSequentialGroup()
                                                                                    .addComponent(
                                                                                        addProductButton)
                                                                                    .addPreferredGap(
                                                                                        javax.swing
                                                                                            .LayoutStyle
                                                                                            .ComponentPlacement
                                                                                            .RELATED)
                                                                                    .addComponent(
                                                                                        jComboBox1,
                                                                                        0,
                                                                                        250,
                                                                                        Short
                                                                                            .MAX_VALUE))
                                                                            .addComponent(
                                                                                removeOldNameButton)))))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGap(6, 6, 6)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                javax.swing.GroupLayout.Alignment
                                                                    .LEADING)
                                                            .addComponent(
                                                                removePrevSystematicIdButton)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(addOldNameButton)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(
                                                                        addOldNameField,
                                                                        javax.swing.GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        257,
                                                                        Short.MAX_VALUE))
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(
                                                                        addPrevSystematicIdButton)
                                                                    .addPreferredGap(
                                                                        javax.swing.LayoutStyle
                                                                            .ComponentPlacement
                                                                            .RELATED)
                                                                    .addComponent(
                                                                        addPrevSystematicIdField,
                                                                        javax.swing.GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        257,
                                                                        Short.MAX_VALUE))))))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(24, 24, 24)
                                    .addComponent(
                                        jScrollPane3,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        729,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(sysIdLabel)
                                            .addComponent(
                                                sysIdField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(nameLabel)
                                            .addComponent(
                                                nameField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(
                                autoStorePreviousCheckBox,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                56,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(synonymsLabel)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(removeSynonymButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(addSynonymButton)
                                            .addComponent(
                                                newSynonymField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                61,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(productLabel)
                                            .addComponent(removeProductButton))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(addProductButton)
                                            .addComponent(
                                                jComboBox1,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(
                                jScrollPane2,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                63,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(oldNameLabel)
                                            .addComponent(removeOldNameButton))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.BASELINE)
                                            .addComponent(addOldNameButton)
                                            .addComponent(
                                                addOldNameField,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGap(4, 4, 4))
                            .addComponent(
                                jScrollPane4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                63,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(
                                        jScrollPane5,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        63,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(
                                        layout
                                            .createSequentialGroup()
                                            .addComponent(removePrevSystematicIdButton)
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.BASELINE)
                                                    .addComponent(addPrevSystematicIdButton)
                                                    .addComponent(
                                                        addPrevSystematicIdField,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addComponent(prevSystematicIdLabel))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                locationField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(locationLabel))
                    .addGap(67, 67, 67)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancelButton)
                            .addComponent(okButton)
                            .addComponent(refreshStateButton))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(16, 16, 16)));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #11
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    rrrShareBean = CreateRrrShareBean();
    popupOwners = new javax.swing.JPopupMenu();
    menuAddOwner = new javax.swing.JMenuItem();
    menuEditOwner = new javax.swing.JMenuItem();
    menuRemoveOwner = new javax.swing.JMenuItem();
    menuViewOwner = new javax.swing.JMenuItem();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    txtDenominator = new javax.swing.JFormattedTextField();
    txtNominator = new javax.swing.JFormattedTextField();
    headerPanel = new org.sola.clients.swing.ui.HeaderPanel();
    groupPanel1 = new org.sola.clients.swing.ui.GroupPanel();
    jToolBar2 = new javax.swing.JToolBar();
    btnSave = new javax.swing.JButton();
    btnClose = new javax.swing.JButton();
    jToolBar1 = new javax.swing.JToolBar();
    btnAddOwner = new javax.swing.JButton();
    btnEditOwner = new javax.swing.JButton();
    btnRemoveOwner = new javax.swing.JButton();
    btnViewOwner = new javax.swing.JButton();
    btnSelectExisting = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableOwners = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();

    popupOwners.setName("popupOwners"); // NOI18N

    menuAddOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/desktop/administrative/Bundle"); // NOI18N
    menuAddOwner.setText(bundle.getString("SharePanel.menuAddOwner.text")); // NOI18N
    menuAddOwner.setName("menuAddOwner"); // NOI18N
    menuAddOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAddOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuAddOwner);

    menuEditOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    menuEditOwner.setText(bundle.getString("SharePanel.menuEditOwner.text")); // NOI18N
    menuEditOwner.setName("menuEditOwner"); // NOI18N
    menuEditOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuEditOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuEditOwner);

    menuRemoveOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    menuRemoveOwner.setText(bundle.getString("SharePanel.menuRemoveOwner.text")); // NOI18N
    menuRemoveOwner.setName("menuRemoveOwner"); // NOI18N
    menuRemoveOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuRemoveOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuRemoveOwner);

    menuViewOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/view.png"))); // NOI18N
    menuViewOwner.setText(bundle.getString("SharePanel.menuViewOwner.text")); // NOI18N
    menuViewOwner.setName("menuViewOwner"); // NOI18N
    menuViewOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuViewOwnerActionPerformed(evt);
          }
        });
    popupOwners.add(menuViewOwner);

    setHeaderPanel(headerPanel);
    setHelpTopic("ownership_rrr"); // NOI18N
    setName("Form"); // NOI18N
    setPreferredSize(new java.awt.Dimension(662, 348));

    jLabel1.setFont(LafManager.getInstance().getLabFontBold());
    jLabel1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N
    jLabel1.setText(bundle.getString("SharePanel.jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    jLabel2.setText(bundle.getString("SharePanel.jLabel2.text")); // NOI18N
    jLabel2.setToolTipText(bundle.getString("SharePanel.jLabel2.toolTipText")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtDenominator.setFormatterFactory(FormattersFactory.getInstance().getShortFormatterFactory());
    txtDenominator.setText(bundle.getString("SharePanel.txtDenominator.text_1")); // NOI18N
    txtDenominator.setName("txtDenominator"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${denominator}"),
            txtDenominator,
            org.jdesktop.beansbinding.BeanProperty.create("value"));
    bindingGroup.addBinding(binding);

    txtNominator.setFormatterFactory(FormattersFactory.getInstance().getShortFormatterFactory());
    txtNominator.setText(bundle.getString("SharePanel.txtNominator.text")); // NOI18N
    txtNominator.setName("txtNominator"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${nominator}"),
            txtNominator,
            org.jdesktop.beansbinding.BeanProperty.create("value"));
    bindingGroup.addBinding(binding);

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

    headerPanel.setName("headerPanel"); // NOI18N
    headerPanel.setTitleText(bundle.getString("SharePanel.headerPanel.titleText")); // NOI18N

    groupPanel1.setName("groupPanel1"); // NOI18N
    groupPanel1.setTitleText(bundle.getString("SharePanel.groupPanel1.titleText")); // NOI18N

    jToolBar2.setFloatable(false);
    jToolBar2.setRollover(true);
    jToolBar2.setName("jToolBar2"); // NOI18N

    btnSave.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/save.png"))); // NOI18N
    btnSave.setText(bundle.getString("SharePanel.btnSave.text")); // NOI18N
    btnSave.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnSave.setName("btnSave"); // NOI18N
    btnSave.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveActionPerformed(evt);
          }
        });
    jToolBar2.add(btnSave);

    btnClose.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/confirm-close.png"))); // NOI18N
    btnClose.setText(bundle.getString("SharePanel.btnClose.text")); // NOI18N
    btnClose.setFocusable(false);
    btnClose.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnClose.setName("btnClose"); // NOI18N
    btnClose.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnClose.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCloseActionPerformed(evt);
          }
        });
    jToolBar2.add(btnClose);

    jToolBar1.setFloatable(false);
    jToolBar1.setRollover(true);
    jToolBar1.setName("jToolBar1"); // NOI18N

    btnAddOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    btnAddOwner.setText(bundle.getString("SharePanel.btnAddOwner.text")); // NOI18N
    btnAddOwner.setName("btnAddOwner"); // NOI18N
    btnAddOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnAddOwner);

    btnEditOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    btnEditOwner.setText(bundle.getString("SharePanel.btnEditOwner.text")); // NOI18N
    btnEditOwner.setFocusable(false);
    btnEditOwner.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnEditOwner.setName("btnEditOwner"); // NOI18N
    btnEditOwner.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnEditOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnEditOwner);

    btnRemoveOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    btnRemoveOwner.setText(bundle.getString("SharePanel.btnRemoveOwner.text")); // NOI18N
    btnRemoveOwner.setToolTipText(bundle.getString("btnRemoveOwner.tooltip.text")); // NOI18N
    btnRemoveOwner.setName("btnRemoveOwner"); // NOI18N
    btnRemoveOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnRemoveOwner);

    btnViewOwner.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/view.png"))); // NOI18N
    btnViewOwner.setText(bundle.getString("SharePanel.btnViewOwner.text")); // NOI18N
    btnViewOwner.setName("btnViewOwner"); // NOI18N
    btnViewOwner.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnViewOwnerActionPerformed(evt);
          }
        });
    jToolBar1.add(btnViewOwner);

    btnSelectExisting.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/search.png"))); // NOI18N
    btnSelectExisting.setText(bundle.getString("SharePanel.btnSelectExisting.text")); // NOI18N
    btnSelectExisting.setFocusable(false);
    btnSelectExisting.setName(bundle.getString("SharePanel.btnSelectExisting.name")); // NOI18N
    btnSelectExisting.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnSelectExisting.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSelectExistingActionPerformed(evt);
          }
        });
    jToolBar1.add(btnSelectExisting);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tableOwners.setComponentPopupMenu(popupOwners);
    tableOwners.setName("tableOwners"); // NOI18N

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${filteredRightHolderList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            eLProperty,
            tableOwners);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
    columnBinding.setColumnName("Name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${lastName}"));
    columnBinding.setColumnName("Last Name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            rrrShareBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedRightHolder}"),
            tableOwners,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tableOwners);
    if (tableOwners.getColumnModel().getColumnCount() > 0) {
      tableOwners
          .getColumnModel()
          .getColumn(0)
          .setHeaderValue(bundle.getString("SharePanel.tableOwners.columnModel.title0")); // NOI18N
      tableOwners
          .getColumnModel()
          .getColumn(1)
          .setHeaderValue(bundle.getString("SharePanel.tableOwners.columnModel.title1")); // NOI18N
    }

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                headerPanel,
                javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addComponent(
                jToolBar2,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                groupPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtNominator,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        42,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(6, 6, 6)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtDenominator,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        42,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(
                                jToolBar1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                463,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addComponent(
                        headerPanel,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jToolBar2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(11, 11, 11)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(
                                txtNominator,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtDenominator,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(
                        groupPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jToolBar1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 215, Short.MAX_VALUE)
                    .addContainerGap()));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #12
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    mainPanel = new javax.swing.JPanel();
    masterScrollPane = new javax.swing.JScrollPane();
    masterTable = new javax.swing.JTable();
    idLabel = new javax.swing.JLabel();
    imeLabel = new javax.swing.JLabel();
    prezimeLabel = new javax.swing.JLabel();
    adresaLabel = new javax.swing.JLabel();
    brojlicneLabel = new javax.swing.JLabel();
    sifraotiskaLabel = new javax.swing.JLabel();
    idField = new javax.swing.JTextField();
    imeField = new javax.swing.JTextField();
    prezimeField = new javax.swing.JTextField();
    adresaField = new javax.swing.JTextField();
    brojlicneField = new javax.swing.JTextField();
    sifraotiskaField = new javax.swing.JTextField();
    saveButton = new javax.swing.JButton();
    refreshButton = new javax.swing.JButton();
    newButton = new javax.swing.JButton();
    deleteButton = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    javax.swing.JMenu fileMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem newRecordMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenuItem deleteRecordMenuItem = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JSeparator();
    javax.swing.JMenuItem saveMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenuItem refreshMenuItem = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JSeparator();
    javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
    statusPanel = new javax.swing.JPanel();
    javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
    statusMessageLabel = new javax.swing.JLabel();
    statusAnimationLabel = new javax.swing.JLabel();
    progressBar = new javax.swing.JProgressBar();
    org.jdesktop.application.ResourceMap resourceMap =
        org.jdesktop.application.Application.getInstance(
                fingerprintapplication.FingerprintApplication.class)
            .getContext()
            .getResourceMap(FingerprintView.class);
    entityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory(
                    resourceMap.getString("entityManager.persistenceUnit"))
                .createEntityManager(); // NOI18N
    query =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery(resourceMap.getString("query.query")); // NOI18N
    list =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                query.getResultList());

    mainPanel.setName("mainPanel"); // NOI18N

    masterScrollPane.setName("masterScrollPane"); // NOI18N

    masterTable.setName("masterTable"); // NOI18N

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${ime}"));
    columnBinding.setColumnName("Ime");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${prezime}"));
    columnBinding.setColumnName("Prezime");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${adresa}"));
    columnBinding.setColumnName("Adresa");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${brojlicne}"));
    columnBinding.setColumnName("Brojlicne");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${sifraotiska}"));
    columnBinding.setColumnName("Sifraotiska");
    columnBinding.setColumnClass(String.class);
    bindingGroup.addBinding(jTableBinding);

    masterScrollPane.setViewportView(masterTable);

    idLabel.setText(resourceMap.getString("idLabel.text")); // NOI18N
    idLabel.setName("idLabel"); // NOI18N

    imeLabel.setText(resourceMap.getString("imeLabel.text")); // NOI18N
    imeLabel.setName("imeLabel"); // NOI18N

    prezimeLabel.setText(resourceMap.getString("prezimeLabel.text")); // NOI18N
    prezimeLabel.setName("prezimeLabel"); // NOI18N

    adresaLabel.setText(resourceMap.getString("adresaLabel.text")); // NOI18N
    adresaLabel.setName("adresaLabel"); // NOI18N

    brojlicneLabel.setText(resourceMap.getString("brojlicneLabel.text")); // NOI18N
    brojlicneLabel.setName("brojlicneLabel"); // NOI18N

    sifraotiskaLabel.setText(resourceMap.getString("sifraotiskaLabel.text")); // NOI18N
    sifraotiskaLabel.setName("sifraotiskaLabel"); // NOI18N

    idField.setName("idField"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"),
            idField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            idField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    imeField.setName("imeField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.ime}"),
            imeField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            imeField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    prezimeField.setName("prezimeField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.prezime}"),
            prezimeField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            prezimeField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    adresaField.setName("adresaField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.adresa}"),
            adresaField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            adresaField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    brojlicneField.setName("brojlicneField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.brojlicne}"),
            brojlicneField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            brojlicneField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    sifraotiskaField.setName("sifraotiskaField"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.sifraotiska}"),
            sifraotiskaField,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setSourceUnreadableValue(null);
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ,
            masterTable,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            sifraotiskaField,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance(
                fingerprintapplication.FingerprintApplication.class)
            .getContext()
            .getActionMap(FingerprintView.class, this);
    saveButton.setAction(actionMap.get("save")); // NOI18N
    saveButton.setText(resourceMap.getString("saveButton.text")); // NOI18N
    saveButton.setName("saveButton"); // NOI18N

    refreshButton.setAction(actionMap.get("refresh")); // NOI18N
    refreshButton.setText(resourceMap.getString("refreshButton.text")); // NOI18N
    refreshButton.setName("refreshButton"); // NOI18N

    newButton.setAction(actionMap.get("newRecord")); // NOI18N
    newButton.setText(resourceMap.getString("newButton.text")); // NOI18N
    newButton.setName("newButton"); // NOI18N

    deleteButton.setAction(actionMap.get("deleteRecord")); // NOI18N
    deleteButton.setText(resourceMap.getString("deleteButton.text")); // NOI18N
    deleteButton.setName("deleteButton"); // NOI18N

    javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(
        mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                mainPanelLayout
                    .createSequentialGroup()
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addComponent(newButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(deleteButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(refreshButton)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(saveButton))
                            .addGroup(
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addGroup(
                                        mainPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(idLabel)
                                            .addComponent(imeLabel)
                                            .addComponent(prezimeLabel)
                                            .addComponent(adresaLabel)
                                            .addComponent(brojlicneLabel)
                                            .addComponent(sifraotiskaLabel))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        mainPanelLayout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                idField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                imeField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                prezimeField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                adresaField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                brojlicneField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                sifraotiskaField,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                369,
                                                Short.MAX_VALUE)))
                            .addGroup(
                                mainPanelLayout
                                    .createSequentialGroup()
                                    .addContainerGap()
                                    .addComponent(
                                        masterScrollPane,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        427,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));

    mainPanelLayout.linkSize(
        javax.swing.SwingConstants.HORIZONTAL,
        new java.awt.Component[] {deleteButton, newButton, refreshButton, saveButton});

    mainPanelLayout.setVerticalGroup(
        mainPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                mainPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        masterScrollPane,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        189,
                        Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(idLabel)
                            .addComponent(
                                idField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(imeLabel)
                            .addComponent(
                                imeField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(prezimeLabel)
                            .addComponent(
                                prezimeField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(adresaLabel)
                            .addComponent(
                                adresaField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(brojlicneLabel)
                            .addComponent(
                                brojlicneField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(sifraotiskaLabel)
                            .addComponent(
                                sifraotiskaField,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        mainPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(saveButton)
                            .addComponent(refreshButton)
                            .addComponent(deleteButton)
                            .addComponent(newButton))
                    .addContainerGap()));

    menuBar.setName("menuBar"); // NOI18N

    fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
    fileMenu.setName("fileMenu"); // NOI18N

    newRecordMenuItem.setAction(actionMap.get("newRecord")); // NOI18N
    newRecordMenuItem.setText(resourceMap.getString("newRecordMenuItem.text")); // NOI18N
    newRecordMenuItem.setName("newRecordMenuItem"); // NOI18N
    fileMenu.add(newRecordMenuItem);

    deleteRecordMenuItem.setAction(actionMap.get("deleteRecord")); // NOI18N
    deleteRecordMenuItem.setText(resourceMap.getString("deleteRecordMenuItem.text")); // NOI18N
    deleteRecordMenuItem.setName("deleteRecordMenuItem"); // NOI18N
    fileMenu.add(deleteRecordMenuItem);

    jSeparator1.setName("jSeparator1"); // NOI18N
    fileMenu.add(jSeparator1);

    saveMenuItem.setAction(actionMap.get("save")); // NOI18N
    saveMenuItem.setText(resourceMap.getString("saveMenuItem.text")); // NOI18N
    saveMenuItem.setName("saveMenuItem"); // NOI18N
    fileMenu.add(saveMenuItem);

    refreshMenuItem.setAction(actionMap.get("refresh")); // NOI18N
    refreshMenuItem.setText(resourceMap.getString("refreshMenuItem.text")); // NOI18N
    refreshMenuItem.setName("refreshMenuItem"); // NOI18N
    fileMenu.add(refreshMenuItem);

    jSeparator2.setName("jSeparator2"); // NOI18N
    fileMenu.add(jSeparator2);

    exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
    exitMenuItem.setText(resourceMap.getString("exitMenuItem.text")); // NOI18N
    exitMenuItem.setName("exitMenuItem"); // NOI18N
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    statusPanel.setName("statusPanel"); // NOI18N

    statusPanelSeparator.setName("statusPanelSeparator"); // NOI18N

    statusMessageLabel.setName("statusMessageLabel"); // NOI18N

    statusAnimationLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    statusAnimationLabel.setName("statusAnimationLabel"); // NOI18N

    progressBar.setName("progressBar"); // NOI18N

    javax.swing.GroupLayout statusPanelLayout = new javax.swing.GroupLayout(statusPanel);
    statusPanel.setLayout(statusPanelLayout);
    statusPanelLayout.setHorizontalGroup(
        statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                statusPanelSeparator, javax.swing.GroupLayout.DEFAULT_SIZE, 447, Short.MAX_VALUE)
            .addGroup(
                statusPanelLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(statusMessageLabel)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 277, Short.MAX_VALUE)
                    .addComponent(
                        progressBar,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(statusAnimationLabel)
                    .addContainerGap()));
    statusPanelLayout.setVerticalGroup(
        statusPanelLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                statusPanelLayout
                    .createSequentialGroup()
                    .addComponent(
                        statusPanelSeparator,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        2,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addGroup(
                        statusPanelLayout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(statusMessageLabel)
                            .addComponent(statusAnimationLabel)
                            .addComponent(
                                progressBar,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3)));

    setComponent(mainPanel);
    setMenuBar(menuBar);
    setStatusBar(statusPanel);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    java.awt.GridBagConstraints gridBagConstraints;
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    createNewLocation = new de.cismet.cids.custom.switchon.gui.utils.CreateNewTagAction();
    geometryChooserPanel = new de.cismet.cids.custom.switchon.gui.GeometryChooserPanel();
    pnlOtherProperties = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    cmbSrid =
        FastBindableReferenceComboFactory.createTagsFastBindableReferenceComboBox(Taggroups.SRID);
    jLabel2 = new javax.swing.JLabel();
    cmbLocation =
        FastBindableReferenceComboFactory.createTagsFastBindableReferenceComboBox(
            Taggroups.LOCATION);
    btnAddLocation = new javax.swing.JButton();
    filler1 =
        new javax.swing.Box.Filler(
            new java.awt.Dimension(0, 0),
            new java.awt.Dimension(0, 0),
            new java.awt.Dimension(0, 32767));
    infoBoxPanel = new de.cismet.cids.custom.switchon.gui.InfoBoxPanel();

    setLayout(new java.awt.GridBagLayout());

    geometryChooserPanel.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                GeographicInformationVisualPanel.class,
                "GeographicInformationVisualPanel.geometryChooserPanel.border.title"))); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.6;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 10, 10);
    add(geometryChooserPanel, gridBagConstraints);

    pnlOtherProperties.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            org.openide.util.NbBundle.getMessage(
                GeographicInformationVisualPanel.class,
                "GeographicInformationVisualPanel.pnlOtherProperties.border.title"))); // NOI18N
    pnlOtherProperties.setLayout(new java.awt.GridBagLayout());

    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel1,
        org.openide.util.NbBundle.getMessage(
            GeographicInformationVisualPanel.class,
            "GeographicInformationVisualPanel.jLabel1.text")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 10);
    pnlOtherProperties.add(jLabel1, gridBagConstraints);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${cidsBean.srid}"),
            cmbSrid,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    cmbSrid.addFocusListener(
        new java.awt.event.FocusAdapter() {

          @Override
          public void focusGained(final java.awt.event.FocusEvent evt) {
            cmbSridFocusGained(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 5, 10);
    pnlOtherProperties.add(cmbSrid, gridBagConstraints);

    org.openide.awt.Mnemonics.setLocalizedText(
        jLabel2,
        org.openide.util.NbBundle.getMessage(
            GeographicInformationVisualPanel.class,
            "GeographicInformationVisualPanel.jLabel2.text")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 10, 5, 10);
    pnlOtherProperties.add(jLabel2, gridBagConstraints);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${cidsBean.location}"),
            cmbLocation,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    cmbLocation.addFocusListener(
        new java.awt.event.FocusAdapter() {

          @Override
          public void focusGained(final java.awt.event.FocusEvent evt) {
            cmbLocationFocusGained(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
    pnlOtherProperties.add(cmbLocation, gridBagConstraints);

    createNewLocation.setCombo((FastBindableReferenceCombo) cmbLocation);
    btnAddLocation.setAction(createNewLocation);
    org.openide.awt.Mnemonics.setLocalizedText(
        btnAddLocation,
        org.openide.util.NbBundle.getMessage(
            GeographicInformationVisualPanel.class,
            "GeographicInformationVisualPanel.btnAddLocation.text")); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 10, 10, 10);
    pnlOtherProperties.add(btnAddLocation, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
    gridBagConstraints.weighty = 1.0;
    pnlOtherProperties.add(filler1, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 0.4;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 10);
    add(pnlOtherProperties, gridBagConstraints);

    infoBoxPanel.setGeneralInformation(
        org.openide.util.NbBundle.getMessage(
            GeographicInformationVisualPanel.class,
            "GeographicInformationVisualPanel.infoBoxPanel.generalInformation")); // NOI18N
    infoBoxPanel.setMinimumSize(new java.awt.Dimension(134, 55));
    infoBoxPanel.setPreferredSize(new java.awt.Dimension(748, 55));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(0, 10, 10, 10);
    add(infoBoxPanel, gridBagConstraints);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #14
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    buttonGroup1 = new javax.swing.ButtonGroup();
    jSplitPane1 = new javax.swing.JSplitPane();
    jPanel1 = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jRadioButton2 = new javax.swing.JRadioButton();
    jRadioButton1 = new javax.swing.JRadioButton();
    jRadioButton3 = new javax.swing.JRadioButton();
    jButton1 = new javax.swing.JButton();
    jTextField1 = new javax.swing.JTextField();
    jPanel4 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jTextField2 = new javax.swing.JTextField();
    jTextField3 = new javax.swing.JTextField();
    jTextField4 = new javax.swing.JTextField();
    jTextField5 = new javax.swing.JTextField();
    jTextField6 = new javax.swing.JTextField();
    jLabel7 = new javax.swing.JLabel();
    jTextField8 = new javax.swing.JTextField();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jLabel6 = new javax.swing.JLabel();
    jTextField7 = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();

    setClosable(true);
    setDefaultCloseOperation(javax.swing.WindowConstants.HIDE_ON_CLOSE);
    setIconifiable(true);
    setMaximizable(true);
    setResizable(true);
    setTitle("Custom Fit Models Manager");

    jSplitPane1.setDividerLocation(400);
    jSplitPane1.setLastDividerLocation(400);
    jSplitPane1.setName("jSplitPane1"); // NOI18N

    jPanel1.setMinimumSize(new java.awt.Dimension(400, 100));
    jPanel1.setName("jPanel1"); // NOI18N
    jPanel1.setPreferredSize(new java.awt.Dimension(400, 471));

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("Add Custom Model Component"));
    jPanel2.setName("jPanel2"); // NOI18N

    buttonGroup1.add(jRadioButton2);
    jRadioButton2.setText("Template Library");
    jRadioButton2.setName("jRadioButton2"); // NOI18N
    jRadioButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectType(evt);
          }
        });

    buttonGroup1.add(jRadioButton1);
    jRadioButton1.setText("Table");
    jRadioButton1.setName("jRadioButton1"); // NOI18N
    jRadioButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectType(evt);
          }
        });

    buttonGroup1.add(jRadioButton3);
    jRadioButton3.setText("Python Function");
    jRadioButton3.setName("jRadioButton3"); // NOI18N
    jRadioButton3.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectType(evt);
          }
        });

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance()
            .getContext()
            .getActionMap(CustomModelsManagerView.class, this);
    jButton1.setAction(actionMap.get("browse")); // NOI18N
    jButton1.setName("jButton1"); // NOI18N

    jTextField1.setName("jTextField1"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${diskLocation}"),
            jTextField1,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Component Parameters"));
    jPanel4.setName("jPanel4"); // NOI18N

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel1.setText("Names");
    jLabel1.setName("jLabel1"); // NOI18N

    jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel2.setText("Values");
    jLabel2.setName("jLabel2"); // NOI18N

    jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel3.setText("Mins");
    jLabel3.setName("jLabel3"); // NOI18N

    jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel4.setText("Maxs");
    jLabel4.setName("jLabel4"); // NOI18N

    jLabel5.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
    jLabel5.setText("Fixed");
    jLabel5.setName("jLabel5"); // NOI18N

    jTextField2.setName("jTextField2"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.parnames}"),
            jTextField2,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jTextField3.setName("jTextField3"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.parvals}"),
            jTextField3,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jTextField4.setName("jTextField4"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.parmins}"),
            jTextField4,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jTextField5.setName("jTextField5"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.parmaxs}"),
            jTextField5,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jTextField6.setName("jTextField6"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.parfrozen}"),
            jTextField6,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jLabel7.setText("Function Name");
    jLabel7.setName("jLabel7"); // NOI18N

    jTextField8.setName("jTextField8"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.functionName}"),
            jTextField8,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            jRadioButton3,
            org.jdesktop.beansbinding.ELProperty.create("${selected}"),
            jTextField8,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel4Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel4Layout
                                    .createSequentialGroup()
                                    .add(
                                        jPanel4Layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.TRAILING, false)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.LEADING,
                                                jLabel5,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.LEADING,
                                                jLabel1,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.LEADING,
                                                jLabel2,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.LEADING,
                                                jLabel3,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .add(
                                                org.jdesktop.layout.GroupLayout.LEADING,
                                                jLabel4,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jPanel4Layout
                                            .createParallelGroup(
                                                org.jdesktop.layout.GroupLayout.LEADING)
                                            .add(
                                                jTextField2,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                240,
                                                Short.MAX_VALUE)
                                            .add(
                                                jTextField3,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                240,
                                                Short.MAX_VALUE)
                                            .add(
                                                jTextField4,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                240,
                                                Short.MAX_VALUE)
                                            .add(
                                                jTextField5,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                240,
                                                Short.MAX_VALUE)
                                            .add(
                                                jTextField6,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                240,
                                                Short.MAX_VALUE)))
                            .add(
                                jPanel4Layout
                                    .createSequentialGroup()
                                    .add(jLabel7)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jTextField8,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        188,
                                        Short.MAX_VALUE)))
                    .addContainerGap()));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel4Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel7)
                            .add(
                                jTextField8,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(18, 18, 18)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(
                                jTextField2,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel2)
                            .add(
                                jTextField3,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel3)
                            .add(
                                jTextField4,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel4)
                            .add(
                                jTextField5,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(
                        jPanel4Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel5)
                            .add(
                                jTextField6,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jButton2.setAction(actionMap.get("install")); // NOI18N
    jButton2.setName("jButton2"); // NOI18N

    jButton3.setAction(actionMap.get("close")); // NOI18N
    jButton3.setName("jButton3"); // NOI18N

    jLabel6.setText("Component ID:");
    jLabel6.setName("jLabel6"); // NOI18N

    jTextField7.setName("jTextField7"); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${model.name}"),
            jTextField7,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel2Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel2Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel2Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(
                                        jPanel2Layout
                                            .createSequentialGroup()
                                            .add(
                                                jTextField1,
                                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                                346,
                                                Short.MAX_VALUE)
                                            .addContainerGap())
                                    .add(
                                        jPanel2Layout
                                            .createSequentialGroup()
                                            .add(
                                                jPanel2Layout
                                                    .createParallelGroup(
                                                        org.jdesktop.layout.GroupLayout.LEADING)
                                                    .add(
                                                        jPanel2Layout
                                                            .createSequentialGroup()
                                                            .add(
                                                                jPanel2Layout
                                                                    .createParallelGroup(
                                                                        org.jdesktop.layout
                                                                            .GroupLayout.LEADING)
                                                                    .add(jRadioButton1)
                                                                    .add(jRadioButton2)
                                                                    .add(jRadioButton3))
                                                            .addPreferredGap(
                                                                org.jdesktop.layout.LayoutStyle
                                                                    .RELATED,
                                                                209,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE))
                                                    .add(
                                                        org.jdesktop.layout.GroupLayout.TRAILING,
                                                        jPanel2Layout
                                                            .createSequentialGroup()
                                                            .add(
                                                                jPanel2Layout
                                                                    .createParallelGroup(
                                                                        org.jdesktop.layout
                                                                            .GroupLayout.TRAILING)
                                                                    .add(
                                                                        org.jdesktop.layout
                                                                            .GroupLayout.LEADING,
                                                                        jButton2,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        345,
                                                                        Short.MAX_VALUE)
                                                                    .add(
                                                                        jPanel4,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        Short.MAX_VALUE)
                                                                    .add(
                                                                        org.jdesktop.layout
                                                                            .GroupLayout.LEADING,
                                                                        jButton3,
                                                                        org.jdesktop.layout
                                                                            .GroupLayout
                                                                            .DEFAULT_SIZE,
                                                                        345,
                                                                        Short.MAX_VALUE))
                                                            .addPreferredGap(
                                                                org.jdesktop.layout.LayoutStyle
                                                                    .RELATED,
                                                                1,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .PREFERRED_SIZE))
                                                    .add(
                                                        jPanel2Layout
                                                            .createSequentialGroup()
                                                            .add(jLabel6)
                                                            .addPreferredGap(
                                                                org.jdesktop.layout.LayoutStyle
                                                                    .RELATED)
                                                            .add(
                                                                jTextField7,
                                                                org.jdesktop.layout.GroupLayout
                                                                    .DEFAULT_SIZE,
                                                                241,
                                                                Short.MAX_VALUE)))
                                            .add(20, 20, 20)))
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .add(
                                        jButton1,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        91,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addContainerGap()))));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel2Layout
                    .createSequentialGroup()
                    .add(42, 42, 42)
                    .add(
                        jPanel2Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel6)
                            .add(
                                jTextField7,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(18, 18, 18)
                    .add(jRadioButton1)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(jRadioButton2)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                    .add(jRadioButton3)
                    .add(15, 15, 15)
                    .add(
                        jTextField1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jButton1)
                    .add(18, 18, 18)
                    .add(
                        jPanel4,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 24, Short.MAX_VALUE)
                    .add(jButton2)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(jButton3)
                    .addContainerGap()));

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel2,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel2,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

    jSplitPane1.setLeftComponent(jPanel1);

    jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Installed Components"));
    jPanel3.setName("jPanel3"); // NOI18N

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    jTree1.setName("jTree1"); // NOI18N
    jScrollPane1.setViewportView(jTree1);

    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jScrollPane1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                264,
                Short.MAX_VALUE));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 617, Short.MAX_VALUE));

    jSplitPane1.setRightComponent(jPanel3);

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jSplitPane1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                687,
                Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jSplitPane1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                649,
                Short.MAX_VALUE));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    entityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU")
                .createEntityManager();
    query =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT m FROM MovimientoStock m");
    list =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                query.getResultList());
    detalleOrdenCompraQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT d FROM DetalleOrdenCompra d");
    detalleOrdenCompraList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : detalleOrdenCompraQuery.getResultList();
    empleadoQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT e FROM Empleado e");
    empleadoList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : empleadoQuery.getResultList();
    ordenCompraQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : entityManager.createQuery("SELECT o FROM OrdenCompra o");
    ordenCompraList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : ordenCompraQuery.getResultList();
    jPanel3 = new javax.swing.JPanel();
    lbl_registrarC = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    lbl_nombre = new javax.swing.JLabel();
    cantidadMinimaLabel = new javax.swing.JLabel();
    tf_articulo = new javax.swing.JTextField();
    tf_cantidad = new javax.swing.JTextField();
    cantidadMinimaLabel1 = new javax.swing.JLabel();
    tf_fecha = new javax.swing.JTextField();
    lbl_nombre1 = new javax.swing.JLabel();
    tf_codigo = new javax.swing.JTextField();
    jPanel6 = new javax.swing.JPanel();
    btn_cancelar3 = new javax.swing.JButton();
    btn_guardar = new javax.swing.JButton();
    btn_modificar = new javax.swing.JButton();
    btn_eliminar = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    lbl_valor = new javax.swing.JLabel();
    tf_valor = new javax.swing.JTextField();
    lbl_filtro = new javax.swing.JLabel();
    list_filtros = new javax.swing.JComboBox();
    btn_buscar = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    masterTable = new javax.swing.JTable();

    FormListener formListener = new FormListener();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    jPanel3.setBackground(new java.awt.Color(0, 153, 255));
    jPanel3.setBorder(
        javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));

    lbl_registrarC.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N
    lbl_registrarC.setForeground(new java.awt.Color(255, 255, 255));
    lbl_registrarC.setText("Modificar/Eliminar Extraccion de Articulo:");

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addGap(89, 89, 89)
                    .addComponent(lbl_registrarC)
                    .addContainerGap(120, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                jPanel3Layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(lbl_registrarC)
                    .addContainerGap()));

    jPanel1.setBackground(new java.awt.Color(204, 204, 204));
    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    lbl_nombre.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_nombre.setText("Articulo:");

    cantidadMinimaLabel.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    cantidadMinimaLabel.setText("Cantidad:");

    tf_articulo.setEnabled(false);

    tf_cantidad.setEnabled(false);
    tf_cantidad.addFocusListener(formListener);
    tf_cantidad.addKeyListener(formListener);

    cantidadMinimaLabel1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    cantidadMinimaLabel1.setText("Fecha:");

    tf_fecha.setEnabled(false);

    lbl_nombre1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_nombre1.setText("Codigo:");

    tf_codigo.setEnabled(false);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_nombre)
                            .addComponent(cantidadMinimaLabel)
                            .addComponent(cantidadMinimaLabel1)
                            .addComponent(lbl_nombre1))
                    .addGap(42, 42, 42)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel1Layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(
                                        tf_articulo,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        214,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        tf_cantidad,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        33,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(tf_fecha))
                            .addComponent(
                                tf_codigo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                103,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addGap(13, 13, 13)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_nombre1)
                            .addComponent(
                                tf_codigo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                tf_articulo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_nombre, javax.swing.GroupLayout.Alignment.TRAILING))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cantidadMinimaLabel)
                            .addComponent(
                                tf_cantidad,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cantidadMinimaLabel1)
                            .addComponent(
                                tf_fecha,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel6.setBackground(new java.awt.Color(204, 204, 204));
    jPanel6.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    btn_cancelar3.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N
    btn_cancelar3.setText("Cancelar");
    btn_cancelar3.addActionListener(formListener);

    btn_guardar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N
    btn_guardar.setText("Guardar");
    btn_guardar.setEnabled(false);
    btn_guardar.addActionListener(formListener);

    btn_modificar.setText("Modificar");
    btn_modificar.setEnabled(false);
    btn_modificar.addActionListener(formListener);

    btn_eliminar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/trash.png"))); // NOI18N
    btn_eliminar.setText("Eliminar");
    btn_eliminar.setEnabled(false);
    btn_eliminar.addActionListener(formListener);

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel6Layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(btn_modificar)
                    .addGap(29, 29, 29)
                    .addComponent(btn_guardar)
                    .addGap(28, 28, 28)
                    .addComponent(btn_eliminar)
                    .addGap(33, 33, 33)
                    .addComponent(btn_cancelar3)
                    .addGap(34, 34, 34)));
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel6Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel6Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(btn_cancelar3)
                            .addComponent(
                                btn_guardar,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(btn_modificar)
                            .addComponent(
                                btn_eliminar,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel2.setBackground(new java.awt.Color(204, 204, 204));
    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_valor.setText("Valor:");

    tf_valor.addKeyListener(formListener);

    lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_filtro.setText("Buscar por:");

    list_filtros.setModel(
        new javax.swing.DefaultComboBoxModel(new String[] {"Código", "Articulo"}));
    list_filtros.addMouseListener(formListener);

    btn_buscar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N
    btn_buscar.setText("Buscar");
    btn_buscar.addActionListener(formListener);
    btn_buscar.addFocusListener(formListener);

    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(36, 36, 36)
                    .addComponent(lbl_filtro)
                    .addGap(18, 18, 18)
                    .addComponent(
                        list_filtros,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        107,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .addComponent(lbl_valor)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        tf_valor,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        123,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(btn_buscar)
                    .addGap(36, 36, 36)));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_filtro)
                            .addComponent(
                                list_filtros,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(lbl_valor)
                            .addComponent(
                                tf_valor,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btn_buscar))
                    .addContainerGap()));

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, list, masterTable);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${codigoMovimiento}"));
    columnBinding.setColumnName("Codigo Movimiento");
    columnBinding.setColumnClass(Integer.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${codigoArticulo.nombre}"));
    columnBinding.setColumnName("Articulo");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${cantidad}"));
    columnBinding.setColumnName("Cantidad");
    columnBinding.setColumnClass(Integer.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fechaHora}"));
    columnBinding.setColumnName("Fecha Hora");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    masterTable.addMouseListener(formListener);
    jScrollPane1.setViewportView(masterTable);

    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()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jPanel3,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jPanel2,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap())
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(146, 146, 146)
                    .addComponent(
                        jPanel6,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        jPanel3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jPanel2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        205,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 58, Short.MAX_VALUE)
                    .addComponent(
                        jPanel6,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(43, 43, 43)));

    bindingGroup.bind();

    pack();
  }
Пример #16
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    surveyPointListBean = createBean();
    urbanRural = new javax.swing.ButtonGroup();
    optionRural = new javax.swing.JRadioButton();
    txtY = new javax.swing.JTextField();
    optionUrban = new javax.swing.JRadioButton();
    cmdAdd = new javax.swing.JButton();
    cmdRemove = new javax.swing.JButton();
    txtAcceptableShift = new javax.swing.JTextField();
    txtStandardDeviation = new javax.swing.JTextField();
    txtMeanShift = new javax.swing.JTextField();
    txtX = new javax.swing.JTextField();
    jScrollPane1 = new javax.swing.JScrollPane();
    tablePointList = new javax.swing.JTable();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();

    urbanRural.add(optionRural);
    optionRural.setSelected(true);
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/gis/ui/control/Bundle"); // NOI18N
    optionRural.setText(bundle.getString("SurveyPointListPanel.optionRural.text")); // NOI18N
    optionRural.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            optionRuralActionPerformed(evt);
          }
        });

    urbanRural.add(optionUrban);
    optionUrban.setText(bundle.getString("SurveyPointListPanel.optionUrban.text")); // NOI18N
    optionUrban.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            optionUrbanActionPerformed(evt);
          }
        });

    cmdAdd.setText(bundle.getString("SurveyPointListPanel.cmdAdd.text")); // NOI18N
    cmdAdd.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdAddActionPerformed(evt);
          }
        });

    cmdRemove.setText(bundle.getString("SurveyPointListPanel.cmdRemove.text")); // NOI18N
    cmdRemove.setEnabled(false);
    cmdRemove.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cmdRemoveActionPerformed(evt);
          }
        });

    txtAcceptableShift.setEditable(false);

    txtStandardDeviation.setEditable(false);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${standardDeviation}"),
            txtStandardDeviation,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    txtMeanShift.setEditable(false);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${mean}"),
            txtMeanShift,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${beanList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            eLProperty,
            tablePointList);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${x}"));
    columnBinding.setColumnName("X");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${y}"));
    columnBinding.setColumnName("Y");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${boundary}"));
    columnBinding.setColumnName("Boundary");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${linked}"));
    columnBinding.setColumnName("Linked");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${shiftDistance}"));
    columnBinding.setColumnName("Shift Distance");
    columnBinding.setColumnClass(Double.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            surveyPointListBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedBean}"),
            tablePointList,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tablePointList);
    tablePointList.getColumnModel().getColumn(0).setPreferredWidth(5);
    tablePointList
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title0")); // NOI18N
    tablePointList.getColumnModel().getColumn(1).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title1")); // NOI18N
    tablePointList.getColumnModel().getColumn(2).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title2")); // NOI18N
    tablePointList.getColumnModel().getColumn(3).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(3)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title3")); // NOI18N
    tablePointList.getColumnModel().getColumn(4).setPreferredWidth(20);
    tablePointList
        .getColumnModel()
        .getColumn(4)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title4")); // NOI18N
    tablePointList
        .getColumnModel()
        .getColumn(5)
        .setHeaderValue(
            bundle.getString("SurveyPointListPanel.tablePointList.columnModel.title5")); // NOI18N

    jLabel1.setText(bundle.getString("SurveyPointListPanel.jLabel1.text")); // NOI18N

    jLabel2.setText(bundle.getString("SurveyPointListPanel.jLabel2.text")); // NOI18N

    jLabel3.setText(bundle.getString("SurveyPointListPanel.jLabel3.text")); // NOI18N

    jLabel4.setText(bundle.getString("SurveyPointListPanel.jLabel4.text")); // NOI18N

    jLabel5.setText(bundle.getString("SurveyPointListPanel.jLabel5.text")); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(jLabel1)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtMeanShift,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        57,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addComponent(jLabel2)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtStandardDeviation,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        53,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(
                                        optionUrban,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        68,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(optionRural)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel5)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtAcceptableShift,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        53,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                564,
                                Short.MAX_VALUE)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(jLabel3)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        txtX,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        96,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(jLabel4)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        txtY,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        94,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGap(18, 18, 18)
                                    .addComponent(cmdAdd)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(cmdRemove)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                txtMeanShift,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtStandardDeviation,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(optionUrban)
                            .addComponent(optionRural)
                            .addComponent(
                                txtAcceptableShift,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(jLabel5))
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                txtY,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                txtX,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(cmdAdd)
                            .addComponent(cmdRemove)
                            .addComponent(jLabel3)
                            .addComponent(jLabel4))
                    .addGap(6, 6, 6)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 280, Short.MAX_VALUE)
                    .addContainerGap()));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #17
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    districtListBean = new org.sola.clients.beans.referencedata.DistrictListBean();
    vdcListBean = new org.sola.clients.beans.referencedata.VdcListBean();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    cbxDistricts = new javax.swing.JComboBox();
    jPanel4 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    cbxVdcs = new javax.swing.JComboBox();
    jPanel5 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    txtWardNo = new javax.swing.JTextField();
    jPanel6 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    txtParcelNo = new javax.swing.JTextField();
    btnCreate = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Create Property Code");
    setLocationByPlatform(true);
    setResizable(false);

    jLabel1.setText("District");

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${districts}");
    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            districtListBean,
            eLProperty,
            cbxDistricts);
    bindingGroup.addBinding(jComboBoxBinding);
    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            districtListBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedDistrict}"),
            cbxDistricts,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addGap(0, 106, Short.MAX_VALUE))
            .addComponent(cbxDistricts, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        cbxDistricts,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 16, Short.MAX_VALUE)));

    jLabel3.setText("Vdc");

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${vdcs}");
    jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            vdcListBean,
            eLProperty,
            cbxVdcs);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            vdcListBean,
            org.jdesktop.beansbinding.ELProperty.create("${selectedVdc}"),
            cbxVdcs,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addGap(0, 0, Short.MAX_VALUE))
            .addComponent(cbxVdcs, 0, 139, Short.MAX_VALUE));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        cbxVdcs,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 16, Short.MAX_VALUE)));

    jLabel4.setText("Ward No.");

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addGap(0, 93, Short.MAX_VALUE))
            .addComponent(txtWardNo));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtWardNo,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 17, Short.MAX_VALUE)));

    jLabel5.setText("Parcel No.");

    javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
    jPanel6.setLayout(jPanel6Layout);
    jPanel6Layout.setHorizontalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel6Layout
                    .createSequentialGroup()
                    .addComponent(jLabel5)
                    .addGap(0, 90, Short.MAX_VALUE))
            .addComponent(txtParcelNo));
    jPanel6Layout.setVerticalGroup(
        jPanel6Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel6Layout
                    .createSequentialGroup()
                    .addComponent(jLabel5)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtParcelNo,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(0, 17, Short.MAX_VALUE)));

    btnCreate.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/create.png"))); // NOI18N
    btnCreate.setText("Create & Close");
    btnCreate.setFocusable(false);
    btnCreate.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnCreate.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCreateActionPerformed(evt);
          }
        });

    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()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        jPanel1,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(
                                                        jPanel4,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(
                                                        jPanel5,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                                    .addGap(18, 18, 18)
                                                    .addComponent(
                                                        jPanel6,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(btnCreate)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jPanel4,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                jPanel5,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                jPanel6,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(btnCreate)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    java.awt.GridBagConstraints gridBagConstraints;
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    javax.swing.JLabel jLabel1 = new javax.swing.JLabel();
    txtName = new javax.swing.JTextField();
    javax.swing.JLabel jLabel2 = new javax.swing.JLabel();
    javax.swing.JScrollPane jScrollPane1 = new javax.swing.JScrollPane();
    txtSource = new javax.swing.JTextArea();
    javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
    btnApply = new javax.swing.JButton();
    btnCancel = new javax.swing.JButton();
    txtErrorMsg = new javax.swing.JLabel();

    setBorder(
        javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)),
            javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5)));
    setLayout(new java.awt.GridBagLayout());

    jLabel1.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    jLabel1.setText("Name:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    add(jLabel1, gridBagConstraints);

    txtName.setFont(new java.awt.Font("Lucida Sans", 0, 12)); // NOI18N
    txtName.setMinimumSize(new java.awt.Dimension(4, 25));
    txtName.setPreferredSize(new java.awt.Dimension(4, 25));

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${entityName}"),
            txtName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    binding.setValidator(new NameValidator());
    bindingGroup.addBinding(binding);

    txtName.addAncestorListener(
        new javax.swing.event.AncestorListener() {
          public void ancestorMoved(javax.swing.event.AncestorEvent evt) {}

          public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
            txtNameAncestorAdded(evt);
          }

          public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {}
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
    add(txtName, gridBagConstraints);

    jLabel2.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    jLabel2.setText("Source:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
    gridBagConstraints.insets = new java.awt.Insets(5, 0, 0, 0);
    add(jLabel2, gridBagConstraints);

    jScrollPane1.setMinimumSize(new java.awt.Dimension(223, 78));

    txtSource.setColumns(20);
    txtSource.setFont(new java.awt.Font("Lucida Sans", 0, 12)); // NOI18N
    txtSource.setRows(5);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${source}"),
            txtSource,
            org.jdesktop.beansbinding.BeanProperty.create("text_ON_ACTION_OR_FOCUS_LOST"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(txtSource);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    add(jScrollPane1, gridBagConstraints);

    btnApply.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    btnApply.setText("Apply");
    btnApply.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnApplyActionPerformed(evt);
          }
        });
    jPanel1.add(btnApply);

    btnCancel.setFont(new java.awt.Font("Lucida Sans", 0, 12));
    btnCancel.setText("Cancel");
    btnCancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelActionPerformed(evt);
          }
        });
    jPanel1.add(btnCancel);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 3;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    add(jPanel1, gridBagConstraints);

    txtErrorMsg.setFont(new java.awt.Font("Lucida Sans", 0, 10));
    txtErrorMsg.setForeground(new java.awt.Color(255, 102, 102));
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
    add(txtErrorMsg, gridBagConstraints);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
  private void llenarjTBalanceComprobacion() throws Exception {

    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    contabilidadBBMayorAuxiliar1 =
        new shrimp.contabilidad.beanbinding.ContabilidadBBMayorAuxiliar();
    /*
     * 101050101001 201070101004
     */
    obtenerRangoCuentas();
    List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleTOs =
        new java.util.ArrayList(1);
    List<contabilidad.TO.ConMayorAuxiliarTO> conMayorAuxiliarMultipleAuxTOs = null;
    contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleAuxTO = null;
    for (ConCuentasTO conCuentasTO : contabilidadBBCuentas.getListaConCuentasTO()) {
      contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO(
          shrimp.contabilidad.delegate.ContabilidadDelegate.getInstance()
              .getListaMayorAuxiliarTO(
                  sisUsuarioEmpresaTO.getEmpCodigo(),
                  conCuentasTO.getCuentaCodigo(),
                  fechaDesde,
                  fechaHasta,
                  codigoSector));
      conMayorAuxiliarMultipleAuxTOs = contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO();
      int posicion = 0;
      for (contabilidad.TO.ConMayorAuxiliarTO conMayorAuxiliarMultipleTO :
          conMayorAuxiliarMultipleAuxTOs) {
        if (posicion == 0) {
          conMayorAuxiliarMultipleTO.setMaContable(
              conCuentasTO.getCuentaCodigo() + " | " + conCuentasTO.getCuentaDetalle());
          conMayorAuxiliarMultipleTO.setMaCuenta("");
        } else {
          conMayorAuxiliarMultipleTO.setMaCuenta(conCuentasTO.getCuentaCodigo());
          conMayorAuxiliarMultipleTO.setMaCuentaDetalle(conCuentasTO.getCuentaDetalle());
        }
        conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleTO);
        posicion++;
      }
      conMayorAuxiliarMultipleAuxTO = new contabilidad.TO.ConMayorAuxiliarTO();
      conMayorAuxiliarMultipleTOs.add(conMayorAuxiliarMultipleAuxTO);
    }
    this.contabilidadBBMayorAuxiliar1.setListaConMayorAuxiliarTO(conMayorAuxiliarMultipleTOs);
    this.bindingGroup.bind();

    this.jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_ONCE,
            this.contabilidadBBMayorAuxiliar1.getListaConMayorAuxiliarTO(),
            jtable);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding0 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maContable}"));
    columnBinding0.setColumnName("Contable");
    columnBinding0.setColumnClass(String.class);
    columnBinding0.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding1 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maCuenta}"));
    columnBinding1.setColumnName("Cuenta");
    columnBinding1.setColumnClass(String.class);
    columnBinding1.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding2 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maCuentaDetalle}"));
    columnBinding2.setColumnName("Cuenta Detalle");
    columnBinding2.setColumnClass(String.class);
    columnBinding2.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding3 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maFecha}"));
    columnBinding3.setColumnName("Fecha");
    columnBinding3.setColumnClass(String.class);
    columnBinding3.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding4 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maDocumento}"));
    columnBinding4.setColumnName("Documento");
    columnBinding4.setColumnClass(String.class);
    columnBinding4.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding5 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maDebe}"));
    columnBinding5.setColumnName("Debe");
    columnBinding5.setColumnClass(java.math.BigDecimal.class);
    columnBinding5.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding6 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maHaber}"));
    columnBinding6.setColumnName("Haber");
    columnBinding6.setColumnClass(java.math.BigDecimal.class);
    columnBinding6.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding7 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maSaldo}"));
    columnBinding7.setColumnName("Saldo");
    columnBinding7.setColumnClass(java.math.BigDecimal.class);
    columnBinding7.setEditable(false);

    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding8 =
        this.jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${maObservaciones}"));
    columnBinding8.setColumnName("Observaciones");
    columnBinding8.setColumnClass(String.class);
    columnBinding8.setEditable(false);

    /// java.math.BigDecimal
    this.bindingGroup.addBinding(this.jTableBinding);
    this.bindingGroup.bind();

    jtable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    // Metemos el modelo ordenable en la tabla.
    javax.swing.table.TableRowSorter modeloOrdenado =
        new javax.swing.table.TableRowSorter(jtable.getModel());
    jtable.setRowSorter(modeloOrdenado);

    ///// PARA CAMBIAR EL ANCHO DE LAS COLUMNAS
    javax.swing.table.TableColumn col = null;
    col = jtable.getColumnModel().getColumn(0);
    col.setPreferredWidth(200);
    col = jtable.getColumnModel().getColumn(1);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(2);
    col.setPreferredWidth(100);
    col = jtable.getColumnModel().getColumn(3);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(4);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(5);
    col.setPreferredWidth(80);
    col = jtable.getColumnModel().getColumn(6);
    col.setPreferredWidth(400);
  }
Пример #20
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    radioDBv2PUEntityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory("radioDBv2PU")
                .createEntityManager();
    musicGroupQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : radioDBv2PUEntityManager.createQuery("SELECT m FROM MusicGroup m");
    musicGroupList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                musicGroupQuery.getResultList());
    jScrollPane1 = new javax.swing.JScrollPane();
    BandsTable = new javax.swing.JTable();
    jLabel1 = new javax.swing.JLabel();
    deleteBand = new javax.swing.JButton();
    addBand = new javax.swing.JButton();
    editBand = new javax.swing.JButton();
    exit = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Εγγραφή σε Μάθημα");

    BandsTable.setColumnSelectionAllowed(true);

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            musicGroupList,
            BandsTable);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${name}"));
    columnBinding.setColumnName("Επωνυμία");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${formationDate}"));
    columnBinding.setColumnName("Ημ/νία δημιουργίας");
    columnBinding.setColumnClass(java.util.Date.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    jScrollPane1.setViewportView(BandsTable);
    BandsTable.getColumnModel()
        .getSelectionModel()
        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);

    jLabel1.setFont(new java.awt.Font("DejaVu Sans", 0, 18)); // NOI18N
    jLabel1.setText("Πίνακας Συγκροτημάτων");

    deleteBand.setText("Διαγραφή");
    deleteBand.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteBandActionPerformed(evt);
          }
        });

    addBand.setText("Προσθήκη");
    addBand.setToolTipText("");
    addBand.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            addBandActionPerformed(evt);
          }
        });

    editBand.setText("Επεξεργασία");
    editBand.setToolTipText("");
    editBand.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            editBandActionPerformed(evt);
          }
        });

    exit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/exit.png"))); // NOI18N
    exit.setToolTipText("Έξοδος");
    exit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGap(26, 26, 26)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(158, 158, 158)
                                    .addComponent(jLabel1))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(addBand)
                                                    .addGap(37, 37, 37)
                                                    .addComponent(deleteBand)
                                                    .addGap(38, 38, 38)
                                                    .addComponent(editBand))
                                            .addComponent(
                                                jScrollPane1,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                546,
                                                javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        23,
                                        Short.MAX_VALUE)
                                    .addComponent(
                                        exit,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        59,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        299,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(addBand)
                                    .addComponent(editBand)
                                    .addComponent(deleteBand))
                            .addComponent(
                                exit,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                73,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(30, Short.MAX_VALUE)));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
Пример #21
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    popupUsers = new javax.swing.JPopupMenu();
    menuAddUser = new javax.swing.JMenuItem();
    menuEditUser = new javax.swing.JMenuItem();
    menuSetPassword = new javax.swing.JMenuItem();
    menuRemoveUser = new javax.swing.JMenuItem();
    groupsList = new org.sola.clients.beans.security.GroupSummaryListBean();
    userSearchParams = new org.sola.clients.beans.security.UserSearchParamsBean();
    userSearchResultList = new org.sola.clients.beans.security.UserSearchAdvancedResultListBean();
    pnlHeader = new org.sola.clients.swing.ui.HeaderPanel();
    pnlSearchCriteria = new javax.swing.JPanel();
    jPanel2 = new javax.swing.JPanel();
    jLabel2 = new javax.swing.JLabel();
    txtUsername = new javax.swing.JTextField();
    jPanel3 = new javax.swing.JPanel();
    txtFirstName = new javax.swing.JTextField();
    jLabel1 = new javax.swing.JLabel();
    jPanel4 = new javax.swing.JPanel();
    jLabel3 = new javax.swing.JLabel();
    txtLastName = new javax.swing.JTextField();
    jPanel5 = new javax.swing.JPanel();
    jLabel4 = new javax.swing.JLabel();
    comboGroups = new javax.swing.JComboBox();
    jPanel1 = new javax.swing.JPanel();
    jLabel5 = new javax.swing.JLabel();
    btnSearch = new javax.swing.JButton();
    toolbarUsers = new javax.swing.JToolBar();
    btnAddUser = new javax.swing.JButton();
    btnEditUser = new javax.swing.JButton();
    btnSetPassword = new javax.swing.JButton();
    btnRemoveUser = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    tableUsers = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles();

    popupUsers.setName("popupUsers"); // NOI18N

    menuAddUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    java.util.ResourceBundle bundle =
        java.util.ResourceBundle.getBundle(
            "org/sola/clients/swing/admin/security/Bundle"); // NOI18N
    menuAddUser.setText(bundle.getString("UsersManagementPanel.menuAddUser.text")); // NOI18N
    menuAddUser.setName("menuAddUser"); // NOI18N
    menuAddUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuAddUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuAddUser);

    menuEditUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    menuEditUser.setText(bundle.getString("UsersManagementPanel.menuEditUser.text")); // NOI18N
    menuEditUser.setName("menuEditUser"); // NOI18N
    menuEditUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuEditUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuEditUser);

    menuSetPassword.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/lock--pencil.png"))); // NOI18N
    menuSetPassword.setText(
        bundle.getString("UsersManagementPanel.menuSetPassword.text")); // NOI18N
    menuSetPassword.setName("menuSetPassword"); // NOI18N
    menuSetPassword.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuSetPasswordActionPerformed(evt);
          }
        });
    popupUsers.add(menuSetPassword);

    menuRemoveUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    menuRemoveUser.setText(bundle.getString("UsersManagementPanel.menuRemoveUser.text")); // NOI18N
    menuRemoveUser.setName("menuRemoveUser"); // NOI18N
    menuRemoveUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            menuRemoveUserActionPerformed(evt);
          }
        });
    popupUsers.add(menuRemoveUser);

    setHeaderPanel(pnlHeader);
    setMinimumSize(new java.awt.Dimension(200, 200));

    pnlHeader.setName("pnlHeader"); // NOI18N
    pnlHeader.setTitleText(bundle.getString("UsersManagementPanel.pnlHeader.titleText")); // NOI18N

    pnlSearchCriteria.setName("pnlSearchCriteria"); // NOI18N
    pnlSearchCriteria.setLayout(new java.awt.GridLayout(1, 4, 15, 0));

    jPanel2.setName(bundle.getString("UsersManagementPanel.jPanel2.name")); // NOI18N

    jLabel2.setText(bundle.getString("UsersManagementPanel.jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N

    txtUsername.setName("txtUsername"); // NOI18N
    txtUsername.setNextFocusableComponent(txtFirstName);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${userName}"),
            txtUsername,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addComponent(jLabel2)
                    .addGap(0, 53, Short.MAX_VALUE))
            .addComponent(txtUsername));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addComponent(jLabel2)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtUsername,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel2);

    jPanel3.setName(bundle.getString("UsersManagementPanel.jPanel3.name")); // NOI18N

    txtFirstName.setName("txtFirstName"); // NOI18N
    txtFirstName.setNextFocusableComponent(txtLastName);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${firstName}"),
            txtFirstName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    jLabel1.setText(bundle.getString("UsersManagementPanel.jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addGap(0, 51, Short.MAX_VALUE))
            .addComponent(txtFirstName));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addComponent(jLabel1)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtFirstName,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel3);

    jPanel4.setName(bundle.getString("UsersManagementPanel.jPanel4.name")); // NOI18N

    jLabel3.setText(bundle.getString("UsersManagementPanel.jLabel3.text")); // NOI18N
    jLabel3.setName("jLabel3"); // NOI18N

    txtLastName.setName("txtLastName"); // NOI18N
    txtLastName.setNextFocusableComponent(comboGroups);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${lastName}"),
            txtLastName,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addGap(0, 52, Short.MAX_VALUE))
            .addComponent(txtLastName));
    jPanel4Layout.setVerticalGroup(
        jPanel4Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel4Layout
                    .createSequentialGroup()
                    .addComponent(jLabel3)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        txtLastName,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel4);

    jPanel5.setName(bundle.getString("UsersManagementPanel.jPanel5.name")); // NOI18N

    jLabel4.setText(bundle.getString("UsersManagementPanel.jLabel4.text")); // NOI18N
    jLabel4.setName("jLabel4"); // NOI18N

    comboGroups.setName("comboGroups"); // NOI18N
    comboGroups.setNextFocusableComponent(btnSearch);

    org.jdesktop.beansbinding.ELProperty eLProperty =
        org.jdesktop.beansbinding.ELProperty.create("${groupSummaryList}");
    org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding =
        org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            groupsList,
            eLProperty,
            comboGroups);
    bindingGroup.addBinding(jComboBoxBinding);
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchParams,
            org.jdesktop.beansbinding.ELProperty.create("${groupBean}"),
            comboGroups,
            org.jdesktop.beansbinding.BeanProperty.create("selectedItem"));
    bindingGroup.addBinding(binding);

    javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addGap(0, 67, Short.MAX_VALUE))
            .addComponent(comboGroups, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
    jPanel5Layout.setVerticalGroup(
        jPanel5Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel5Layout
                    .createSequentialGroup()
                    .addComponent(jLabel4)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        comboGroups,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)));

    pnlSearchCriteria.add(jPanel5);

    jPanel1.setName(bundle.getString("UsersManagementPanel.jPanel1.name")); // NOI18N

    jLabel5.setText(bundle.getString("UsersManagementPanel.jLabel5.text")); // NOI18N
    jLabel5.setName(bundle.getString("UsersManagementPanel.jLabel5.name")); // NOI18N

    btnSearch.setText(bundle.getString("UsersManagementPanel.btnSearch.text")); // NOI18N
    btnSearch.setName("btnSearch"); // NOI18N
    btnSearch.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSearchActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addComponent(jLabel5)
                    .addGap(0, 0, Short.MAX_VALUE))
            .addComponent(btnSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 86, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addComponent(jLabel5)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(btnSearch)));

    toolbarUsers.setFloatable(false);
    toolbarUsers.setRollover(true);
    toolbarUsers.setName("toolbarUsers"); // NOI18N

    btnAddUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/add.png"))); // NOI18N
    btnAddUser.setText(bundle.getString("UsersManagementPanel.btnAddUser.text")); // NOI18N
    btnAddUser.setFocusable(false);
    btnAddUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnAddUser.setName("btnAddUser"); // NOI18N
    btnAddUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnAddUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAddUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnAddUser);

    btnEditUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/pencil.png"))); // NOI18N
    btnEditUser.setText(bundle.getString("UsersManagementPanel.btnEditUser.text")); // NOI18N
    btnEditUser.setFocusable(false);
    btnEditUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnEditUser.setName("btnEditUser"); // NOI18N
    btnEditUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnEditUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnEditUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnEditUser);

    btnSetPassword.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/images/common/lock--pencil.png"))); // NOI18N
    btnSetPassword.setText(bundle.getString("UsersManagementPanel.btnSetPassword.text")); // NOI18N
    btnSetPassword.setFocusable(false);
    btnSetPassword.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnSetPassword.setName("btnSetPassword"); // NOI18N
    btnSetPassword.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnSetPassword.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSetPasswordActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnSetPassword);

    btnRemoveUser.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/images/common/remove.png"))); // NOI18N
    btnRemoveUser.setText(bundle.getString("UsersManagementPanel.btnRemoveUser.text")); // NOI18N
    btnRemoveUser.setFocusable(false);
    btnRemoveUser.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
    btnRemoveUser.setName("btnRemoveUser"); // NOI18N
    btnRemoveUser.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    btnRemoveUser.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnRemoveUserActionPerformed(evt);
          }
        });
    toolbarUsers.add(btnRemoveUser);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tableUsers.setComponentPopupMenu(popupUsers);
    tableUsers.setName("tableUsers"); // NOI18N

    eLProperty = org.jdesktop.beansbinding.ELProperty.create("${usersList}");
    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchResultList,
            eLProperty,
            tableUsers);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${userName}"));
    columnBinding.setColumnName("Username");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${firstName}"));
    columnBinding.setColumnName("First name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${lastName}"));
    columnBinding.setColumnName("Last name");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${groupsList}"));
    columnBinding.setColumnName("Groups");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${active}"));
    columnBinding.setColumnName("Active");
    columnBinding.setColumnClass(Boolean.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            userSearchResultList,
            org.jdesktop.beansbinding.ELProperty.create("${selectedUser}"),
            tableUsers,
            org.jdesktop.beansbinding.BeanProperty.create("selectedElement"));
    bindingGroup.addBinding(binding);

    jScrollPane1.setViewportView(tableUsers);
    tableUsers.getColumnModel().getColumn(3).setCellRenderer(new TableCellTextAreaRenderer());
    tableUsers.getColumnModel().getColumn(4).setCellRenderer(new TableCellTextAreaRenderer());
    tableUsers.getColumnModel().getColumn(5).setMaxWidth(50);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                pnlHeader,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(
                                        pnlSearchCriteria,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        0,
                                        Short.MAX_VALUE)
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(
                                        jPanel1,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(
                                toolbarUsers,
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jScrollPane1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                563,
                                Short.MAX_VALUE))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        pnlHeader,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                pnlSearchCriteria,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        toolbarUsers,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        25,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
                    .addContainerGap()));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #22
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    EntityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory("proyectoPU")
                .createEntityManager();
    Query =
        java.beans.Beans.isDesignTime()
            ? null
            : EntityManager.createQuery("SELECT a FROM Actividad a");
    List =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : org.jdesktop.observablecollections.ObservableCollections.observableList(
                Query.getResultList());
    panel_EditarAct = new javax.swing.JPanel();
    lbl_EditarAct = new javax.swing.JLabel();
    jPanel1 = new javax.swing.JPanel();
    lbl_nombre = new javax.swing.JLabel();
    tf_nombre = new javax.swing.JTextField();
    lbl_codigo = new javax.swing.JLabel();
    tf_codigo = new javax.swing.JTextField();
    jPanel2 = new javax.swing.JPanel();
    btn_cancelar = new javax.swing.JButton();
    btn_eliminar = new javax.swing.JButton();
    jPanel3 = new javax.swing.JPanel();
    tf_valor = new javax.swing.JTextField();
    lbl_valor = new javax.swing.JLabel();
    lbl_filtro = new javax.swing.JLabel();
    list_filtros = new javax.swing.JComboBox();
    btn_buscar = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    masterTable = new javax.swing.JTable();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

    panel_EditarAct.setBackground(new java.awt.Color(0, 153, 255));
    panel_EditarAct.setBorder(
        javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));

    lbl_EditarAct.setFont(new java.awt.Font("Corbel", 1, 30)); // NOI18N
    lbl_EditarAct.setForeground(new java.awt.Color(255, 255, 255));
    lbl_EditarAct.setText("Eliminar Actividad");

    javax.swing.GroupLayout panel_EditarActLayout = new javax.swing.GroupLayout(panel_EditarAct);
    panel_EditarAct.setLayout(panel_EditarActLayout);
    panel_EditarActLayout.setHorizontalGroup(
        panel_EditarActLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                panel_EditarActLayout
                    .createSequentialGroup()
                    .addGap(139, 139, 139)
                    .addComponent(lbl_EditarAct)
                    .addContainerGap(141, Short.MAX_VALUE)));
    panel_EditarActLayout.setVerticalGroup(
        panel_EditarActLayout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                panel_EditarActLayout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(lbl_EditarAct)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    jPanel1.setBackground(new java.awt.Color(204, 204, 204));
    jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    lbl_nombre.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N
    lbl_nombre.setText("Nombre:");

    tf_nombre.setEditable(false);
    tf_nombre.setBackground(new java.awt.Color(0, 153, 255));
    tf_nombre.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    tf_nombre.setForeground(new java.awt.Color(255, 255, 255));
    tf_nombre.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            tf_nombreActionPerformed(evt);
          }
        });
    tf_nombre.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            tf_nombreFocusLost(evt);
          }
        });
    tf_nombre.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_nombreKeyTyped(evt);
          }
        });

    lbl_codigo.setFont(new java.awt.Font("Candara", 1, 14)); // NOI18N
    lbl_codigo.setText("Código:");

    tf_codigo.setEditable(false);
    tf_codigo.setBackground(new java.awt.Color(0, 153, 255));
    tf_codigo.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
    tf_codigo.setForeground(new java.awt.Color(255, 255, 255));

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addGap(47, 47, 47)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(lbl_nombre)
                            .addComponent(lbl_codigo))
                    .addGap(32, 32, 32)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                tf_codigo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                66,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                tf_nombre,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                240,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_codigo)
                            .addComponent(
                                tf_codigo,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31, Short.MAX_VALUE)
                    .addGroup(
                        jPanel1Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_nombre)
                            .addComponent(
                                tf_nombre,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(24, 24, 24)));

    jPanel2.setBackground(new java.awt.Color(204, 204, 204));
    jPanel2.setBorder(javax.swing.BorderFactory.createEtchedBorder());

    btn_cancelar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/delete.png"))); // NOI18N
    btn_cancelar.setText("Cancelar");
    btn_cancelar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btn_cancelarActionPerformed(evt);
          }
        });

    btn_eliminar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/trash.png"))); // NOI18N
    btn_eliminar.setText("Eliminar");
    btn_eliminar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btn_eliminarActionPerformed(evt);
          }
        });

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addGap(23, 23, 23)
                    .addComponent(btn_eliminar)
                    .addPreferredGap(
                        javax.swing.LayoutStyle.ComponentPlacement.RELATED, 52, Short.MAX_VALUE)
                    .addComponent(btn_cancelar)
                    .addGap(19, 19, 19)));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel2Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel2Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                jPanel2Layout
                                    .createSequentialGroup()
                                    .addComponent(btn_cancelar)
                                    .addGap(0, 0, Short.MAX_VALUE))
                            .addComponent(
                                btn_eliminar,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addContainerGap()));

    jPanel3.setBackground(new java.awt.Color(204, 204, 204));
    jPanel3.setBorder(javax.swing.BorderFactory.createEtchedBorder());
    jPanel3.setForeground(new java.awt.Color(204, 204, 255));

    tf_valor.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            tf_valorKeyTyped(evt);
          }
        });

    lbl_valor.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_valor.setText("Valor:");

    lbl_filtro.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N
    lbl_filtro.setText("Buscar por:");

    list_filtros.setModel(
        new javax.swing.DefaultComboBoxModel(new String[] {"Código", "Descripción"}));
    list_filtros.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            list_filtrosActionPerformed(evt);
          }
        });
    list_filtros.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusGained(java.awt.event.FocusEvent evt) {
            list_filtrosFocusGained(evt);
          }
        });

    btn_buscar.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagenes/zoom.png"))); // NOI18N
    btn_buscar.setText("Buscar");
    btn_buscar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btn_buscarActionPerformed(evt);
          }
        });
    btn_buscar.addFocusListener(
        new java.awt.event.FocusAdapter() {
          public void focusLost(java.awt.event.FocusEvent evt) {
            btn_buscarFocusLost(evt);
          }
        });

    javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(lbl_filtro)
                    .addGap(18, 18, 18)
                    .addComponent(
                        list_filtros,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        94,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(26, 26, 26)
                    .addComponent(lbl_valor)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addComponent(
                        tf_valor,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        142,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(btn_buscar)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    jPanel3Layout.setVerticalGroup(
        jPanel3Layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                jPanel3Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        jPanel3Layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(lbl_filtro)
                            .addComponent(lbl_valor)
                            .addComponent(
                                list_filtros,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                tf_valor,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(btn_buscar))
                    .addContainerGap()));

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, List, masterTable);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${codActividad}"));
    columnBinding.setColumnName("Actividad");
    columnBinding.setColumnClass(Integer.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nombre}"));
    columnBinding.setColumnName("Nombre");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    masterTable.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            masterTableMouseClicked(evt);
          }
        });
    jScrollPane1.setViewportView(masterTable);
    if (masterTable.getColumnModel().getColumnCount() > 0) {
      masterTable.getColumnModel().getColumn(0).setPreferredWidth(15);
    }

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(37, 37, 37)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                jPanel3,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                519,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                panel_EditarAct,
                                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(148, 148, 148)
                                    .addComponent(
                                        jPanel2,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(0, 39, Short.MAX_VALUE))
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(
                                jPanel1,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(jScrollPane1))
                    .addGap(71, 71, 71)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addComponent(
                        panel_EditarAct,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jPanel3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        150,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jPanel1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(
                        jPanel2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        javax.swing.GroupLayout.DEFAULT_SIZE,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(23, Short.MAX_VALUE)));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    javax.swing.JSplitPane jSplitPane1 = new javax.swing.JSplitPane();
    jSplitPane2 = new javax.swing.JSplitPane();
    javax.swing.JPanel jPanel2 = new javax.swing.JPanel();
    javax.swing.JPanel jPanel3 = new javax.swing.JPanel();
    btnReloadXml = new javax.swing.JButton();
    btnSaveXml = new javax.swing.JButton();
    btnClearXml = new javax.swing.JButton();
    xmlContainer = new javax.swing.JPanel();
    javax.swing.JScrollPane xmlScrollpane = new javax.swing.JScrollPane();
    txtXml = new org.fife.ui.rsyntaxtextarea.RSyntaxTextArea();
    jPanel4 = new javax.swing.JPanel();
    jPanel5 = new javax.swing.JPanel();
    btnPrevResult = new javax.swing.JButton();
    lblResultIndex = new javax.swing.JLabel();
    btnNextResult = new javax.swing.JButton();
    javax.swing.JScrollPane outputScrollpane = new javax.swing.JScrollPane();
    txtOutput = new javax.swing.JEditorPane();
    javax.swing.JScrollPane jScrollPane2 = new javax.swing.JScrollPane();
    txtConcatedResult = new javax.swing.JTextPane();
    javax.swing.JPanel bottomPanel = new javax.swing.JPanel();
    txtInput = new javax.swing.JTextField();
    javax.swing.JPanel jPanel1 = new javax.swing.JPanel();
    btnMatch = new javax.swing.JButton();

    setLayout(new java.awt.BorderLayout());

    jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
    jSplitPane1.setResizeWeight(1.0);

    jSplitPane2.setResizeWeight(1.0);

    jPanel2.setLayout(new java.awt.BorderLayout());

    btnReloadXml.setText("Reload");
    btnReloadXml.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnReloadXmlActionPerformed(evt);
          }
        });
    jPanel3.add(btnReloadXml);

    btnSaveXml.setText("Save & Compile");
    btnSaveXml.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSaveXmlActionPerformed(evt);
          }
        });
    jPanel3.add(btnSaveXml);

    btnClearXml.setText("Clear");
    btnClearXml.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnClearXmlActionPerformed(evt);
          }
        });
    jPanel3.add(btnClearXml);

    jPanel2.add(jPanel3, java.awt.BorderLayout.PAGE_START);

    xmlContainer.setBackground(new java.awt.Color(255, 153, 153));
    xmlContainer.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 2, 2, 2));

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${xmlTextIsDirty}"),
            xmlContainer,
            org.jdesktop.beansbinding.BeanProperty.create("opaque"));
    bindingGroup.addBinding(binding);

    xmlContainer.addPropertyChangeListener(
        new java.beans.PropertyChangeListener() {
          public void propertyChange(java.beans.PropertyChangeEvent evt) {
            xmlContainerPropertyChange(evt);
          }
        });
    xmlContainer.setLayout(new java.awt.BorderLayout());

    txtXml.setColumns(20);
    txtXml.setRows(5);
    txtXml.setSyntaxEditingStyle("text/xml");

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${xmlString}"),
            txtXml,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    xmlScrollpane.setViewportView(txtXml);

    xmlContainer.add(xmlScrollpane, java.awt.BorderLayout.CENTER);

    jPanel2.add(xmlContainer, java.awt.BorderLayout.CENTER);

    jSplitPane2.setLeftComponent(jPanel2);

    jPanel4.setLayout(new java.awt.BorderLayout());

    jPanel5.setMinimumSize(new java.awt.Dimension(300, 36));
    jPanel5.setPreferredSize(new java.awt.Dimension(300, 36));

    btnPrevResult.setText("Prev");
    btnPrevResult.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnPrevResultActionPerformed(evt);
          }
        });
    jPanel5.add(btnPrevResult);

    lblResultIndex.setText("<empty>");
    lblResultIndex.setMaximumSize(new java.awt.Dimension(50, 16));
    lblResultIndex.setMinimumSize(new java.awt.Dimension(50, 16));
    lblResultIndex.setPreferredSize(new java.awt.Dimension(50, 16));
    jPanel5.add(lblResultIndex);

    btnNextResult.setText("Next");
    btnNextResult.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnNextResultActionPerformed(evt);
          }
        });
    jPanel5.add(btnNextResult);

    jPanel4.add(jPanel5, java.awt.BorderLayout.PAGE_START);

    txtOutput.setEditable(false);
    outputScrollpane.setViewportView(txtOutput);

    jPanel4.add(outputScrollpane, java.awt.BorderLayout.CENTER);

    jScrollPane2.setPreferredSize(new java.awt.Dimension(9, 50));

    txtConcatedResult.setEditable(false);
    jScrollPane2.setViewportView(txtConcatedResult);

    jPanel4.add(jScrollPane2, java.awt.BorderLayout.SOUTH);

    jSplitPane2.setRightComponent(jPanel4);

    jSplitPane1.setLeftComponent(jSplitPane2);

    bottomPanel.setLayout(new java.awt.BorderLayout());

    txtInput.setText("*");
    bottomPanel.add(txtInput, java.awt.BorderLayout.CENTER);

    jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));

    btnMatch.setText("Match");
    btnMatch.setPreferredSize(new java.awt.Dimension(70, 30));
    btnMatch.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnMatchActionPerformed(evt);
          }
        });
    jPanel1.add(btnMatch);

    bottomPanel.add(jPanel1, java.awt.BorderLayout.EAST);

    jSplitPane1.setRightComponent(bottomPanel);

    add(jSplitPane1, java.awt.BorderLayout.CENTER);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #24
0
  /**
   * Este método é invocado pelo construtor e seu objetivo é inicializar o form. WARNING: Não
   * modifique este código. O seu conteúdo é automaticamente regerado pelo editor visual do
   * formulário.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    listTipoContrato = ObservableCollections.observableList(new TipoContratoDao().listAll());
    tipoContratoBean = new br.com.etec.model.TipoContrato();
    paneltitulo = new javax.swing.JPanel();
    lblTitulo = new javax.swing.JLabel();
    panelTable = new javax.swing.JPanel();
    scrollTable = new javax.swing.JScrollPane();
    tbTipoContrato = new javax.swing.JTable();
    tbTipoContrato
        .getSelectionModel()
        .addListSelectionListener(
            new ListSelectionListener() {
              @Override
              public void valueChanged(ListSelectionEvent evt) {
                if (tbTipoContrato.getSelectedRow() != -1) {
                  tipoContratoBean = listTipoContrato.get(tbTipoContrato.getSelectedRow());
                  btnAlterar.setEnabled(Boolean.TRUE);
                  btnExcluir.setEnabled(Boolean.TRUE);
                } else {
                  tipoContratoBean = null;
                  btnAlterar.setEnabled(Boolean.FALSE);
                  btnExcluir.setEnabled(Boolean.FALSE);
                }
              }
            });
    panelDados = new javax.swing.JPanel();
    btnPrimeiro = new javax.swing.JButton();
    btnAnterior = new javax.swing.JButton();
    btnProximo = new javax.swing.JButton();
    btnUltimo = new javax.swing.JButton();
    jScrollPane2 = new javax.swing.JScrollPane();
    lblRecordInfo = new javax.swing.JTextArea();
    lblId = new javax.swing.JLabel();
    txtId = new javax.swing.JTextField();
    lblNome = new javax.swing.JLabel();
    btnAlterar = new javax.swing.JButton();
    btnSalvar = new javax.swing.JButton();
    btnCancelar = new javax.swing.JButton();
    txtNome = new javax.swing.JTextField();
    btnIncluir = new javax.swing.JButton();
    btnExcluir = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(false);
    getContentPane().setLayout(new java.awt.GridBagLayout());

    paneltitulo.setPreferredSize(new java.awt.Dimension(1198, 40));
    paneltitulo.setLayout(new java.awt.GridBagLayout());

    lblTitulo.setFont(new java.awt.Font("Tahoma", 1, 18)); // NOI18N
    lblTitulo.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    lblTitulo.setText("Tipos de Contrato");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.insets = new java.awt.Insets(20, 20, 0, 20);
    paneltitulo.add(lblTitulo, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 10, 20);
    getContentPane().add(paneltitulo, gridBagConstraints);

    panelTable.setLayout(new java.awt.GridBagLayout());

    tbTipoContrato.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            listTipoContrato,
            tbTipoContrato);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(Integer.class);
    columnBinding.setEditable(false);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${nome}"));
    columnBinding.setColumnName("Nome");
    columnBinding.setColumnClass(String.class);
    columnBinding.setEditable(false);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    scrollTable.setViewportView(tbTipoContrato);
    tbTipoContrato
        .getColumnModel()
        .getSelectionModel()
        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tbTipoContrato.getColumnModel().getColumn(0).setResizable(false);
    tbTipoContrato.getColumnModel().getColumn(0).setPreferredWidth(50);
    tbTipoContrato.getColumnModel().getColumn(1).setResizable(false);
    tbTipoContrato.getColumnModel().getColumn(1).setPreferredWidth(250);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipady = 160;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    panelTable.add(scrollTable, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 10, 20);
    getContentPane().add(panelTable, gridBagConstraints);

    panelDados.setLayout(new java.awt.GridBagLayout());

    btnPrimeiro.setText("|<<");
    btnPrimeiro.setToolTipText("Primeiro Registro");
    btnPrimeiro.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnPrimeiroActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 2;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 38, 0, 0);
    panelDados.add(btnPrimeiro, gridBagConstraints);

    btnAnterior.setText("<");
    btnAnterior.setToolTipText("Registro Anterior");
    btnAnterior.setMaximumSize(new java.awt.Dimension(53, 23));
    btnAnterior.setMinimumSize(new java.awt.Dimension(53, 23));
    btnAnterior.setPreferredSize(new java.awt.Dimension(53, 23));
    btnAnterior.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAnteriorActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 2;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 7;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnAnterior, gridBagConstraints);

    btnProximo.setText(">");
    btnProximo.setToolTipText("Próximo Registro");
    btnProximo.setMaximumSize(new java.awt.Dimension(53, 23));
    btnProximo.setMinimumSize(new java.awt.Dimension(53, 23));
    btnProximo.setPreferredSize(new java.awt.Dimension(53, 23));
    btnProximo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnProximoActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 13;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 11;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnProximo, gridBagConstraints);

    btnUltimo.setText(">>|");
    btnUltimo.setToolTipText("Último Registro");
    btnUltimo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnUltimoActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 32;
    gridBagConstraints.gridy = 6;
    gridBagConstraints.gridwidth = 65;
    gridBagConstraints.ipadx = 12;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(11, 6, 0, 0);
    panelDados.add(btnUltimo, gridBagConstraints);

    lblRecordInfo.setEditable(false);
    lblRecordInfo.setBackground(javax.swing.UIManager.getDefaults().getColor("Label.background"));
    lblRecordInfo.setColumns(20);
    lblRecordInfo.setFont(new java.awt.Font("Tahoma", 1, 10)); // NOI18N
    lblRecordInfo.setLineWrap(true);
    lblRecordInfo.setRows(2);
    lblRecordInfo.setDisabledTextColor(new java.awt.Color(0, 0, 0));
    lblRecordInfo.setEnabled(false);
    jScrollPane2.setViewportView(lblRecordInfo);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 7;
    gridBagConstraints.gridwidth = 98;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.ipadx = 311;
    gridBagConstraints.ipady = 20;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(6, 10, 0, 10);
    panelDados.add(jScrollPane2, gridBagConstraints);

    lblId.setText("Id:");
    lblId.setToolTipText("");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(13, 77, 0, 0);
    panelDados.add(lblId, gridBagConstraints);

    txtId.setDisabledTextColor(new java.awt.Color(0, 0, 0));
    txtId.setEnabled(false);

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            tbTipoContrato,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.id}"),
            txtId,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.gridwidth = 55;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 178;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(10, 4, 0, 0);
    panelDados.add(txtId, gridBagConstraints);

    lblNome.setText("Nome:");
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 60, 0, 0);
    panelDados.add(lblNome, gridBagConstraints);

    btnAlterar.setText("Alterar");
    btnAlterar.setActionCommand("ListarCargoView.alterar");
    btnAlterar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnAlterarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 4;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 10;
    gridBagConstraints.ipadx = 18;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 10, 0, 0);
    panelDados.add(btnAlterar, gridBagConstraints);

    btnSalvar.setText("Salvar");
    btnSalvar.setActionCommand("ListarCargoView.salvar");
    btnSalvar.setEnabled(false);
    btnSalvar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnSalvarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 5;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 88, 0, 0);
    panelDados.add(btnSalvar, gridBagConstraints);

    btnCancelar.setText("Cancelar");
    btnCancelar.setActionCommand("ListarCargoView.cancelar");
    btnCancelar.setEnabled(false);
    btnCancelar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnCancelarActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 8;
    gridBagConstraints.gridy = 5;
    gridBagConstraints.gridwidth = 25;
    gridBagConstraints.ipadx = 10;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(6, 6, 0, 0);
    panelDados.add(btnCancelar, gridBagConstraints);

    txtNome.setDisabledTextColor(new java.awt.Color(0, 0, 0));

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            tbTipoContrato,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement.nome}"),
            txtNome,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.gridwidth = 97;
    gridBagConstraints.gridheight = 2;
    gridBagConstraints.ipadx = 243;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(3, 4, 0, 10);
    panelDados.add(txtNome, gridBagConstraints);

    btnIncluir.setText("Incluir");
    btnIncluir.setActionCommand("incluir");
    btnIncluir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnIncluirActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 3;
    gridBagConstraints.ipadx = 22;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 38, 0, 0);
    panelDados.add(btnIncluir, gridBagConstraints);

    btnExcluir.setText("Excluir");
    btnExcluir.setActionCommand("ListarCargoView.excluir");
    btnExcluir.setPreferredSize(new java.awt.Dimension(65, 23));
    btnExcluir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            btnExcluirActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 23;
    gridBagConstraints.gridy = 4;
    gridBagConstraints.gridwidth = 64;
    gridBagConstraints.ipadx = 20;
    gridBagConstraints.ipady = 3;
    gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
    gridBagConstraints.insets = new java.awt.Insets(16, 10, 0, 0);
    panelDados.add(btnExcluir, gridBagConstraints);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 2;
    gridBagConstraints.insets = new java.awt.Insets(10, 20, 20, 20);
    getContentPane().add(panelDados, gridBagConstraints);

    bindingGroup.bind();

    java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
    setBounds((screenSize.width - 610) / 2, (screenSize.height - 576) / 2, 610, 576);
  } // </editor-fold>//GEN-END:initComponents
Пример #25
0
  public RTextField createRGGElement(Element element, RGG rggInstance) {
    if (element.getNodeType() != Element.ELEMENT_NODE) {
      throw new IllegalArgumentException("elements node type must be ELEMENT_NODE");
    }

    RTextField rtextfield = new RTextField();
    VTextField vtextfield = new VTextField();

    /**
     * **************** initialize and set attributes values *************************************
     */
    String var = element.getAttribute(RGG.getConfiguration().getString("VAR"));
    String label = element.getAttribute(RGG.getConfiguration().getString("LABEL"));
    String colspan = element.getAttribute(RGG.getConfiguration().getString("COLUMN-SPAN"));
    String defaultvalue = element.getAttribute(RGG.getConfiguration().getString("DEFAULT-VALUE"));
    String datatype = element.getAttribute(RGG.getConfiguration().getString("DATA-TYPE"));
    String size = element.getAttribute(RGG.getConfiguration().getString("SIZE"));
    String enabled = element.getAttribute(RGG.getConfiguration().getString("ENABLED"));
    /**
     * ********************************************************************************************
     */
    if (StringUtils.isNotBlank(var)) {
      rtextfield.setVar(var);
    }

    if (StringUtils.isNotBlank(label)) {
      rtextfield.setLabel(label);
    }

    vtextfield.setLabelText(rtextfield.getLabel());

    if (StringUtils.isNotBlank(colspan)) {
      if (StringUtils.isNumeric(colspan)) {
        vtextfield.setColumnSpan(Integer.parseInt(colspan));
      } else if (StringUtils.equals(colspan, RGG.getConfiguration().getString("FULL-SPAN"))) {
        vtextfield.setColumnSpan(LayoutInfo.FULL_SPAN);
      } else {
        throw new NumberFormatException(
            RGG.getConfiguration().getString("COLUMN-SPAN")
                + " seems not to be a number: "
                + colspan
                + "nor a known keyword!");
      }
    }

    if (StringUtils.isNotBlank(defaultvalue)) {
      vtextfield.setDefaultvalue(defaultvalue);
    }

    if (StringUtils.isNotBlank(datatype)) {
      if (StringUtils.equalsIgnoreCase(RGG.getConfiguration().getString("NUMERIC"), datatype)) {
        vtextfield.setNumeric(true);
      }
    }

    if (StringUtils.isNotBlank(size) && StringUtils.isNumeric(size)) {
      vtextfield.setColumns(Integer.parseInt(size));
    }

    if (StringUtils.isNotBlank(enabled)) {
      if (util.match("/(\\w+)\\./", enabled)) {
        String id = util.group(1);
        enabled = util.substitute("s/" + id + "\\.//g", enabled);
        AutoBinding<Object, Object, Object, Object> binding =
            Bindings.createAutoBinding(
                AutoBinding.UpdateStrategy.READ, // one-way binding
                rggInstance.getObject(id), // source of value
                ELProperty.create(enabled), // the property to get
                vtextfield, // the "backing bean"
                BeanProperty.create("enabled") // property to set
                );
        binding.bind();
      }
    }

    rtextfield.setTextfield(vtextfield);
    return rtextfield;
  }
Пример #26
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    JollydaysBuchhaltungPUJollydaysEntityManager =
        java.beans.Beans.isDesignTime()
            ? null
            : javax.persistence.Persistence.createEntityManagerFactory(
                    "JollydaysBuchhaltungPUJollydays")
                .createEntityManager();
    buhaAreaQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery("SELECT b FROM BuhaArea b");
    buhaAreaList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : buhaAreaQuery.getResultList();
    buhaAreaQuery1 =
        java.beans.Beans.isDesignTime()
            ? null
            : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery("SELECT b FROM BuhaArea b");
    buhaAreaList1 =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : buhaAreaQuery1.getResultList();
    buhaBookingQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery(
                "SELECT b FROM BuhaBooking b");
    buhaBookingList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : buhaBookingQuery.getResultList();
    buhaFilterQuery =
        java.beans.Beans.isDesignTime()
            ? null
            : JollydaysBuchhaltungPUJollydaysEntityManager.createQuery(
                "SELECT b FROM BuhaFilter b");
    buhaFilterList =
        java.beans.Beans.isDesignTime()
            ? java.util.Collections.emptyList()
            : buhaFilterQuery.getResultList();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTableArea = new javax.swing.JTable();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableBooking = new javax.swing.JTable();
    jButtonDelArea = new javax.swing.JButton();
    jButtonNewArea = new javax.swing.JButton();
    jButtonSaveBooking = new javax.swing.JButton();
    jButtonRefreshBooking = new javax.swing.JButton();
    jButtonDelBooking = new javax.swing.JButton();
    jButtonNewBooking = new javax.swing.JButton();
    jScrollPane3 = new javax.swing.JScrollPane();
    jTableFilter = new javax.swing.JTable();
    jButtonSaveFilter = new javax.swing.JButton();
    jButtonRefreshFilter = new javax.swing.JButton();
    jButtonDelFilter = new javax.swing.JButton();
    jButtonNewFilter = new javax.swing.JButton();

    setName("Form"); // NOI18N

    jScrollPane2.setName("jScrollPane2"); // NOI18N

    jTableArea.setName("jTableArea"); // NOI18N

    org.jdesktop.swingbinding.JTableBinding jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            buhaAreaList,
            jTableArea);
    org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${id}"));
    columnBinding.setColumnName("Id");
    columnBinding.setColumnClass(Integer.class);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    jScrollPane2.setViewportView(jTableArea);

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    jTableBooking.setName("jTableBooking"); // NOI18N

    jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            buhaBookingList,
            jTableBooking);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${kontosoll}"));
    columnBinding.setColumnName("Konto Soll");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${kontohaben}"));
    columnBinding.setColumnName("Kontohaben");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${debitor}"));
    columnBinding.setColumnName("Debitor");
    columnBinding.setColumnClass(Short.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${creditor}"));
    columnBinding.setColumnName("Creditor");
    columnBinding.setColumnClass(Short.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${buchungscode}"));
    columnBinding.setColumnName("Buchungscode");
    columnBinding.setColumnClass(Short.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${steuersatz}"));
    columnBinding.setColumnName("Steuersatz");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${gutscheinfilter}"));
    columnBinding.setColumnName("Gutscheinfilter");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${bookingtype}"));
    columnBinding.setColumnName("Bookingtype");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${buhaCountry}"));
    columnBinding.setColumnName("Buha Country");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${webCountry}"));
    columnBinding.setColumnName("Web Country");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    jScrollPane1.setViewportView(jTableBooking);
    org.jdesktop.application.ResourceMap resourceMap =
        org.jdesktop.application.Application.getInstance(at.jollydays.booking.ui.MainUI.class)
            .getContext()
            .getResourceMap(JPanelKonfigER.class);
    jTableBooking
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title1")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title2")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(3)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title3")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(4)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title4")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(5)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title5")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(6)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title6")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(7)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title7")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(8)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title8")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(9)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title9")); // NOI18N
    jTableBooking
        .getColumnModel()
        .getColumn(10)
        .setHeaderValue(resourceMap.getString("jTableBooking.columnModel.title10")); // NOI18N

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance(at.jollydays.booking.ui.MainUI.class)
            .getContext()
            .getActionMap(JPanelKonfigER.class, this);
    jButtonDelArea.setAction(actionMap.get("deleteAreaRecord")); // NOI18N
    jButtonDelArea.setText(resourceMap.getString("jButtonDelArea.text")); // NOI18N
    jButtonDelArea.setName("jButtonDelArea"); // NOI18N

    jButtonNewArea.setAction(actionMap.get("newAreaRecord")); // NOI18N
    jButtonNewArea.setText(resourceMap.getString("jButtonNewArea.text")); // NOI18N
    jButtonNewArea.setName("jButtonNewArea"); // NOI18N

    jButtonSaveBooking.setText(resourceMap.getString("jButtonSaveBooking.text")); // NOI18N
    jButtonSaveBooking.setName("jButtonSaveBooking"); // NOI18N

    jButtonRefreshBooking.setText(resourceMap.getString("jButtonRefreshBooking.text")); // NOI18N
    jButtonRefreshBooking.setName("jButtonRefreshBooking"); // NOI18N

    jButtonDelBooking.setText(resourceMap.getString("jButtonDelBooking.text")); // NOI18N
    jButtonDelBooking.setName("jButtonDelBooking"); // NOI18N

    jButtonNewBooking.setText(resourceMap.getString("jButtonNewBooking.text")); // NOI18N
    jButtonNewBooking.setName("jButtonNewBooking"); // NOI18N

    jScrollPane3.setName("jScrollPane3"); // NOI18N

    jTableFilter.setName("jTableFilter"); // NOI18N

    jTableBinding =
        org.jdesktop.swingbinding.SwingBindings.createJTableBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            buhaFilterList,
            jTableFilter);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${itemFrom}"));
    columnBinding.setColumnName("Item From");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${itemTo}"));
    columnBinding.setColumnName("Item To");
    columnBinding.setColumnClass(Integer.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${gutscheinfilter}"));
    columnBinding.setColumnName("Gutscheinfilter");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${country}"));
    columnBinding.setColumnName("Country");
    columnBinding.setColumnClass(String.class);
    columnBinding =
        jTableBinding.addColumnBinding(
            org.jdesktop.beansbinding.ELProperty.create("${description}"));
    columnBinding.setColumnName("Description");
    columnBinding.setColumnClass(String.class);
    bindingGroup.addBinding(jTableBinding);
    jTableBinding.bind();
    jScrollPane3.setViewportView(jTableFilter);
    jTableFilter
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title0")); // NOI18N
    jTableFilter
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title1")); // NOI18N
    jTableFilter
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title2")); // NOI18N
    jTableFilter
        .getColumnModel()
        .getColumn(3)
        .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title3")); // NOI18N
    jTableFilter
        .getColumnModel()
        .getColumn(4)
        .setHeaderValue(resourceMap.getString("jTableFilter.columnModel.title4")); // NOI18N

    jButtonSaveFilter.setText(resourceMap.getString("jButtonSaveFilter.text")); // NOI18N
    jButtonSaveFilter.setName("jButtonSaveFilter"); // NOI18N

    jButtonRefreshFilter.setText(resourceMap.getString("jButtonRefreshFilter.text")); // NOI18N
    jButtonRefreshFilter.setName("jButtonRefreshFilter"); // NOI18N

    jButtonDelFilter.setText(resourceMap.getString("jButtonDelFilter.text")); // NOI18N
    jButtonDelFilter.setName("jButtonDelFilter"); // NOI18N

    jButtonNewFilter.setText(resourceMap.getString("jButtonNewFilter.text")); // NOI18N
    jButtonNewFilter.setName("jButtonNewFilter"); // NOI18N

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
    this.setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(605, 605, 605)
                    .addComponent(jButtonNewArea)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonDelArea))
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(461, 461, 461)
                    .addComponent(jButtonNewBooking)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonDelBooking)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonRefreshBooking)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonSaveBooking))
            .addComponent(
                jScrollPane3,
                javax.swing.GroupLayout.Alignment.TRAILING,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                1043,
                Short.MAX_VALUE)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 1043, Short.MAX_VALUE)
            .addGroup(
                javax.swing.GroupLayout.Alignment.TRAILING,
                layout
                    .createSequentialGroup()
                    .addGap(461, 461, 461)
                    .addComponent(jButtonNewFilter)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonDelFilter)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonRefreshFilter)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButtonSaveFilter)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addComponent(
                        jScrollPane2,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        129,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonDelArea)
                            .addComponent(jButtonNewArea))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        283,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonSaveBooking)
                            .addComponent(jButtonRefreshBooking)
                            .addComponent(jButtonDelBooking)
                            .addComponent(jButtonNewBooking))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(
                        jScrollPane3,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        173,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jButtonSaveFilter)
                            .addComponent(jButtonRefreshFilter)
                            .addComponent(jButtonDelFilter)
                            .addComponent(jButtonNewFilter))
                    .addContainerGap(50, Short.MAX_VALUE)));

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #27
0
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jTabbedPane1 = new javax.swing.JTabbedPane();
    jbtSair = new javax.swing.JButton();
    jbtNovo = new javax.swing.JButton();
    jLabel1 = new javax.swing.JLabel();
    jpn1 = new javax.swing.JPanel();
    jLabel31 = new javax.swing.JLabel();
    jLabel33 = new javax.swing.JLabel();
    jLabel35 = new javax.swing.JLabel();
    jtfCliente = new javax.swing.JTextField();
    jLabel37 = new javax.swing.JLabel();
    jtfCodigo = new javax.swing.JTextField();
    jdcDataVenda = new com.toedter.calendar.JDateChooser();
    jbtPesquisaVendedor = new javax.swing.JButton();
    jtfVendedor = new javax.swing.JTextField();
    jbtPesquisaCliente = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jtbVenda = new javax.swing.JTable();
    jLabel9 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jbtExcluirProduto = new javax.swing.JButton();
    jlbValorTotalVenda = new javax.swing.JLabel();
    jbtFinalizarVenda = new javax.swing.JButton();
    jLabel36 = new javax.swing.JLabel();
    jbtImprimir = new javax.swing.JButton();
    jbtCancelar = new javax.swing.JButton();
    jbtPesquisarVenda = new javax.swing.JButton();
    jbtExcluir = new javax.swing.JButton();
    jbtAlterar = new javax.swing.JButton();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setTitle("Venda de Mercadoria");
    setMaximizedBounds(new java.awt.Rectangle(0, 0, 0, 0));
    setResizable(false);

    jbtSair.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtSair.setText("Sair");
    jbtSair.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtSairActionPerformed(evt);
          }
        });

    jbtNovo.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtNovo.setText("Novo");
    jbtNovo.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtNovoActionPerformed(evt);
          }
        });

    jLabel1.setFont(new java.awt.Font("Hiragino Sans GB", 0, 24)); // NOI18N
    jLabel1.setText("Venda de Mercadoria");

    jpn1.setBackground(new java.awt.Color(153, 153, 153));
    jpn1.setBorder(
        javax.swing.BorderFactory.createTitledBorder(
            null,
            "",
            javax.swing.border.TitledBorder.TRAILING,
            javax.swing.border.TitledBorder.ABOVE_TOP,
            new java.awt.Font("Lucida Grande", 0, 12))); // NOI18N
    jpn1.setToolTipText("Cadastro");

    jLabel31.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jLabel31.setText("*Código");

    jLabel33.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jLabel33.setText("*Colaborador");

    jLabel35.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jLabel35.setText("*Parceiro");

    jtfCliente.setEditable(false);
    jtfCliente.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${venda.cliente_codigo.pessoa.nome}"),
            jtfCliente,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

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

    jLabel37.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jLabel37.setText("*Data Venda");

    jtfCodigo.setEditable(false);
    jtfCodigo.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${venda.codigo}"),
            jtfCodigo,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

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

    jbtPesquisaVendedor.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtPesquisaVendedor.setText("Buscar");
    jbtPesquisaVendedor.setToolTipText("Pesquisa Vendedor");
    jbtPesquisaVendedor.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtPesquisaVendedorActionPerformed(evt);
          }
        });

    jtfVendedor.setEditable(false);
    jtfVendedor.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            this,
            org.jdesktop.beansbinding.ELProperty.create("${venda.colaborador_codigo.pessoa.nome}"),
            jtfVendedor,
            org.jdesktop.beansbinding.BeanProperty.create("text"),
            "");
    bindingGroup.addBinding(binding);

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

    jbtPesquisaCliente.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtPesquisaCliente.setText("Buscar");
    jbtPesquisaCliente.setToolTipText("Pesquisa Vendedor");
    jbtPesquisaCliente.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtPesquisaClienteActionPerformed(evt);
          }
        });

    org.jdesktop.layout.GroupLayout jpn1Layout = new org.jdesktop.layout.GroupLayout(jpn1);
    jpn1.setLayout(jpn1Layout);
    jpn1Layout.setHorizontalGroup(
        jpn1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jpn1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel31)
                            .add(
                                jtfCodigo,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                106,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(18, 18, 18)
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jdcDataVenda,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                140,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                jLabel37,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                83,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jpn1Layout
                                    .createSequentialGroup()
                                    .add(jbtPesquisaVendedor)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jtfVendedor))
                            .add(jLabel33))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel35)
                            .add(
                                jpn1Layout
                                    .createSequentialGroup()
                                    .add(jbtPesquisaCliente)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jtfCliente,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        225,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .addContainerGap()));
    jpn1Layout.setVerticalGroup(
        jpn1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jpn1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                jLabel37,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                jpn1Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jLabel31)
                                    .add(jLabel35)
                                    .add(jLabel33)))
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jpn1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jpn1Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(
                                        jtfCodigo,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(
                                        jtfCliente,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jbtPesquisaVendedor)
                                    .add(
                                        jtfVendedor,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jbtPesquisaCliente))
                            .add(
                                jdcDataVenda,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .addContainerGap()));

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

    jtbVenda.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {},
            new String[] {"Código", "Produto", "Quantidade", "Valor UN", "Valor Total"}) {
          boolean[] canEdit = new boolean[] {true, false, true, true, true};

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    jtbVenda.addMouseListener(
        new java.awt.event.MouseAdapter() {
          public void mouseClicked(java.awt.event.MouseEvent evt) {
            jtbVendaMouseClicked(evt);
          }
        });
    jtbVenda.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyPressed(java.awt.event.KeyEvent evt) {
            jtbVendaKeyPressed(evt);
          }
        });
    jScrollPane2.setViewportView(jtbVenda);
    jtbVenda.getColumnModel().getColumn(0).setResizable(false);
    jtbVenda.getColumnModel().getColumn(1).setResizable(false);
    jtbVenda.getColumnModel().getColumn(2).setResizable(false);
    jtbVenda.getColumnModel().getColumn(3).setResizable(false);
    jtbVenda.getColumnModel().getColumn(4).setResizable(false);

    jLabel9.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
    jLabel9.setForeground(new java.awt.Color(255, 255, 255));
    jLabel9.setText("Valor da Venda");

    jLabel10.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N

    jbtExcluirProduto.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtExcluirProduto.setText("Excluir Produto");
    jbtExcluirProduto.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtExcluirProdutoActionPerformed(evt);
          }
        });

    jlbValorTotalVenda.setFont(new java.awt.Font("Lucida Grande", 0, 18)); // NOI18N
    jlbValorTotalVenda.setForeground(new java.awt.Color(255, 255, 255));

    jbtFinalizarVenda.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtFinalizarVenda.setText("Finalizar Venda");
    jbtFinalizarVenda.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtFinalizarVendaActionPerformed(evt);
          }
        });

    jLabel36.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jLabel36.setForeground(new java.awt.Color(255, 255, 255));
    jLabel36.setText("P busca produtos");

    jbtImprimir.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtImprimir.setText("Imprimir");
    jbtImprimir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtImprimirActionPerformed(evt);
          }
        });

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        jPanel1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jPanel1Layout
                                    .createSequentialGroup()
                                    .add(jbtFinalizarVenda)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(jbtExcluirProduto)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jbtImprimir,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        130,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(
                                        org.jdesktop.layout.LayoutStyle.RELATED,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .add(jLabel9)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jlbValorTotalVenda,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        107,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(
                                jScrollPane2,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                905,
                                Short.MAX_VALUE)
                            .add(
                                jPanel1Layout
                                    .createSequentialGroup()
                                    .add(jLabel36)
                                    .add(0, 0, Short.MAX_VALUE)))
                    .addContainerGap())
            .add(
                jPanel1Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(
                        jPanel1Layout
                            .createSequentialGroup()
                            .add(0, 458, Short.MAX_VALUE)
                            .add(jLabel10)
                            .add(0, 459, Short.MAX_VALUE))));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                jPanel1Layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(jLabel36)
                    .add(3, 3, 3)
                    .add(
                        jScrollPane2,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        327,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel1Layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                jlbValorTotalVenda,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                22,
                                org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(
                                jPanel1Layout
                                    .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jbtFinalizarVenda)
                                    .add(jbtExcluirProduto)
                                    .add(jLabel9)
                                    .add(jbtImprimir)))
                    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .add(
                jPanel1Layout
                    .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(
                        jPanel1Layout
                            .createSequentialGroup()
                            .add(0, 196, Short.MAX_VALUE)
                            .add(jLabel10)
                            .add(0, 196, Short.MAX_VALUE))));

    jbtCancelar.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtCancelar.setText("Cancelar");
    jbtCancelar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtCancelarActionPerformed(evt);
          }
        });

    jbtPesquisarVenda.setText("Pesquisar Venda");
    jbtPesquisarVenda.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtPesquisarVendaActionPerformed(evt);
          }
        });

    jbtExcluir.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtExcluir.setText("Excluir");
    jbtExcluir.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtExcluirActionPerformed(evt);
          }
        });

    jbtAlterar.setFont(new java.awt.Font("Lucida Grande", 0, 12)); // NOI18N
    jbtAlterar.setText("Alterar");
    jbtAlterar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jbtAlterarActionPerformed(evt);
          }
        });

    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                jPanel1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                org.jdesktop.layout.GroupLayout.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .add(jbtPesquisarVenda)
                                    .addPreferredGap(
                                        org.jdesktop.layout.LayoutStyle.RELATED,
                                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .add(jLabel1))
                            .add(
                                jpn1,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .add(
                                layout
                                    .createSequentialGroup()
                                    .add(
                                        jbtNovo,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        103,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jbtAlterar,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        101,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jbtExcluir,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        101,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jbtCancelar,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        103,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                    .add(
                                        jbtSair,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                                        103,
                                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(0, 0, Short.MAX_VALUE)))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                layout
                    .createSequentialGroup()
                    .add(9, 9, 9)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(jbtPesquisarVenda))
                    .addPreferredGap(
                        org.jdesktop.layout.LayoutStyle.RELATED,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)
                    .add(
                        jpn1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(12, 12, 12)
                    .add(
                        layout
                            .createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jbtNovo)
                            .add(jbtCancelar)
                            .add(jbtSair)
                            .add(jbtExcluir)
                            .add(jbtAlterar))));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    v_label = new javax.swing.JLabel();
    angle_label = new javax.swing.JLabel();
    travel_time_slider = new javax.swing.JSlider();
    delay_slider = new javax.swing.JSlider();
    jLabel2 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    start_btn = new javax.swing.JButton();
    countdown_label = new javax.swing.JLabel();
    jLabel1 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();

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

    v_label.setText(" ");

    angle_label.setText(" ");

    travel_time_slider.setMaximum(300);
    travel_time_slider.setMinimum(1);
    travel_time_slider.setValue(30);
    travel_time_slider.addChangeListener(
        new javax.swing.event.ChangeListener() {
          public void stateChanged(javax.swing.event.ChangeEvent evt) {
            travel_time_sliderStateChanged(evt);
          }
        });

    delay_slider.setMaximum(60);
    delay_slider.addChangeListener(
        new javax.swing.event.ChangeListener() {
          public void stateChanged(javax.swing.event.ChangeEvent evt) {
            delay_sliderStateChanged(evt);
          }
        });

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            travel_time_slider,
            org.jdesktop.beansbinding.ELProperty.create("${value}"),
            jLabel2,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            delay_slider,
            org.jdesktop.beansbinding.ELProperty.create("${value}"),
            jLabel3,
            org.jdesktop.beansbinding.BeanProperty.create("text"));
    bindingGroup.addBinding(binding);

    start_btn.setText("Start");
    start_btn.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            start_btnActionPerformed(evt);
          }
        });

    countdown_label.setText(" ");

    jLabel1.setText("Speed");

    jLabel4.setText("Angle");

    jLabel5.setText("Traveltime");

    jLabel6.setText("Delay");

    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()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(
                                start_btn,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel5)
                                            .addComponent(jLabel6))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                travel_time_slider,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                314,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                delay_slider,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addPreferredGap(
                                        javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                jLabel3, javax.swing.GroupLayout.Alignment.TRAILING)
                                            .addComponent(
                                                jLabel2,
                                                javax.swing.GroupLayout.Alignment.TRAILING)))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(countdown_label)
                                    .addGap(0, 389, Short.MAX_VALUE))
                            .addGroup(
                                javax.swing.GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(jLabel1)
                                            .addComponent(jLabel4))
                                    .addGap(32, 32, 32)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(
                                                angle_label,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                v_label,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))))
                    .addContainerGap()));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(v_label)
                            .addComponent(jLabel1))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(angle_label)
                            .addComponent(jLabel4))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                travel_time_slider,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel5,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel2,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(
                                delay_slider,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel6,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                jLabel3,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(start_btn)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(countdown_label)
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    bindingGroup.bind();

    pack();
  } // </editor-fold>//GEN-END:initComponents
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    mainPanel = new javax.swing.JPanel();
    jDesktopPane1 = new javax.swing.JDesktopPane();
    jPanel1 = new javax.swing.JPanel();
    jDesktopPane2 = new javax.swing.JDesktopPane();
    jLabel1 = new javax.swing.JLabel();
    currentTaskNavOption = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    nextTaskNavOption = new javax.swing.JButton();
    todayTaskNavOption = new javax.swing.JButton();
    scheduleTaskNavOption = new javax.swing.JButton();
    someDayTaskNavOption = new javax.swing.JButton();
    logBookNavOption = new javax.swing.JButton();
    trashCanNavOption = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    tasksTable = new javax.swing.JTable();
    jDesktopPane3 = new javax.swing.JDesktopPane();
    newTaskBtn = new javax.swing.JButton();
    jButton9 = new javax.swing.JButton();
    editRow = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    javax.swing.JMenu fileMenu = new javax.swing.JMenu();
    jMenuItem1 = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JPopupMenu.Separator();
    javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
    javax.swing.JMenu helpMenu = new javax.swing.JMenu();
    javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();

    mainPanel.setName("mainPanel"); // NOI18N

    org.jdesktop.application.ResourceMap resourceMap =
        org.jdesktop.application.Application.getInstance(addictionmanager.AddictionManagerApp.class)
            .getContext()
            .getResourceMap(AddictionManagerView.class);
    jDesktopPane1.setBackground(resourceMap.getColor("jDesktopPane1.background")); // NOI18N
    jDesktopPane1.setName("jDesktopPane1"); // NOI18N

    jPanel1.setName("jPanel1"); // NOI18N

    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 160, Short.MAX_VALUE));
    jPanel1Layout.setVerticalGroup(
        jPanel1Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(0, 100, Short.MAX_VALUE));

    jPanel1.setBounds(10, 20, 160, 100);
    jDesktopPane1.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jDesktopPane2.setBackground(resourceMap.getColor("siderBarPanel.background")); // NOI18N
    jDesktopPane2.setName("siderBarPanel"); // NOI18N

    jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
    jLabel1.setForeground(resourceMap.getColor("jLabel1.foreground")); // NOI18N
    jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
    jLabel1.setName("jLabel1"); // NOI18N
    jLabel1.setBounds(10, 70, 50, 16);
    jDesktopPane2.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

    currentTaskNavOption.setIcon(resourceMap.getIcon("currentTaskNavOption.icon")); // NOI18N
    currentTaskNavOption.setText(resourceMap.getString("currentTaskNavOption.text")); // NOI18N
    currentTaskNavOption.setToolTipText(
        resourceMap.getString("currentTaskNavOption.toolTipText")); // NOI18N
    currentTaskNavOption.setName("currentTaskNavOption"); // NOI18N
    currentTaskNavOption.setSelected(true);
    currentTaskNavOption.setSelectedIcon(
        resourceMap.getIcon("currentTaskNavOption.selectedIcon")); // NOI18N
    currentTaskNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            currentTaskNavOptionActionPerformed(evt);
          }
        });
    currentTaskNavOption.setBounds(0, 30, 180, 30);
    jDesktopPane2.add(currentTaskNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
    jLabel2.setForeground(resourceMap.getColor("jLabel2.foreground")); // NOI18N
    jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
    jLabel2.setName("jLabel2"); // NOI18N
    jLabel2.setBounds(10, 10, 70, 15);
    jDesktopPane2.add(jLabel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

    nextTaskNavOption.setIcon(resourceMap.getIcon("nextActivityBtn.icon")); // NOI18N
    nextTaskNavOption.setText(resourceMap.getString("nextActivityBtn.text")); // NOI18N
    nextTaskNavOption.setToolTipText(
        resourceMap.getString("nextActivityBtn.toolTipText")); // NOI18N
    nextTaskNavOption.setName("nextActivityBtn"); // NOI18N
    nextTaskNavOption.setSelected(true);
    nextTaskNavOption.setSelectedIcon(
        resourceMap.getIcon("nextActivityBtn.selectedIcon")); // NOI18N
    nextTaskNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextTaskNavOptionActionPerformed(evt);
          }
        });
    nextTaskNavOption.setBounds(0, 120, 180, 30);
    jDesktopPane2.add(nextTaskNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    todayTaskNavOption.setIcon(resourceMap.getIcon("todayActivityBtn.icon")); // NOI18N
    todayTaskNavOption.setText(resourceMap.getString("todayActivityBtn.text")); // NOI18N
    todayTaskNavOption.setToolTipText(
        resourceMap.getString("todayActivityBtn.toolTipText")); // NOI18N
    todayTaskNavOption.setName("todayActivityBtn"); // NOI18N
    todayTaskNavOption.setSelected(true);
    todayTaskNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            todayTaskNavOptionActionPerformed(evt);
          }
        });
    todayTaskNavOption.setBounds(0, 90, 180, 30);
    jDesktopPane2.add(todayTaskNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    scheduleTaskNavOption.setIcon(resourceMap.getIcon("scheduleActivityBtn.icon")); // NOI18N
    scheduleTaskNavOption.setText(resourceMap.getString("scheduleActivityBtn.text")); // NOI18N
    scheduleTaskNavOption.setToolTipText(
        resourceMap.getString("scheduleActivityBtn.toolTipText")); // NOI18N
    scheduleTaskNavOption.setName("scheduleActivityBtn"); // NOI18N
    scheduleTaskNavOption.setSelected(true);
    scheduleTaskNavOption.setSelectedIcon(
        resourceMap.getIcon("scheduleActivityBtn.selectedIcon")); // NOI18N
    scheduleTaskNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            scheduleTaskNavOptionActionPerformed(evt);
          }
        });
    scheduleTaskNavOption.setBounds(0, 150, 180, 30);
    jDesktopPane2.add(scheduleTaskNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    someDayTaskNavOption.setIcon(resourceMap.getIcon("somedayActivityBtn.icon")); // NOI18N
    someDayTaskNavOption.setText(resourceMap.getString("somedayActivityBtn.text")); // NOI18N
    someDayTaskNavOption.setToolTipText(
        resourceMap.getString("somedayActivityBtn.toolTipText")); // NOI18N
    someDayTaskNavOption.setName("somedayActivityBtn"); // NOI18N
    someDayTaskNavOption.setSelected(true);
    someDayTaskNavOption.setSelectedIcon(
        resourceMap.getIcon("somedayActivityBtn.selectedIcon")); // NOI18N
    someDayTaskNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            someDayTaskNavOptionActionPerformed(evt);
          }
        });
    someDayTaskNavOption.setBounds(0, 180, 180, 30);
    jDesktopPane2.add(someDayTaskNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    logBookNavOption.setIcon(resourceMap.getIcon("logbookBtn.icon")); // NOI18N
    logBookNavOption.setText(resourceMap.getString("logbookBtn.text")); // NOI18N
    logBookNavOption.setToolTipText(resourceMap.getString("logbookBtn.toolTipText")); // NOI18N
    logBookNavOption.setName("logbookBtn"); // NOI18N
    logBookNavOption.setSelected(true);
    logBookNavOption.setSelectedIcon(resourceMap.getIcon("logbookBtn.selectedIcon")); // NOI18N
    logBookNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            logBookNavOptionActionPerformed(evt);
          }
        });
    logBookNavOption.setBounds(0, 560, 180, 30);
    jDesktopPane2.add(logBookNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    trashCanNavOption.setIcon(resourceMap.getIcon("trashBtn.icon")); // NOI18N
    trashCanNavOption.setText(resourceMap.getString("trashBtn.text")); // NOI18N
    trashCanNavOption.setToolTipText(resourceMap.getString("trashBtn.toolTipText")); // NOI18N
    trashCanNavOption.setName("trashBtn"); // NOI18N
    trashCanNavOption.setSelected(true);
    trashCanNavOption.setSelectedIcon(resourceMap.getIcon("trashBtn.selectedIcon")); // NOI18N
    trashCanNavOption.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            trashCanNavOptionActionPerformed(evt);
          }
        });
    trashCanNavOption.setBounds(0, 590, 180, 30);
    jDesktopPane2.add(trashCanNavOption, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jPanel2.setBackground(resourceMap.getColor("centerPanel.background")); // NOI18N
    jPanel2.setForeground(resourceMap.getColor("centerPanel.foreground")); // NOI18N
    jPanel2.setName("centerPanel"); // NOI18N

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    tasksTable.setBackground(resourceMap.getColor("tasksTable.background")); // NOI18N
    tasksTable.setFont(resourceMap.getFont("tasksTable.font")); // NOI18N
    tasksTable.setForeground(resourceMap.getColor("tasksTable.foreground")); // NOI18N
    tasksTable.setModel(
        new javax.swing.table.DefaultTableModel(
            new Object[][] {},
            new String[] {
              "",
              "Task no.",
              "Task Name",
              "Task Description",
              "Allowed Applications",
              "Restricted Applications",
              "Start Date & Time",
              "End Date & Time",
              "Notification Type"
            }) {
          Class[] types =
              new Class[] {
                java.lang.Boolean.class,
                java.lang.Integer.class,
                java.lang.String.class,
                java.lang.String.class,
                java.lang.String.class,
                java.lang.String.class,
                java.lang.String.class,
                java.lang.String.class,
                java.lang.String.class
              };
          boolean[] canEdit =
              new boolean[] {true, false, false, false, false, false, false, false, false};

          public Class getColumnClass(int columnIndex) {
            return types[columnIndex];
          }

          public boolean isCellEditable(int rowIndex, int columnIndex) {
            return canEdit[columnIndex];
          }
        });
    tasksTable.setColumnSelectionAllowed(true);
    tasksTable.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    tasksTable.setGridColor(resourceMap.getColor("tasksTable.gridColor")); // NOI18N
    tasksTable.setName("tasksTable"); // NOI18N
    tasksTable.setRowHeight(30);
    tasksTable.setRowMargin(3);
    tasksTable.setSelectionBackground(
        resourceMap.getColor("tasksTable.selectionBackground")); // NOI18N
    tasksTable.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tasksTable.getTableHeader().setReorderingAllowed(false);
    jScrollPane1.setViewportView(tasksTable);
    tasksTable
        .getColumnModel()
        .getSelectionModel()
        .setSelectionMode(javax.swing.ListSelectionModel.SINGLE_INTERVAL_SELECTION);
    tasksTable.getColumnModel().getColumn(0).setMinWidth(15);
    tasksTable.getColumnModel().getColumn(0).setPreferredWidth(20);
    tasksTable.getColumnModel().getColumn(0).setMaxWidth(20);
    tasksTable
        .getColumnModel()
        .getColumn(0)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title6")); // NOI18N
    tasksTable.getColumnModel().getColumn(1).setMinWidth(40);
    tasksTable.getColumnModel().getColumn(1).setPreferredWidth(55);
    tasksTable.getColumnModel().getColumn(1).setMaxWidth(55);
    tasksTable
        .getColumnModel()
        .getColumn(1)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title0")); // NOI18N
    tasksTable.getColumnModel().getColumn(2).setMinWidth(80);
    tasksTable.getColumnModel().getColumn(2).setPreferredWidth(120);
    tasksTable.getColumnModel().getColumn(2).setMaxWidth(220);
    tasksTable
        .getColumnModel()
        .getColumn(2)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title1")); // NOI18N
    tasksTable.getColumnModel().getColumn(3).setMinWidth(150);
    tasksTable.getColumnModel().getColumn(3).setPreferredWidth(220);
    tasksTable.getColumnModel().getColumn(3).setMaxWidth(320);
    tasksTable
        .getColumnModel()
        .getColumn(3)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title9")); // NOI18N
    tasksTable.getColumnModel().getColumn(4).setMinWidth(80);
    tasksTable.getColumnModel().getColumn(4).setPreferredWidth(140);
    tasksTable.getColumnModel().getColumn(4).setMaxWidth(240);
    tasksTable
        .getColumnModel()
        .getColumn(4)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title2")); // NOI18N
    tasksTable.getColumnModel().getColumn(5).setMinWidth(120);
    tasksTable.getColumnModel().getColumn(5).setPreferredWidth(160);
    tasksTable.getColumnModel().getColumn(5).setMaxWidth(260);
    tasksTable
        .getColumnModel()
        .getColumn(5)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title3")); // NOI18N
    tasksTable.getColumnModel().getColumn(6).setMinWidth(80);
    tasksTable.getColumnModel().getColumn(6).setPreferredWidth(120);
    tasksTable.getColumnModel().getColumn(6).setMaxWidth(220);
    tasksTable
        .getColumnModel()
        .getColumn(6)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title4")); // NOI18N
    tasksTable.getColumnModel().getColumn(7).setMinWidth(80);
    tasksTable.getColumnModel().getColumn(7).setPreferredWidth(120);
    tasksTable.getColumnModel().getColumn(7).setMaxWidth(220);
    tasksTable
        .getColumnModel()
        .getColumn(7)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title7")); // NOI18N
    tasksTable.getColumnModel().getColumn(8).setMinWidth(80);
    tasksTable.getColumnModel().getColumn(8).setPreferredWidth(100);
    tasksTable.getColumnModel().getColumn(8).setMaxWidth(200);
    tasksTable
        .getColumnModel()
        .getColumn(8)
        .setHeaderValue(resourceMap.getString("tasksTable.columnModel.title8")); // NOI18N

    jDesktopPane3.setBackground(resourceMap.getColor("jDesktopPane3.background")); // NOI18N
    jDesktopPane3.setName("jDesktopPane3"); // NOI18N

    newTaskBtn.setText(resourceMap.getString("newTaskBtn.text")); // NOI18N
    newTaskBtn.setName("newTaskBtn"); // NOI18N
    newTaskBtn.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            newTaskBtnActionPerformed(evt);
          }
        });
    newTaskBtn.setBounds(20, 10, 97, 29);
    jDesktopPane3.add(newTaskBtn, javax.swing.JLayeredPane.DEFAULT_LAYER);

    jButton9.setText(resourceMap.getString("jButton9.text")); // NOI18N
    jButton9.setEnabled(false);
    jButton9.setName("jButton9"); // NOI18N
    jButton9.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton9ActionPerformed(evt);
          }
        });
    jButton9.setBounds(920, 10, 110, 29);
    jDesktopPane3.add(jButton9, javax.swing.JLayeredPane.DEFAULT_LAYER);

    editRow.setText(resourceMap.getString("editRow.text")); // NOI18N
    editRow.setEnabled(false);
    editRow.setName("editRow"); // NOI18N
    editRow.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            editRowActionPerformed(evt);
          }
        });
    editRow.setBounds(810, 10, 110, 29);
    jDesktopPane3.add(editRow, javax.swing.JLayeredPane.DEFAULT_LAYER);

    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jDesktopPane3)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jScrollPane1,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                1030,
                Short.MAX_VALUE));
    jPanel2Layout.setVerticalGroup(
        jPanel2Layout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                org.jdesktop.layout.GroupLayout.TRAILING,
                jPanel2Layout
                    .createSequentialGroup()
                    .add(
                        jScrollPane1,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        591,
                        Short.MAX_VALUE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jDesktopPane3,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        57,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)));

    org.jdesktop.layout.GroupLayout mainPanelLayout =
        new org.jdesktop.layout.GroupLayout(mainPanel);
    mainPanel.setLayout(mainPanelLayout);
    mainPanelLayout.setHorizontalGroup(
        mainPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(
                mainPanelLayout
                    .createSequentialGroup()
                    .add(
                        jDesktopPane1,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jDesktopPane2,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE,
                        180,
                        org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                    .add(
                        jPanel2,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                        Short.MAX_VALUE)));
    mainPanelLayout.setVerticalGroup(
        mainPanelLayout
            .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jDesktopPane1)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jDesktopPane2)
            .add(
                jPanel2,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                org.jdesktop.layout.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

    menuBar.setName("menuBar"); // NOI18N

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            menuBar,
            org.jdesktop.beansbinding.ELProperty.create("${background}"),
            menuBar,
            org.jdesktop.beansbinding.BeanProperty.create("background"));
    bindingGroup.addBinding(binding);

    fileMenu.setBackground(resourceMap.getColor("fileMenu.background")); // NOI18N
    fileMenu.setText(resourceMap.getString("fileMenu.text")); // NOI18N
    fileMenu.setName("fileMenu"); // NOI18N

    jMenuItem1.setAccelerator(
        javax.swing.KeyStroke.getKeyStroke(
            java.awt.event.KeyEvent.VK_N, java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
    jMenuItem1.setName("jMenuItem1"); // NOI18N
    jMenuItem1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
          }
        });
    fileMenu.add(jMenuItem1);

    jSeparator1.setName("jSeparator1"); // NOI18N
    fileMenu.add(jSeparator1);

    javax.swing.ActionMap actionMap =
        org.jdesktop.application.Application.getInstance(addictionmanager.AddictionManagerApp.class)
            .getContext()
            .getActionMap(AddictionManagerView.class, this);
    exitMenuItem.setAction(actionMap.get("quit")); // NOI18N
    exitMenuItem.setName("exitMenuItem"); // NOI18N
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    helpMenu.setBackground(resourceMap.getColor("helpMenu.background")); // NOI18N
    helpMenu.setText(resourceMap.getString("helpMenu.text")); // NOI18N
    helpMenu.setName("helpMenu"); // NOI18N

    aboutMenuItem.setAction(actionMap.get("showAboutBox")); // NOI18N
    aboutMenuItem.setIcon(resourceMap.getIcon("aboutMenuItem.icon")); // NOI18N
    aboutMenuItem.setName("aboutMenuItem"); // NOI18N
    helpMenu.add(aboutMenuItem);

    menuBar.add(helpMenu);

    setComponent(mainPanel);
    setMenuBar(menuBar);

    bindingGroup.bind();
  } // </editor-fold>//GEN-END:initComponents
Пример #30
0
  /**
   * 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() {
    bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jComboUf = new javax.swing.JComboBox();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTableListarFornecedores = new javax.swing.JTable();
    jComboBoxOpcaoPesquisa = new javax.swing.JComboBox();
    txtBuscar = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jBtnNovoFornecedor = new javax.swing.JButton();
    jLabel2 = new javax.swing.JLabel();
    jBtnVoltar = new javax.swing.JButton();
    jBtnDetalhar = new javax.swing.JButton();
    jLabel4 = new javax.swing.JLabel();

    setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
    setResizable(false);
    addWindowListener(
        new java.awt.event.WindowAdapter() {
          public void windowClosed(java.awt.event.WindowEvent evt) {
            formWindowClosed(evt);
          }
        });

    jPanel1.setBackground(new java.awt.Color(204, 255, 204));
    jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

    jLabel1.setFont(new java.awt.Font("Raavi", 1, 18)); // NOI18N
    jLabel1.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/imagens/fornecedor.png"))); // NOI18N
    jLabel1.setText("Fornecedores");
    jPanel1.add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 40, -1, 14));

    jComboUf.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {
              "Selecione o estado",
              "AC",
              "AL",
              "AP",
              "AM",
              "BA",
              "CE",
              "DF",
              "ES",
              "GO",
              "MA",
              "MT",
              "MS",
              "MG",
              "PA",
              "PB",
              "PR",
              "PE",
              "PI",
              "RJ",
              "RN",
              "RS",
              "RO",
              "RR",
              "SC",
              "SP",
              "SE",
              "TO"
            }));
    jComboUf.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboUfActionPerformed(evt);
          }
        });
    jPanel1.add(jComboUf, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 220, 270, -1));

    jTableListarFornecedores.setModel(
        new javax.swing.table.DefaultTableModel(new Object[][] {}, new String[] {}));

    jScrollPane1.setViewportView(jTableListarFornecedores);

    jPanel1.add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 260, 640, 350));

    jComboBoxOpcaoPesquisa.setModel(
        new javax.swing.DefaultComboBoxModel(
            new String[] {"Selecione a opção de pesquisa", "Código", "Fornecedor", "CEP"}));
    jComboBoxOpcaoPesquisa.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jComboBoxOpcaoPesquisaActionPerformed(evt);
          }
        });
    jPanel1.add(
        jComboBoxOpcaoPesquisa,
        new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 170, 270, -1));

    txtBuscar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            txtBuscarActionPerformed(evt);
          }
        });
    txtBuscar.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyReleased(java.awt.event.KeyEvent evt) {
            txtBuscarKeyReleased(evt);
          }
        });
    jPanel1.add(txtBuscar, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 170, 255, -1));

    jLabel3.setText("Filtrar:");
    jPanel1.add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 220, -1, -1));

    jBtnNovoFornecedor.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jBtnNovoFornecedor.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/imagens/fornecedoradd2.fw.png"))); // NOI18N
    jBtnNovoFornecedor.setText("Novo");
    jBtnNovoFornecedor.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jBtnNovoFornecedorActionPerformed(evt);
          }
        });
    jPanel1.add(
        jBtnNovoFornecedor, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 230, 133, -1));

    jLabel2.setText("Pesquisar por:");
    jPanel1.add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 180, -1, -1));

    jBtnVoltar.setText("Voltar");
    jBtnVoltar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jBtnVoltarActionPerformed(evt);
          }
        });
    jPanel1.add(jBtnVoltar, new org.netbeans.lib.awtextra.AbsoluteConstraints(50, 640, -1, -1));

    jBtnDetalhar.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
    jBtnDetalhar.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/imagens/fornecedorConsulta.fw.png"))); // NOI18N
    jBtnDetalhar.setText("Detalhar");

    org.jdesktop.beansbinding.Binding binding =
        org.jdesktop.beansbinding.Bindings.createAutoBinding(
            org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE,
            jTableListarFornecedores,
            org.jdesktop.beansbinding.ELProperty.create("${selectedElement != null}"),
            jBtnDetalhar,
            org.jdesktop.beansbinding.BeanProperty.create("enabled"));
    bindingGroup.addBinding(binding);

    jBtnDetalhar.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jBtnDetalharActionPerformed(evt);
          }
        });
    jPanel1.add(jBtnDetalhar, new org.netbeans.lib.awtextra.AbsoluteConstraints(710, 350, -1, -1));

    jLabel4.setIcon(
        new javax.swing.ImageIcon(getClass().getResource("/leiaute/img3.png"))); // NOI18N
    jPanel1.add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, -10, 860, 140));

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                jPanel1,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(
                jPanel1,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                javax.swing.GroupLayout.DEFAULT_SIZE,
                Short.MAX_VALUE));

    bindingGroup.bind();

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