Ejemplo n.º 1
0
 private void btnNewActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnNewActionPerformed
   String name = JOptionPane.showInputDialog(null, "Footprint name");
   if (name != null && !name.isEmpty()) {
     int footprintId = DataStore.addFootprint(name);
     if (footprintId != -1) {
       Globals.setCurrentFootprintId(footprintId);
       Globals.setCurrentFootprintName(name);
       ((FootprintModel) tblFootprints.getModel()).reload();
       new StartFootprintInit().setVisible(true);
     }
   }
 } // GEN-LAST:event_btnNewActionPerformed
Ejemplo n.º 2
0
 private void btnCloseActionPerformed(
     java.awt.event.ActionEvent evt) { // GEN-FIRST:event_btnCloseActionPerformed
   if (tblFootprints.getSelectedRowCount() == 1) {
     FootprintData fpd =
         ((FootprintData)
             ((FootprintModel) this.tblFootprints.getModel())
                 .valueAt(this.tblFootprints.getSelectedRow()));
     Globals.setCurrentFootprintId(fpd.getId());
     Globals.setCurrentFootprintName(fpd.getName());
     this.setVisible(false);
   } else {
     JOptionPane.showMessageDialog(this, "Please create or select a footprint.");
   }
 } // GEN-LAST:event_btnCloseActionPerformed