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(); }
protected void initDataBindings() { BeanProperty<Settings, List<String>> settingsBeanProperty_4 = BeanProperty.create("tvShowSettings.tvShowDataSource"); JTableBinding<String, Settings, JTable> jTableBinding = SwingBindings.createJTableBinding( UpdateStrategy.READ, settings, settingsBeanProperty_4, tableTvShowSources); // ObjectProperty<String> stringObjectProperty = ObjectProperty.create(); jTableBinding.addColumnBinding(stringObjectProperty); // jTableBinding.bind(); // BeanProperty<Settings, Boolean> settingsBeanProperty = BeanProperty.create("tvShowSettings.syncTrakt"); BeanProperty<JCheckBox, Boolean> jCheckBoxBeanProperty = BeanProperty.create("selected"); AutoBinding<Settings, Boolean, JCheckBox, Boolean> autoBinding = Bindings.createAutoBinding( UpdateStrategy.READ_WRITE, settings, settingsBeanProperty, chckbxTraktTv, jCheckBoxBeanProperty); autoBinding.bind(); // BeanProperty<Settings, Boolean> settingsBeanProperty_1 = BeanProperty.create("tvShowSettings.dvdOrder"); AutoBinding<Settings, Boolean, JCheckBox, Boolean> autoBinding_1 = Bindings.createAutoBinding( UpdateStrategy.READ_WRITE, settings, settingsBeanProperty_1, cbDvdOrder, jCheckBoxBeanProperty); autoBinding_1.bind(); }
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(); }
/** Binds list, navigation and simple direct properties. */ @SuppressWarnings("unchecked") private void bindBasics() { // bind the list JListBinding listBinding = SwingBindings.createJListBinding(UpdateStrategy.READ_WRITE, beanList, list); listBinding.setDetailBinding(BeanProperty.create("value")); listBinding.bind(); // bind the properties Validator notEmpty = new NotEmptyValidator(); BindingGroupBean context = new BindingGroupBean(); // bind the navigation to list selection context.addBinding( Bindings.createAutoBinding( UpdateStrategy.READ, list, BeanProperty.create("selectedElement"), navigation, BeanProperty.create("selectedElement"))); Binding valueBinding = Bindings.createAutoBinding( UpdateStrategy.READ_WRITE, navigation, BeanProperty.create("selectedElement.value"), valueField, BeanProperty.create("text")); valueBinding.setSourceUnreadableValue(null); context.addBinding(valueBinding); valueBinding.setValidator(notEmpty); Binding activityBinding = Bindings.createAutoBinding( UpdateStrategy.READ_WRITE, navigation, BeanProperty.create("selectedElement.active"), activityBox, BeanProperty.create("selected")); activityBinding.setSourceUnreadableValue(Boolean.FALSE); context.addBinding(activityBinding); context.bind(); BindingGroup bufferingContext = new BindingGroup(); bufferingContext.addBinding( Bindings.createAutoBinding( UpdateStrategy.READ, context, BeanProperty.create("dirty"), uncommittedBox, BeanProperty.create("selected"))); bufferingContext.bind(); }
private void llenarComboPeriodo() throws Exception { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, rRHHBBFunciones.getRhComboUtilidadesPeriodoTO(), jcboPeriodo); bindingGroup.addBinding(jComboBoxBinding); this.rRHHBBFunciones.setRhComboUtilidadesPeriodoTO( shrimp.rrhh.delegate.RrhhDelegate.getInstance() .getRhComboUtilidadesPeriodoTO(sisUsuarioEmpresaTO.getEmpCodigo())); this.bindingGroup.bind(); this.jcboPeriodo.updateUI(); this.jcboPeriodo.setSelectedItem(null); jcboPeriodo.setRenderer(new shrimp.validaciones.ComboTooltipRenderer()); }
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()); }
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(); }
private void processColumns(Column[] columns) { normalColumnModel = new DefaultTableColumnModelExt(); BeanProperty itemsProperty = BeanProperty.create("items"); jTableBinding = SwingBindings.createJTableBinding( AutoBinding.UpdateStrategy.READ_WRITE, this, itemsProperty, this); for (int i = 0; i < columns.length; i++) { Column column = columns[i]; JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(column.getProperty()); columnBinding.setColumnName(column.getId()); columnBinding.setColumnClass(column.getType()); columnBinding.setConverter(column.getConverter()); columnBinding.setEditable(column.isEditable()); column.setModelIndex(i); normalColumnModel.addColumn(column); } jTableBinding.bind(); setColumnModel(normalColumnModel); }
/** * 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); }
/** * 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(); tesisUpecPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("tesisUpecPU") .createEntityManager(); cursoPostgradoQuery = java.beans.Beans.isDesignTime() ? null : tesisUpecPUEntityManager.createQuery("SELECT c FROM CursoPostgrado c"); cursoPostgradoList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( cursoPostgradoQuery.getResultList()); jPanel1 = new javax.swing.JPanel(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel4 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jTextField1 = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); jTextArea1 = new javax.swing.JTextArea(); jPanel5 = new javax.swing.JPanel(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton5 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jLabel5 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jButton4 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setTitle("Gestionar Curso Postgrado"); setResizable(false); addWindowListener( new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } }); jPanel1.setBackground(new java.awt.Color(30, 76, 89)); jPanel2.setBackground(new java.awt.Color(30, 76, 89)); jLabel1.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/banergrande.jpg"))); // NOI18N jPanel4.setBackground(new java.awt.Color(255, 255, 255)); jPanel4.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); jLabel3.setIcon( new javax.swing.ImageIcon( getClass().getResource("/imagenes/gestioncursopostgrado.jpg"))); // NOI18N jLabel3.setText("jLabel3"); jLabel2.setText("Tipo de Curso Postgrado:"); jLabel4.setText("Descripción:"); jTextField1.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextField1KeyTyped(evt); } }); jTextArea1.setColumns(20); jTextArea1.setRows(5); jTextArea1.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { jTextArea1KeyTyped(evt); } }); jScrollPane1.setViewportView(jTextArea1); javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4); jPanel4.setLayout(jPanel4Layout); jPanel4Layout.setHorizontalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addGap(26, 26, 26) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 432, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( jPanel4Layout .createSequentialGroup() .addGap(10, 10, 10) .addGroup( jPanel4Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel2) .addComponent(jLabel4)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup( jPanel4Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jScrollPane1) .addComponent( jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 268, Short.MAX_VALUE)))) .addContainerGap(72, Short.MAX_VALUE))); jPanel4Layout.setVerticalGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel4Layout .createSequentialGroup() .addContainerGap() .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2) .addComponent( jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( jPanel4Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(46, Short.MAX_VALUE))); jPanel5.setBackground(new java.awt.Color(255, 255, 255)); jPanel5.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); jButton1.setText("Insertar"); jButton1.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton1MousePressed(evt); } }); jButton2.setText("Modificar"); jButton2.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton2MousePressed(evt); } }); jButton3.setText("Eliminar"); jButton3.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton3MousePressed(evt); } }); jButton5.setText("Cancelar"); jButton5.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton5MousePressed(evt); } }); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel5Layout .createSequentialGroup() .addGap(111, 111, 111) .addComponent(jButton1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton3) .addGap(18, 18, 18) .addComponent(jButton5) .addContainerGap(99, Short.MAX_VALUE))); jPanel5Layout.setVerticalGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel5Layout .createSequentialGroup() .addContainerGap() .addGroup( jPanel5Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton2) .addComponent(jButton1) .addComponent(jButton3) .addComponent(jButton5)) .addContainerGap(13, Short.MAX_VALUE))); jPanel3.setBackground(new java.awt.Color(255, 255, 255)); jPanel3.setBorder( javax.swing.BorderFactory.createMatteBorder(1, 1, 1, 1, new java.awt.Color(30, 76, 89))); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cursoPostgradoList, jTable1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${tipoPostgrado}")); columnBinding.setColumnName("Tipo de Postgrado"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${descripcionPostgrado}")); columnBinding.setColumnName("Descripción"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane2.setViewportView(jTable1); jLabel5.setText("Cudorso Postgrado:"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cursoPostgradoList, jComboBox1); bindingGroup.addBinding(jComboBoxBinding); jButton4.setText("Buscar"); jButton4.addMouseListener( new java.awt.event.MouseAdapter() { public void mousePressed(java.awt.event.MouseEvent evt) { jButton4MousePressed(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(jLabel5) .addGap(18, 18, 18) .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 187, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(51, 51, 51) .addComponent(jButton4) .addContainerGap(103, Short.MAX_VALUE)) .addComponent( jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 530, Short.MAX_VALUE)); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addGap(20, 20, 20) .addGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent( jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton4)) .addGap(18, 18, 18) .addComponent( jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 131, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent( jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 532, Short.MAX_VALUE)); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel2Layout .createSequentialGroup() .addComponent(jLabel1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); 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.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 629, javax.swing.GroupLayout.PREFERRED_SIZE)); 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(); 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
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); BankingAppPUEntityManager = javax.persistence.Persistence.createEntityManagerFactory("BankingAppPU") .createEntityManager(); headTypesQuery = BankingAppPUEntityManager.createQuery("SELECT h FROM HeadTypes h"); headTypesList = headTypesQuery.getResultList(); saveFileChooser = new javax.swing.JFileChooser(); jScrollPane2 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); jButton1 = new javax.swing.JButton(); fromSpinner = new javax.swing.JSpinner(); toSpinner = new javax.swing.JSpinner(); jButton2 = new javax.swing.JButton(); 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(); catCombo = new javax.swing.JComboBox(); jButton3 = new javax.swing.JButton(); saveFileChooser.setName("saveFileChooser"); // NOI18N setClosable(true); setMaximizable(true); org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(bankingapp.BankingApp.class) .getContext() .getResourceMap(ReportAssetLiabilityProfitLoss.class); setTitle(resourceMap.getString("Form.title")); // NOI18N setName("Form"); // NOI18N jScrollPane2.setName("jScrollPane2"); // NOI18N 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} }, new String[] {"Title 1", "Title 2", "Title 3", "Title 4"})); jTable1.setName("jTable1"); // NOI18N jScrollPane2.setViewportView(jTable1); jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N jButton1.setName("jButton1"); // NOI18N jButton1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); fromSpinner.setModel( new javax.swing.SpinnerDateModel( new java.util.Date(946742400000L), null, null, java.util.Calendar.MONTH)); fromSpinner.setEditor(new javax.swing.JSpinner.DateEditor(fromSpinner, "dd-MM-yyyy")); fromSpinner.setName("fromSpinner"); // NOI18N toSpinner.setModel(new javax.swing.SpinnerDateModel()); toSpinner.setEditor(new javax.swing.JSpinner.DateEditor(toSpinner, "dd-MM-yyyy")); toSpinner.setName("toSpinner"); // NOI18N javax.swing.ActionMap actionMap = org.jdesktop.application.Application.getInstance(bankingapp.BankingApp.class) .getContext() .getActionMap(ReportAssetLiabilityProfitLoss.class, this); jButton2.setAction(actionMap.get("populateDated")); // NOI18N jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N jButton2.setName("jButton2"); // NOI18N jLabel1.setName("jLabel1"); // NOI18N jLabel2.setName("jLabel2"); // NOI18N jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N jLabel4.setName("jLabel4"); // NOI18N jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N jLabel5.setName("jLabel5"); // NOI18N catCombo.setName("catCombo"); // NOI18N org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, headTypesList, catCombo); bindingGroup.addBinding(jComboBoxBinding); catCombo.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { catComboActionPerformed(evt); } }); jButton3.setAction(actionMap.get("exportToExcel")); // NOI18N jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N jButton3.setName("jButton3"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( layout .createSequentialGroup() .addContainerGap() .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 655, Short.MAX_VALUE)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGap(47, 47, 47) .addComponent(jLabel1) .addGap(149, 149, 149) .addComponent(jLabel2)) .addGroup( layout .createSequentialGroup() .addGap(25, 25, 25) .addComponent(jLabel3) .addGap(18, 18, 18) .addComponent( fromSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(jLabel4) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent( toSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(jButton2) .addGap(33, 33, 33) .addComponent(jLabel5) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent( catCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 23, Short.MAX_VALUE) .addComponent(jButton3) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton1))) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addContainerGap(47, Short.MAX_VALUE) .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton3)) .addGap(35, 35, 35)) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent( toSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( fromSpinner, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3) .addComponent(jLabel4) .addComponent(jButton2) .addComponent(jLabel5) .addComponent( catCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18))) .addComponent( jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 415, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END:initComponents
/** * 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
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); }
/** * 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
/** Initialize cell Line panel */ private void initCellLinePanel() { // init cellLineJCombo cellLineTypeBindingList = ObservableCollections.observableList(cellLineService.findAllCellLineTypes()); JComboBoxBinding jComboBoxBinding = SwingBindings.createJComboBoxBinding( AutoBinding.UpdateStrategy.READ_WRITE, cellLineTypeBindingList, setupConditionsPanel.getCellLineComboBox()); bindingGroup.addBinding(jComboBoxBinding); // init growth medium JCombo mediumBindingList = ObservableCollections.observableList(cellLineService.findAllGrowthMedia()); jComboBoxBinding = SwingBindings.createJComboBoxBinding( AutoBinding.UpdateStrategy.READ_WRITE, mediumBindingList, setupConditionsPanel.getGrowthMediumComboBox()); bindingGroup.addBinding(jComboBoxBinding); // init serum JCombo serumBindingList = ObservableCollections.observableList(cellLineService.findAllSera()); jComboBoxBinding = SwingBindings.createJComboBoxBinding( AutoBinding.UpdateStrategy.READ_WRITE, serumBindingList, setupConditionsPanel.getSerumComboBox()); bindingGroup.addBinding(jComboBoxBinding); // init the other serum ComboBox jComboBoxBinding = SwingBindings.createJComboBoxBinding( AutoBinding.UpdateStrategy.READ_WRITE, serumBindingList, treatmentsController.getTreatmentsPanel().getSerumComboBox()); bindingGroup.addBinding(jComboBoxBinding); // init assay medium JCombo (it's actually in the treatment panel, but ca not be bind before // since the mediumBindingList would still be null) jComboBoxBinding = SwingBindings.createJComboBoxBinding( AutoBinding.UpdateStrategy.READ_WRITE, mediumBindingList, treatmentsController.getTreatmentsPanel().getAssayMediumComboBox()); bindingGroup.addBinding(jComboBoxBinding); bindingGroup.bind(); /** add action listeners */ /** insert a new cell line Type in the DB if it's not present yet */ setupConditionsPanel .getAddCellLineButton() .addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!setupConditionsPanel.getCellLineNameTextField().getText().isEmpty()) { CellLineType newCellLineType = new CellLineType(); newCellLineType.setName( setupConditionsPanel.getCellLineNameTextField().getText()); try { // insert cell line to DB saveCellLineType(newCellLineType); // add the new cell line to the list cellLineTypeBindingList.add(newCellLineType); setupConditionsPanel.getCellLineNameTextField().setText(""); showMessage( "Cell line inserted to DB!", "cell line saved", JOptionPane.INFORMATION_MESSAGE); } catch (PersistenceException exception) { LOG.error(exception.getMessage()); showMessage( "Cell Line already present in DB!", "", JOptionPane.WARNING_MESSAGE); setupConditionsPanel.getCellLineNameTextField().setText(""); setupConditionsPanel.getCellLineNameTextField().requestFocusInWindow(); } } else { showMessage( "Please insert a name for the cell line!", "", JOptionPane.WARNING_MESSAGE); setupConditionsPanel.getCellLineNameTextField().requestFocusInWindow(); } } }); }
@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() { 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
/** * 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(); cadastreObjectListBean = createBean(); jScrollPane1 = new javax.swing.JScrollPane(); tableCadastreObject = new javax.swing.JTable(); cmdRemove = new javax.swing.JButton(); setPreferredSize(new java.awt.Dimension(300, 180)); 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(false); 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); jScrollPane1.setViewportView(tableCadastreObject); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle( "org/sola/clients/swing/gis/ui/control/Bundle"); // NOI18N tableCadastreObject .getColumnModel() .getColumn(0) .setHeaderValue( bundle.getString( "CadastreObjectListPanel.tableCadastreObject.columnModel.title0")); // NOI18N tableCadastreObject .getColumnModel() .getColumn(1) .setHeaderValue( bundle.getString( "CadastreObjectListPanel.tableCadastreObject.columnModel.title1")); // NOI18N tableCadastreObject .getColumnModel() .getColumn(2) .setHeaderValue( bundle.getString( "CadastreObjectListPanel.tableCadastreObject.columnModel.title2")); // NOI18N cmdRemove.setText(bundle.getString("CadastreObjectListPanel.cmdRemove.text")); // NOI18N cmdRemove.setEnabled(false); cmdRemove.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { cmdRemoveActionPerformed(evt); } }); 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) .addComponent( jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 204, Short.MAX_VALUE) .addComponent(cmdRemove))) .addGap(15, 15, 15))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(16, 16, 16) .addComponent(cmdRemove) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 124, Short.MAX_VALUE) .addContainerGap())); bindingGroup.bind(); } // </editor-fold>//GEN-END:initComponents
public void llenarjTable() throws Exception { // this.bindingGroup.bind();//consigue los datos this.jTableBinding = SwingBindings.createJTableBinding( AutoBinding.UpdateStrategy.READ_ONCE, this.bbResumenCorrida1.getListaPrdListaResumenCorridaTO(), jtable); JTableBinding.ColumnBinding columnBinding = this.jTableBinding.addColumnBinding(ELProperty.create("${secCodigo}")); columnBinding.setColumnName("Sector"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); JTableBinding.ColumnBinding columnBinding1 = this.jTableBinding.addColumnBinding(ELProperty.create("${pisNumero}")); columnBinding1.setColumnName("Piscina"); columnBinding1.setColumnClass(String.class); columnBinding1.setEditable(false); JTableBinding.ColumnBinding columnBinding2 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCorridaNumero}")); columnBinding2.setColumnName("Corrida"); columnBinding2.setColumnClass(String.class); columnBinding2.setEditable(false); JTableBinding.ColumnBinding columnBinding3 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcHectareaje}")); columnBinding3.setColumnName("Has."); columnBinding3.setColumnClass(BigDecimal.class); columnBinding3.setEditable(false); JTableBinding.ColumnBinding columnBinding4 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcFechaSiembra}")); columnBinding4.setColumnName("Siembra"); columnBinding4.setColumnClass(String.class); columnBinding4.setEditable(false); JTableBinding.ColumnBinding columnBinding5 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcFechaPesca}")); columnBinding5.setColumnName("Pesca"); columnBinding5.setColumnClass(String.class); columnBinding5.setEditable(false); JTableBinding.ColumnBinding columnBinding6 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcEdad}")); columnBinding6.setColumnName("Edad"); columnBinding6.setColumnClass(BigDecimal.class); columnBinding6.setEditable(false); JTableBinding.ColumnBinding columnBinding7 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcDiasMuertos}")); columnBinding7.setColumnName("Días Muertos"); columnBinding7.setColumnClass(BigDecimal.class); columnBinding7.setEditable(false); JTableBinding.ColumnBinding columnBinding8 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcNumeroLarvas}")); columnBinding8.setColumnName("Larvas"); columnBinding8.setColumnClass(BigDecimal.class); columnBinding8.setEditable(false); JTableBinding.ColumnBinding columnBinding9 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcDensidad}")); columnBinding9.setColumnName("Densidad"); columnBinding9.setColumnClass(BigDecimal.class); columnBinding9.setEditable(false); JTableBinding.ColumnBinding columnBinding10 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcLaboratorio}")); columnBinding10.setColumnName("Laboratorio"); columnBinding10.setColumnClass(String.class); columnBinding10.setEditable(false); JTableBinding.ColumnBinding columnBinding11 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcNauplio}")); columnBinding11.setColumnName("Nauplio"); columnBinding11.setColumnClass(String.class); columnBinding11.setEditable(false); JTableBinding.ColumnBinding columnBinding12 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcLibrasBalanceados}")); columnBinding12.setColumnName("Balanceado"); columnBinding12.setColumnClass(BigDecimal.class); columnBinding12.setEditable(false); JTableBinding.ColumnBinding columnBinding13 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcBiomasa}")); columnBinding13.setColumnName("Biomasa Proyectada"); columnBinding13.setColumnClass(BigDecimal.class); columnBinding13.setEditable(false); JTableBinding.ColumnBinding columnBinding14 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcBiomasaReal}")); columnBinding14.setColumnName("Biomasa Real"); columnBinding14.setColumnClass(BigDecimal.class); columnBinding14.setEditable(false); JTableBinding.ColumnBinding columnBinding15 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcConversion}")); columnBinding15.setColumnName("Conversión"); columnBinding15.setColumnClass(BigDecimal.class); columnBinding15.setEditable(false); JTableBinding.ColumnBinding columnBinding16 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcTPromedio}")); columnBinding16.setColumnName("Peso"); columnBinding16.setColumnClass(BigDecimal.class); columnBinding16.setEditable(false); JTableBinding.ColumnBinding columnBinding17 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcPesoIdeal}")); columnBinding17.setColumnName("Peso Ideal"); columnBinding17.setColumnClass(BigDecimal.class); columnBinding17.setEditable(false); JTableBinding.ColumnBinding columnBinding18 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcSobrevivencia}")); columnBinding18.setColumnName("Sobrevivencia"); columnBinding18.setColumnClass(String.class); columnBinding18.setEditable(false); JTableBinding.ColumnBinding columnBinding19 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCosto}")); columnBinding19.setColumnName("Costo"); columnBinding19.setColumnClass(BigDecimal.class); columnBinding19.setEditable(false); JTableBinding.ColumnBinding columnBinding20 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcDirecto}")); columnBinding20.setColumnName("Directo"); columnBinding20.setColumnClass(BigDecimal.class); columnBinding20.setEditable(false); JTableBinding.ColumnBinding columnBinding21 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcIndirecto}")); columnBinding21.setColumnName("Indirecto"); columnBinding21.setColumnClass(BigDecimal.class); columnBinding21.setEditable(false); JTableBinding.ColumnBinding columnBinding22 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcValorVenta}")); columnBinding22.setColumnName("Venta"); columnBinding22.setColumnClass(BigDecimal.class); columnBinding22.setEditable(false); JTableBinding.ColumnBinding columnBinding23 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultado}")); columnBinding23.setColumnName("Resultado"); columnBinding23.setColumnClass(BigDecimal.class); columnBinding23.setEditable(false); JTableBinding.ColumnBinding columnBinding24 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoHectarea}")); columnBinding24.setColumnName("Costo Ha."); columnBinding24.setColumnClass(BigDecimal.class); columnBinding24.setEditable(false); JTableBinding.ColumnBinding columnBinding25 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcVentaHectarea}")); columnBinding25.setColumnName("Venta Ha."); columnBinding25.setColumnClass(BigDecimal.class); columnBinding25.setEditable(false); JTableBinding.ColumnBinding columnBinding26 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultadoHectarea}")); columnBinding26.setColumnName("Resultado Ha."); columnBinding26.setColumnClass(BigDecimal.class); columnBinding26.setEditable(false); JTableBinding.ColumnBinding columnBinding27 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoLibra}")); columnBinding27.setColumnName("Costo Lb."); columnBinding27.setColumnClass(BigDecimal.class); columnBinding27.setEditable(false); JTableBinding.ColumnBinding columnBinding28 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcVentaLibra}")); columnBinding28.setColumnName("Venta Lb."); columnBinding28.setColumnClass(BigDecimal.class); columnBinding28.setEditable(false); JTableBinding.ColumnBinding columnBinding37 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcResultadoLibra}")); columnBinding37.setColumnName("Resultado Lb."); columnBinding37.setColumnClass(BigDecimal.class); columnBinding37.setEditable(false); JTableBinding.ColumnBinding columnBinding38 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoDirectoDia}")); columnBinding38.setColumnName("Costo Dir. Día"); columnBinding38.setColumnClass(BigDecimal.class); columnBinding38.setEditable(false); JTableBinding.ColumnBinding columnBinding39 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoindirectoDia}")); columnBinding39.setColumnName("Costo Ind. Día"); columnBinding39.setColumnClass(BigDecimal.class); columnBinding39.setEditable(false); JTableBinding.ColumnBinding columnBinding40 = this.jTableBinding.addColumnBinding(ELProperty.create("${rcCostoTotalDia}")); columnBinding40.setColumnName("Costo Ttl. Dia"); columnBinding40.setColumnClass(BigDecimal.class); columnBinding40.setEditable(false); this.bindingGroup.addBinding(this.jTableBinding); this.bindingGroup.bind(); jtable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); // Metemos el modelo ordenable en la tabla. TableRowSorter modeloOrdenado = new TableRowSorter(jtable.getModel()); jtable.setRowSorter(modeloOrdenado); }
/** * 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 p FROM Proveedor p"); list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList( query.getResultList()); categoriaArticuloQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT c FROM CategoriaArticulo c"); categoriaArticuloList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : categoriaArticuloQuery.getResultList(); jPanel1 = new javax.swing.JPanel(); tf_telef = new javax.swing.JTextField(); tf_email = new javax.swing.JTextField(); lbl_direccion = new javax.swing.JLabel(); lbl_ruc = new javax.swing.JLabel(); tf_ruc = new javax.swing.JTextField(); tf_cedula = new javax.swing.JTextField(); lbl_email = new javax.swing.JLabel(); tf_direccion = new javax.swing.JTextField(); lbl_razonSocial = new javax.swing.JLabel(); lbl_telef = new javax.swing.JLabel(); tf_razonSocial = new javax.swing.JTextField(); lbl_apellido1 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); combotipo = new javax.swing.JComboBox(); lbl_cedula1 = new javax.swing.JLabel(); lbl_telef1 = new javax.swing.JLabel(); combo_cat = new javax.swing.JComboBox(); jPanel2 = new javax.swing.JPanel(); btn_cancelar = new javax.swing.JButton(); btn_guardar = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); lbl_registrarC = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setResizable(false); jPanel1.setBackground(new java.awt.Color(204, 204, 204)); jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder()); tf_telef.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_telefKeyTyped(evt); } }); tf_email.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_emailActionPerformed(evt); } }); tf_email.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_emailKeyTyped(evt); } }); lbl_direccion.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_direccion.setText("Dirección:"); lbl_ruc.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_ruc.setText("RUC:"); tf_ruc.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_rucActionPerformed(evt); } }); tf_ruc.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tf_rucFocusLost(evt); } }); tf_ruc.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_rucKeyTyped(evt); } }); tf_cedula.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_cedulaActionPerformed(evt); } }); tf_cedula.addFocusListener( new java.awt.event.FocusAdapter() { public void focusLost(java.awt.event.FocusEvent evt) { tf_cedulaFocusLost(evt); } }); tf_cedula.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_cedulaKeyTyped(evt); } }); lbl_email.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_email.setText("Email:"); tf_direccion.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_direccionKeyTyped(evt); } }); lbl_razonSocial.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_razonSocial.setText("Razon Social:"); lbl_telef.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_telef.setText("Teléfono:"); tf_razonSocial.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tf_razonSocialActionPerformed(evt); } }); tf_razonSocial.addKeyListener( new java.awt.event.KeyAdapter() { public void keyTyped(java.awt.event.KeyEvent evt) { tf_razonSocialKeyTyped(evt); } }); lbl_apellido1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_apellido1.setText("Tipo"); jLabel1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N jLabel1.setText("'N': Natural o 'J': Juridico"); combotipo.setModel(new javax.swing.DefaultComboBoxModel(new String[] {"N", "J"})); combotipo.addMouseListener( new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { combotipoMouseClicked(evt); } }); combotipo.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { combotipoActionPerformed(evt); } }); lbl_cedula1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_cedula1.setText("Cedula:"); lbl_telef1.setFont(new java.awt.Font("Candara", 0, 14)); // NOI18N lbl_telef1.setText("Categoria Proveedor:"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, categoriaArticuloList, combo_cat); bindingGroup.addBinding(jComboBoxBinding); 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_razonSocial) .addComponent(lbl_ruc) .addComponent(lbl_apellido1) .addComponent(lbl_cedula1) .addComponent(lbl_telef1)) .addGap(32, 32, 32) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_razonSocial, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup( jPanel1Layout .createSequentialGroup() .addComponent( combotipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(jLabel1)) .addComponent( tf_ruc, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, 102, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(49, 49, 49) .addGroup( jPanel1Layout .createParallelGroup( javax.swing.GroupLayout.Alignment .LEADING) .addComponent(lbl_email) .addComponent(lbl_direccion))) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout .createSequentialGroup() .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED) .addComponent(lbl_telef)))) .addComponent( combo_cat, javax.swing.GroupLayout.PREFERRED_SIZE, 171, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 75, Short.MAX_VALUE) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( tf_email, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent( tf_telef, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(20, 20, 20))); jPanel1Layout.setVerticalGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel1Layout .createSequentialGroup() .addGap(19, 19, 19) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lbl_apellido1) .addComponent(jLabel1) .addComponent( combotipo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(26, 26, 26) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( tf_email, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_email) .addComponent(lbl_razonSocial) .addComponent( tf_razonSocial, 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( tf_ruc, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_ruc) .addComponent(lbl_direccion) .addComponent( tf_direccion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(21, 21, 21) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( tf_cedula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_cedula1) .addComponent( tf_telef, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_telef)) .addGap(18, 18, 18) .addGroup( jPanel1Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent( combo_cat, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lbl_telef1)) .addContainerGap(36, Short.MAX_VALUE))); 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_guardar.setIcon( new javax.swing.ImageIcon(getClass().getResource("/imagenes/guardar.png"))); // NOI18N btn_guardar.setText("Guardar"); btn_guardar.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btn_guardarActionPerformed(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(34, 34, 34) .addComponent(btn_guardar) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE) .addComponent(btn_cancelar) .addGap(34, 34, 34))); 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_guardar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap())); 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("Crear Proveedor"); 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(128, 128, 128) .addComponent(lbl_registrarC) .addContainerGap(226, Short.MAX_VALUE))); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( jPanel3Layout .createSequentialGroup() .addContainerGap() .addComponent(lbl_registrarC) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); 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() .addContainerGap() .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup( layout .createSequentialGroup() .addGap(64, 64, 64) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) .addGroup( layout .createSequentialGroup() .addGap(132, 132, 132) .addComponent( jPanel2, 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( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGap(20, 20, 20) .addComponent( jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(29, 29, 29) .addComponent( jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGap(18, 18, 18) .addComponent( jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(32, 32, 32))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END:initComponents
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); cadastreObjectBean1 = createCadastreBean(); cadastreObjectTypeListBean1 = new org.sola.clients.beans.referencedata.CadastreObjectTypeListBean(); landUseTypeListBean1 = new org.sola.clients.beans.referencedata.LandUseTypeListBean(); popUpAddresses = new javax.swing.JPopupMenu(); menuAdd1 = new org.sola.clients.swing.common.menuitems.MenuAdd(); menuEdit1 = new org.sola.clients.swing.common.menuitems.MenuEdit(); menuRemove1 = new org.sola.clients.swing.common.menuitems.MenuRemove(); lgaTypeListBean1 = new org.sola.clients.beans.referencedata.LgaTypeListBean(); zoneTypeListBean1 = new org.sola.clients.beans.referencedata.ZoneTypeListBean(); jPanel1 = new javax.swing.JPanel(); jPanel9 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); txtPlot = new javax.swing.JTextField(); jPanel5 = new javax.swing.JPanel(); jLabel9 = new javax.swing.JLabel(); txtParcelSurveyRef = new javax.swing.JTextField(); jPanel8 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); txtBlock = new javax.swing.JTextField(); jPanel4 = new javax.swing.JPanel(); jLabel10 = new javax.swing.JLabel(); cbxParcelEstateType = new javax.swing.JComboBox(); jPanel7 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); txtArea = new javax.swing.JFormattedTextField(); jPanel6 = new javax.swing.JPanel(); labLandUse = new javax.swing.JLabel(); cbxLandUse = new javax.swing.JComboBox(); jPanel11 = new javax.swing.JPanel(); jLabel4 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jPanel13 = new javax.swing.JPanel(); jLabel6 = new javax.swing.JLabel(); jTextField3 = new javax.swing.JTextField(); jPanel2 = new javax.swing.JPanel(); jLabel17 = new javax.swing.JLabel(); txtParcelFirstPart = new javax.swing.JTextField(); jPanel3 = new javax.swing.JPanel(); jLabel7 = new javax.swing.JLabel(); txtParcelLastPart = new javax.swing.JTextField(); jPanel12 = new javax.swing.JPanel(); jPanel14 = new javax.swing.JPanel(); jToolBar1 = new javax.swing.JToolBar(); btnAdd1 = new org.sola.clients.swing.common.buttons.BtnAdd(); btnEdit1 = new org.sola.clients.swing.common.buttons.BtnEdit(); btnRemove1 = new org.sola.clients.swing.common.buttons.BtnRemove(); jScrollPane1 = new javax.swing.JScrollPane(); jTableWithDefaultStyles1 = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles(); groupPanel1 = new org.sola.clients.swing.ui.GroupPanel(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/sola/clients/swing/ui/cadastre/Bundle"); // NOI18N popUpAddresses.setName(bundle.getString("ParcelPanel.popUpAddresses.name")); // NOI18N menuAdd1.setName(bundle.getString("ParcelPanel.menuAdd1.name")); // NOI18N menuAdd1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuAdd1ActionPerformed(evt); } }); popUpAddresses.add(menuAdd1); menuEdit1.setName(bundle.getString("ParcelPanel.menuEdit1.name")); // NOI18N menuEdit1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuEdit1ActionPerformed(evt); } }); popUpAddresses.add(menuEdit1); menuRemove1.setName(bundle.getString("ParcelPanel.menuRemove1.name")); // NOI18N menuRemove1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { menuRemove1ActionPerformed(evt); } }); popUpAddresses.add(menuRemove1); setName("Form"); // NOI18N jPanel1.setName(bundle.getString("ParcelPanel.jPanel1.name")); // NOI18N jPanel1.setLayout(new java.awt.GridLayout(3, 3, 15, 15)); jPanel9.setName("jPanel9"); // NOI18N jLabel3.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel3.setText(bundle.getString("ParcelPanel.jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N txtPlot.setText(bundle.getString("ParcelPanel.txtPlot.text")); // NOI18N txtPlot.setName("txtPlot"); // NOI18N org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${plotNum}"), txtPlot, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel9Layout = new org.jdesktop.layout.GroupLayout(jPanel9); jPanel9.setLayout(jPanel9Layout); jPanel9Layout.setHorizontalGroup( jPanel9Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(txtPlot) .add( jLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel9Layout.setVerticalGroup( jPanel9Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel9Layout .createSequentialGroup() .add(jLabel3) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtPlot, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 18, Short.MAX_VALUE))); jPanel1.add(jPanel9); jPanel5.setName(bundle.getString("ParcelPanel.jPanel5.name")); // NOI18N jLabel9.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel9.setText(bundle.getString("ParcelPanel.jLabel9.text")); // NOI18N jLabel9.setName("jLabel9"); // NOI18N txtParcelSurveyRef.setName("txtParcelSurveyRef"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${sourceReference}"), txtParcelSurveyRef, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(txtParcelSurveyRef) .add( jLabel9, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel5Layout.setVerticalGroup( jPanel5Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel5Layout .createSequentialGroup() .add(jLabel9) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtParcelSurveyRef, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))); jPanel1.add(jPanel5); jPanel8.setName("jPanel8"); // NOI18N jLabel2.setText(bundle.getString("ParcelPanel.jLabel2.text")); // NOI18N jLabel2.setName("jLabel2"); // NOI18N txtBlock.setName("txtBlock"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${block}"), txtBlock, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel8Layout = new org.jdesktop.layout.GroupLayout(jPanel8); jPanel8.setLayout(jPanel8Layout); jPanel8Layout.setHorizontalGroup( jPanel8Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(txtBlock, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 126, Short.MAX_VALUE) .add( jLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel8Layout.setVerticalGroup( jPanel8Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel8Layout .createSequentialGroup() .add(jLabel2) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtBlock, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 18, Short.MAX_VALUE))); jPanel1.add(jPanel8); jPanel4.setName(bundle.getString("ParcelPanel.jPanel4.name")); // NOI18N jLabel10.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel10.setText(bundle.getString("ParcelPanel.jLabel10.text")); // NOI18N jLabel10.setName("jLabel10"); // NOI18N cbxParcelEstateType.setName("cbxParcelEstateType"); // NOI18N cbxParcelEstateType.setRenderer(new SimpleComboBoxRenderer("getDisplayValue")); org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${cadastreObjectTypeList}"); org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectTypeListBean1, eLProperty, cbxParcelEstateType); bindingGroup.addBinding(jComboBoxBinding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${cadastreObjectType}"), cbxParcelEstateType, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); 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().add(jLabel10).add(0, 88, Short.MAX_VALUE)) .add( cbxParcelEstateType, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel4Layout.setVerticalGroup( jPanel4Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel4Layout .createSequentialGroup() .add(jLabel10) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( cbxParcelEstateType, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE))); jPanel1.add(jPanel4); jPanel7.setName(bundle.getString("ParcelPanel.jPanel7.name")); // NOI18N jLabel1.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel1.setText(bundle.getString("ParcelPanel.jLabel1.text")); // NOI18N jLabel1.setName(bundle.getString("ParcelPanel.jLabel1.name")); // NOI18N txtArea.setFormatterFactory(FormattersFactory.getInstance().getDecimalFormatterFactory()); txtArea.setText(bundle.getString("ParcelPanel.txtArea.text")); // NOI18N txtArea.setName(bundle.getString("ParcelPanel.txtArea.name")); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${officialAreaSize}"), txtArea, org.jdesktop.beansbinding.BeanProperty.create("value")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel7Layout = new org.jdesktop.layout.GroupLayout(jPanel7); jPanel7.setLayout(jPanel7Layout); jPanel7Layout.setHorizontalGroup( jPanel7Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel7Layout .createSequentialGroup() .add(jLabel1) .addContainerGap(64, Short.MAX_VALUE)) .add(txtArea)); jPanel7Layout.setVerticalGroup( jPanel7Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel7Layout .createSequentialGroup() .add(jLabel1) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtArea, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))); jPanel1.add(jPanel7); jPanel6.setName(bundle.getString("ParcelPanel.jPanel6.name")); // NOI18N labLandUse.setText(bundle.getString("ParcelPanel.labLandUse.text")); // NOI18N labLandUse.setName(bundle.getString("ParcelPanel.labLandUse.name")); // NOI18N cbxLandUse.setName(bundle.getString("ParcelPanel.cbxLandUse.name")); // NOI18N eLProperty = org.jdesktop.beansbinding.ELProperty.create("${landUseTypeList}"); jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, landUseTypeListBean1, eLProperty, cbxLandUse); bindingGroup.addBinding(jComboBoxBinding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${landUseType}"), cbxLandUse, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel6Layout = new org.jdesktop.layout.GroupLayout(jPanel6); jPanel6.setLayout(jPanel6Layout); jPanel6Layout.setHorizontalGroup( jPanel6Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel6Layout.createSequentialGroup().add(labLandUse).add(0, 82, Short.MAX_VALUE)) .add(cbxLandUse, 0, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)); jPanel6Layout.setVerticalGroup( jPanel6Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel6Layout .createSequentialGroup() .add(labLandUse) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( cbxLandUse, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE))); jPanel1.add(jPanel6); jPanel11.setName("jPanel11"); // NOI18N jLabel4.setText(bundle.getString("ParcelPanel.jLabel4.text")); // NOI18N jLabel4.setName("jLabel4"); // NOI18N jComboBox1.setName("jComboBox1"); // NOI18N eLProperty = org.jdesktop.beansbinding.ELProperty.create("${lgaTypeList}"); jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, lgaTypeListBean1, eLProperty, jComboBox1); bindingGroup.addBinding(jComboBoxBinding); binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, lgaTypeListBean1, org.jdesktop.beansbinding.ELProperty.create("${selectedLgaType}"), jComboBox1, org.jdesktop.beansbinding.BeanProperty.create("selectedItem")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel11Layout = new org.jdesktop.layout.GroupLayout(jPanel11); jPanel11.setLayout(jPanel11Layout); jPanel11Layout.setHorizontalGroup( jPanel11Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel11Layout.createSequentialGroup().add(jLabel4).add(0, 0, Short.MAX_VALUE)) .add(jComboBox1, 0, 126, Short.MAX_VALUE)); jPanel11Layout.setVerticalGroup( jPanel11Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel11Layout .createSequentialGroup() .add(jLabel4) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jComboBox1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 18, Short.MAX_VALUE))); jPanel1.add(jPanel11); jPanel13.setName("jPanel13"); // NOI18N jLabel6.setText(bundle.getString("ParcelPanel.jLabel6.text")); // NOI18N jLabel6.setName("jLabel6"); // NOI18N jTextField3.setName("jTextField3"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${intellMapSheet}"), jTextField3, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel13Layout = new org.jdesktop.layout.GroupLayout(jPanel13); jPanel13.setLayout(jPanel13Layout); jPanel13Layout.setHorizontalGroup( jPanel13Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel13Layout.createSequentialGroup().add(jLabel6).add(0, 59, Short.MAX_VALUE)) .add(jTextField3)); jPanel13Layout.setVerticalGroup( jPanel13Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel13Layout .createSequentialGroup() .add(jLabel6) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jTextField3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 18, Short.MAX_VALUE))); jPanel1.add(jPanel13); jPanel2.setName(bundle.getString("ParcelPanel.jPanel2.name")); // NOI18N jLabel17.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel17.setText(bundle.getString("ParcelPanel.jLabel17.text")); // NOI18N jLabel17.setName("jLabel17"); // NOI18N txtParcelFirstPart.setEditable(false); txtParcelFirstPart.setName("txtParcelFirstPart"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${nameFirstpart}"), txtParcelFirstPart, 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().add(jLabel17).add(0, 68, Short.MAX_VALUE)) .add(txtParcelFirstPart)); jPanel2Layout.setVerticalGroup( jPanel2Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel2Layout .createSequentialGroup() .add(jLabel17) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtParcelFirstPart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE))); jPanel1.add(jPanel2); jPanel3.setName(bundle.getString("ParcelPanel.jPanel3.name")); // NOI18N jLabel7.setIcon( new javax.swing.ImageIcon( getClass().getResource("/images/common/red_asterisk.gif"))); // NOI18N jLabel7.setText(bundle.getString("ParcelPanel.jLabel7.text")); // NOI18N jLabel7.setName("jLabel7"); // NOI18N txtParcelLastPart.setEditable(false); txtParcelLastPart.setName("txtParcelLastPart"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${nameLastpart}"), txtParcelLastPart, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(jPanel3Layout.createSequentialGroup().add(jLabel7).add(0, 69, Short.MAX_VALUE)) .add(txtParcelLastPart)); jPanel3Layout.setVerticalGroup( jPanel3Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel3Layout .createSequentialGroup() .add(jLabel7) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( txtParcelLastPart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .add(0, 0, Short.MAX_VALUE))); jPanel1.add(jPanel3); jPanel12.setName("jPanel12"); // NOI18N org.jdesktop.layout.GroupLayout jPanel12Layout = new org.jdesktop.layout.GroupLayout(jPanel12); jPanel12.setLayout(jPanel12Layout); jPanel12Layout.setHorizontalGroup( jPanel12Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 126, Short.MAX_VALUE)); jPanel12Layout.setVerticalGroup( jPanel12Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 58, Short.MAX_VALUE)); jPanel1.add(jPanel12); jPanel14.setName("jPanel14"); // NOI18N org.jdesktop.layout.GroupLayout jPanel14Layout = new org.jdesktop.layout.GroupLayout(jPanel14); jPanel14.setLayout(jPanel14Layout); jPanel14Layout.setHorizontalGroup( jPanel14Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 126, Short.MAX_VALUE)); jPanel14Layout.setVerticalGroup( jPanel14Layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(0, 58, Short.MAX_VALUE)); jPanel1.add(jPanel14); jToolBar1.setFloatable(false); jToolBar1.setRollover(true); jToolBar1.setName(bundle.getString("ParcelPanel.jToolBar1.name")); // NOI18N btnAdd1.setName(bundle.getString("ParcelPanel.btnAdd1.name")); // NOI18N btnAdd1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnAdd1ActionPerformed(evt); } }); jToolBar1.add(btnAdd1); btnEdit1.setName(bundle.getString("ParcelPanel.btnEdit1.name")); // NOI18N btnEdit1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnEdit1ActionPerformed(evt); } }); jToolBar1.add(btnEdit1); btnRemove1.setName(bundle.getString("ParcelPanel.btnRemove1.name")); // NOI18N btnRemove1.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnRemove1ActionPerformed(evt); } }); jToolBar1.add(btnRemove1); jScrollPane1.setName(bundle.getString("ParcelPanel.jScrollPane1.name")); // NOI18N jTableWithDefaultStyles1.setName( bundle.getString("ParcelPanel.jTableWithDefaultStyles1.name")); // NOI18N eLProperty = org.jdesktop.beansbinding.ELProperty.create("${addressFilteredList}"); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, cadastreObjectBean1, eLProperty, jTableWithDefaultStyles1); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${description}")); columnBinding.setColumnName("Description"); 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, cadastreObjectBean1, org.jdesktop.beansbinding.ELProperty.create("${selectedAddress}"), jTableWithDefaultStyles1, org.jdesktop.beansbinding.BeanProperty.create("selectedElement")); bindingGroup.addBinding(binding); jScrollPane1.setViewportView(jTableWithDefaultStyles1); if (jTableWithDefaultStyles1.getColumnModel().getColumnCount() > 0) { jTableWithDefaultStyles1 .getColumnModel() .getColumn(0) .setHeaderValue( bundle.getString( "ParcelPanel.jTableWithDefaultStyles1.columnModel.title0_1")); // NOI18N jTableWithDefaultStyles1 .getColumnModel() .getColumn(0) .setCellRenderer(new org.sola.clients.swing.ui.renderers.TableCellTextAreaRenderer()); } groupPanel1.setName(bundle.getString("ParcelPanel.groupPanel1.name")); // NOI18N groupPanel1.setTitleText(bundle.getString("ParcelPanel.groupPanel1.titleText")); // NOI18N org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add( jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) .add(groupPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)); layout.setVerticalGroup( layout .createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add( layout .createSequentialGroup() .add( jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 205, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( groupPanel1, 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( jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) .add( jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE))); 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() { 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(); }
/** * 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( "com.javaswingmaven_T08_Database_Access_jar_1.0-SNAPSHOTPU") .createEntityManager(); customerQuery = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT c FROM Customer c"); customers = ObservableCollections.observableList( java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : customerQuery.getResultList()); jScrollPane1 = new javax.swing.JScrollPane(); customersTbl = new javax.swing.JTable(); addBtn = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, customers, customersTbl); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${customerId}")); columnBinding.setColumnName("Customer Id"); columnBinding.setColumnClass(Integer.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("${addressline1}")); columnBinding.setColumnName("Addressline1"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${addressline2}")); columnBinding.setColumnName("Addressline2"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${city}")); columnBinding.setColumnName("City"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${state}")); columnBinding.setColumnName("State"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${phone}")); columnBinding.setColumnName("Phone"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${fax}")); columnBinding.setColumnName("Fax"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${email}")); columnBinding.setColumnName("Email"); columnBinding.setColumnClass(String.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${creditLimit}")); columnBinding.setColumnName("Credit Limit"); columnBinding.setColumnClass(Integer.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${discountCode}")); columnBinding.setColumnName("Discount Code"); columnBinding.setColumnClass(com.javaswingmaven.models.DiscountCode.class); columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${zip}")); columnBinding.setColumnName("Zip"); columnBinding.setColumnClass(com.javaswingmaven.models.MicroMarket.class); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(customersTbl); addBtn.setText("Add"); addBtn.addActionListener( new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { addBtnActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent( jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE) .addGroup( layout .createSequentialGroup() .addGap(180, 180, 180) .addComponent(addBtn) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(addBtn))); bindingGroup.bind(); pack(); } // </editor-fold>//GEN-END:initComponents
/** Initialize ConditionsPanel components */ private void initConditionsPanel() { // set selected matrix dimension to "2D" setupConditionsPanel.getEcmDimensionComboBox().setSelectedIndex(0); setupConditionsPanel.getjTabbedPane1().setEnabled(false); // set current and previous conditions indexes conditionIndex = 0; previousConditionIndex = -1; conditionsPanel.getAddButton().setEnabled(false); // init conditionJList (create new empty list) (conditions are NOT retrieved from DB) plateConditionBindingList = ObservableCollections.observableList(new ArrayList<PlateCondition>()); // autobind cell line // autobind seeding density Binding binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.seedingDensity"), setupConditionsPanel.getSeedingDensityTextField(), BeanProperty.create("text"), "seedingdensitybinding"); bindingGroup.addBinding(binding); // autobind seeding time binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.seedingTime"), setupConditionsPanel.getSeedingTimeTextField(), BeanProperty.create("text"), "seedingtimebinding"); bindingGroup.addBinding(binding); // autobind growth medium binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.growthMedium"), setupConditionsPanel.getGrowthMediumComboBox(), BeanProperty.create("selectedItem"), "growthmediumbinding"); bindingGroup.addBinding(binding); // autobind serum binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.serum"), setupConditionsPanel.getSerumComboBox(), BeanProperty.create("selectedItem"), "celllineserumbinding"); bindingGroup.addBinding(binding); // autobind serum concentration binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.serumConcentration"), setupConditionsPanel.getSerumConcentrationTextField(), BeanProperty.create("text"), "celllineserumconcentrationbinding"); bindingGroup.addBinding(binding); // autobind cell line type binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.cellLine.cellLineType"), setupConditionsPanel.getCellLineComboBox(), BeanProperty.create("selectedItem"), "celllinetypebinding"); bindingGroup.addBinding(binding); // autobind assay medium // autobind medium binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.assayMedium.medium"), treatmentsController.getTreatmentsPanel().getAssayMediumComboBox(), BeanProperty.create("selectedItem"), "assaymediumbinding"); bindingGroup.addBinding(binding); // autobind serum binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.assayMedium.serum"), treatmentsController.getTreatmentsPanel().getSerumComboBox(), BeanProperty.create("selectedItem"), "assayserumbinding"); bindingGroup.addBinding(binding); // autobind serum concentration binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.assayMedium.serumConcentration"), treatmentsController.getTreatmentsPanel().getSerumConcentrationTextField(), BeanProperty.create("text"), "assayserumconcentrationbinding"); bindingGroup.addBinding(binding); // autobind volume binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.assayMedium.volume"), treatmentsController.getTreatmentsPanel().getMediumVolumeTextField(), BeanProperty.create("text"), "assayvolumebinding"); bindingGroup.addBinding(binding); // autobind matrix dimension binding = Bindings.createAutoBinding( AutoBinding.UpdateStrategy.READ_WRITE, conditionsPanel.getConditionsJList(), BeanProperty.create("selectedElement.matrixDimension"), setupConditionsPanel.getEcmDimensionComboBox(), BeanProperty.create("selectedItem"), "matrixdimensionbinding"); bindingGroup.addBinding(binding); bindingGroup.bind(); // init conditionListBinding JListBinding conditionListBinding = SwingBindings.createJListBinding( AutoBinding.UpdateStrategy.READ_WRITE, plateConditionBindingList, conditionsPanel.getConditionsJList()); bindingGroup.addBinding(conditionListBinding); bindingGroup.bind(); // create and init the first condition (Condition 1) PlateCondition firstCondition = createFirstCondition(); // add Condition 1 to the list plateConditionBindingList.add(firstCondition); // set cell renderer for conditionJList conditionsPanel.getConditionsJList().setCellRenderer(new ConditionsSetupListRenderer()); /** add mouse listeners */ // if Condition validation is OK, update previous condition and user input fields conditionsPanel .getConditionsJList() .getSelectionModel() .addListSelectionListener( new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { conditionsPanel.getAddButton().setEnabled(true); int selectedIndex = conditionsPanel.getConditionsJList().getSelectedIndex(); if (selectedIndex != -1) { // add mouse listener and enable tabbed pane on the right (only once, for // Condition 1) if (selectedIndex == 0) { setupExperimentController.addMouseListener(); setupConditionsPanel.getjTabbedPane1().setEnabled(true); } if (previousConditionIndex < plateConditionBindingList.size() && previousConditionIndex != -1) { // check if validation of condition is OK if (setupExperimentController.validateCondition( plateConditionBindingList.get(previousConditionIndex))) { // update fields of previous condition updateCondition(previousConditionIndex); // update and reset fields for the assay-ecm panel assayEcmController.updateAssayEcmInputFields( plateConditionBindingList.get(selectedIndex)); // assayEcmPanelController.resetAssayEcmInputFields(plateConditionBindingList.get(locationToIndex)); // keep source and destination lists sync: show actual treatment collection treatmentsController.updateLists( plateConditionBindingList.get(selectedIndex)); } } previousConditionIndex = selectedIndex; } } } }); // add an empty list of rectangles for Condition 1 setupExperimentController.onNewConditionAdded(firstCondition); // disable the Remove Button conditionsPanel.getRemoveButton().setEnabled(false); /** add action listeners */ // add a new Condition to the List // each new Condition is init through values selected from the previously created one! conditionsPanel .getAddButton() .addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // create and init a new Condition PlateCondition newCondition = new PlateCondition(); initNewCondition(newCondition); // add the new Condition to the list plateConditionBindingList.add(newCondition); // add a new empty list of rectangles for the just added Condition setupExperimentController.onNewConditionAdded(newCondition); // after a new condition is added enable the remove button if (!conditionsPanel.getRemoveButton().isEnabled()) { conditionsPanel.getRemoveButton().setEnabled(true); } } }); // remove a Condition from the list conditionsPanel .getRemoveButton() .addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (conditionsPanel.getConditionsJList().getSelectedValue() != null) { // empty the list of rectangles for this Condition and reset to null the Condition // of the associated wells setupExperimentController.onConditionToRemove( (PlateCondition) (conditionsPanel.getConditionsJList().getSelectedValue())); // remove the Condition from the list int selectedIndex = conditionsPanel.getConditionsJList().getSelectedIndex(); PlateCondition conditionToRemove = plateConditionBindingList.get(selectedIndex); // if the condition to remove is the last one, decrease previous condition index if (plateConditionBindingList.indexOf(conditionToRemove) == plateConditionBindingList.size() - 1) { previousConditionIndex = plateConditionBindingList.size() - 2; } // remove condition from the list plateConditionBindingList.remove(conditionToRemove); // select first condition after removing conditionsPanel.getConditionsJList().setSelectedIndex(0); // if there's only one condition left, disable again the remove button if (plateConditionBindingList.size() == 1) { conditionsPanel.getRemoveButton().setEnabled(false); } } } }); }
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { bindingGroup = new org.jdesktop.beansbinding.BindingGroup(); jLabel1 = new javax.swing.JLabel(); txtName = new javax.swing.JTextField(); jLabel2 = new javax.swing.JLabel(); txtDescription = new javax.swing.JTextField(); jScrollPane1 = new javax.swing.JScrollPane(); tableRoles = new org.sola.clients.swing.common.controls.JTableWithDefaultStyles(); jLabel3 = new javax.swing.JLabel(); java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("org/sola/clients/swing/ui/security/Bundle"); // NOI18N jLabel1.setText(bundle.getString("GroupPanel.jLabel1.text")); // NOI18N jLabel1.setName("jLabel1"); // NOI18N txtName.setName("txtName"); // NOI18N org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${group.name}"), txtName, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jLabel2.setText(bundle.getString("GroupPanel.jLabel2.text")); // NOI18N jLabel2.setName("jLabel2"); // NOI18N txtDescription.setName("txtDescription"); // NOI18N binding = org.jdesktop.beansbinding.Bindings.createAutoBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, org.jdesktop.beansbinding.ELProperty.create("${group.description}"), txtDescription, org.jdesktop.beansbinding.BeanProperty.create("text")); bindingGroup.addBinding(binding); jScrollPane1.setName("jScrollPane1"); // NOI18N tableRoles.setName("tableRoles"); // NOI18N org.jdesktop.beansbinding.ELProperty eLProperty = org.jdesktop.beansbinding.ELProperty.create("${groupRoleHelperList.groupRoleHelpers}"); org.jdesktop.swingbinding.JTableBinding jTableBinding = org.jdesktop.swingbinding.SwingBindings.createJTableBinding( org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, this, eLProperty, tableRoles); org.jdesktop.swingbinding.JTableBinding.ColumnBinding columnBinding = jTableBinding.addColumnBinding(org.jdesktop.beansbinding.ELProperty.create("${inGroup}")); columnBinding.setColumnName("In Group"); columnBinding.setColumnClass(Boolean.class); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${role.displayValue}")); columnBinding.setColumnName("Role.display Value"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); columnBinding = jTableBinding.addColumnBinding( org.jdesktop.beansbinding.ELProperty.create("${role.description}")); columnBinding.setColumnName("Role.description"); columnBinding.setColumnClass(String.class); columnBinding.setEditable(false); bindingGroup.addBinding(jTableBinding); jTableBinding.bind(); jScrollPane1.setViewportView(tableRoles); tableRoles.getColumnModel().getColumn(0).setPreferredWidth(40); tableRoles.getColumnModel().getColumn(0).setMaxWidth(40); tableRoles .getColumnModel() .getColumn(0) .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title0_1")); // NOI18N tableRoles.getColumnModel().getColumn(1).setPreferredWidth(160); tableRoles.getColumnModel().getColumn(1).setMaxWidth(160); tableRoles .getColumnModel() .getColumn(1) .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title1_1")); // NOI18N tableRoles .getColumnModel() .getColumn(2) .setHeaderValue(bundle.getString("GroupPanel.tableRoles.columnModel.title2_1")); // NOI18N tableRoles.getColumnModel().getColumn(2).setCellRenderer(new TableCellTextAreaRenderer()); jLabel3.setText(bundle.getString("GroupPanel.jLabel3.text")); // NOI18N jLabel3.setName("jLabel3"); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( javax.swing.GroupLayout.Alignment.TRAILING, layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE) .addGroup( javax.swing.GroupLayout.Alignment.LEADING, layout .createSequentialGroup() .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent( txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 246, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup( layout .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addComponent(jLabel2) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement .RELATED, 213, Short.MAX_VALUE)) .addComponent( txtDescription, javax.swing.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE))) .addComponent(jLabel3, javax.swing.GroupLayout.Alignment.LEADING)) .addContainerGap())); layout.setVerticalGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup( layout .createSequentialGroup() .addGroup( layout .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup( layout .createSequentialGroup() .addComponent(jLabel2) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( txtDescription, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup( layout .createSequentialGroup() .addComponent(jLabel1) .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent( jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))); bindingGroup.bind(); } // </editor-fold>//GEN-END:initComponents
@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
/** * 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
@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
/** * 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