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());
 }
  public SequenceViewPartExport(SequenceView sv, JTextPane jtp) {
    initComponents();
    _sv = sv;
    //        addWindowListener(new WindowAdapter(){
    //        @Override
    //        public void windowClosing(WindowEvent we){
    //            ClothoDialogBox db = new ClothoDialogBox("Clotho: Exit Check", "Are you sure you
    // want to close the packager?");
    //
    //            if(db.show_optionDialog(javax.swing.JOptionPane.YES_NO_OPTION,
    // javax.swing.JOptionPane.QUESTION_MESSAGE) == javax.swing.JOptionPane.YES_OPTION)
    //                dispose();
    //            }
    //        });
    dataTextPane.setText(jtp.getText());
    if (jtp.getSelectedText() != null) {
      intervalRadioButton.setSelected(true);
      fromTextField.setText(Integer.toString(jtp.getSelectionStart()));
      fromTextField.getDocument().addDocumentListener(new SelectionListener());
      toTextField.setText(Integer.toString(jtp.getSelectionEnd()));
      toTextField.getDocument().addDocumentListener(new SelectionListener());
      try {
        //                dataTextPane.grabFocus();
        dataTextPane.select(jtp.getSelectionStart(), jtp.getSelectionEnd());
        dataTextPane
            .getHighlighter()
            .addHighlight(
                jtp.getSelectionStart(),
                jtp.getSelectionEnd(),
                new javax.swing.text.DefaultHighlighter.DefaultHighlightPainter(
                    dataTextPane.getSelectionColor()));
      } catch (Exception e) {
      }
    } else {
      try {
        //                dataTextPane.grabFocus();
        dataTextPane.selectAll();
        dataTextPane
            .getHighlighter()
            .addHighlight(
                0,
                dataTextPane.getText().length(),
                new javax.swing.text.DefaultHighlighter.DefaultHighlightPainter(
                    dataTextPane.getSelectionColor()));
      } catch (Exception ex) {
        Exceptions.printStackTrace(ex);
      }
      fromTextField.setText("0");
      toTextField.setText(Integer.toString(jtp.getText().length()));
      wsRadioButton.setSelected(true);
      try {
        dataTextPane
            .getHighlighter()
            .addHighlight(
                0,
                dataTextPane.getText().length(),
                new javax.swing.text.DefaultHighlighter.DefaultHighlightPainter(
                    dataTextPane.getSelectionColor()));
        dataTextPane.grabFocus();
        dataTextPane.selectAll();
      } catch (Exception ex) {
        Exceptions.printStackTrace(ex);
      }
    }
    ArrayList<ObjLink> collectionLinks = Collector.getAllLinksOf(ObjType.COLLECTION);
    collectionComboBox.removeAllItems();
    for (ObjLink oj : collectionLinks) {
      collectionComboBox.addItem(oj);
    }
    collectionComboBox.setSelectedIndex(-1);
    formatComboBox.removeAllItems();
    ArrayList<ObjLink> formatLinks = Collector.getAllLinksOf(ObjType.FORMAT);
    for (ObjLink oj : formatLinks) {
      formatComboBox.addItem(oj);
    }
    formatComboBox.setSelectedIndex(-1);
    objectTypeComboBox.removeAllItems();
    objectTypeComboBox.addItem("Feature");
    objectTypeComboBox.addItem("Oligo");
    objectTypeComboBox.addItem("Part");
    objectTypeComboBox.addItem("Vector");
    objectTypeComboBox.setSelectedIndex(-1);
    formatComboBox.setEnabled(false);
    formatLabel.setEnabled(false);

    this.setVisible(true);
  }