private void makePlateActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_makePlateActionPerformed // TODO add your handling code here: platetypeList = Collector.getAllLinksOf(ObjType.PLATE_TYPE); authorList = Collector.getAllLinksOf(ObjType.PERSON); int authorSelect = this.jComboBoxAuthor.getSelectedIndex(); int plateTypeSelect = this.jComboBoxPlateType.getSelectedIndex(); ObjLink plateLink = platetypeList.get(plateTypeSelect); ObjLink personLink = authorList.get(authorSelect); Person testPerson = Collector.getPerson(personLink.uuid); PlateType testType = Collector.getPlateType(plateLink.uuid); Plate testPlate = new Plate(this.plateName.getText(), testType, testPerson); if (this.location.getText() != null) { testPlate.setLocation(this.location.getText()); } if (this.barCode.getText() != null) testPlate.setBarcode(this.barCode.getText()); boolean didWork = testPlate.saveDefault(); System.out.println("write plate to DB:" + didWork); this.parentFrame.setVisible(false); frame aframe = new frame(testPlate); hub.guis.add(new WeakReference(aframe)); } // GEN-LAST:event_makePlateActionPerformed
private void addPlateType() { platetypeList = Collector.getAllLinksOf(ObjType.PLATE_TYPE); Iterator i = platetypeList.iterator(); while (i.hasNext()) this.jComboBoxPlateType.addItem(i.next()); }
private void addAuthor() { authorList = Collector.getAllLinksOf(ObjType.PERSON); Iterator i = authorList.iterator(); while (i.hasNext()) this.jComboBoxAuthor.addItem(i.next()); }