package com.compomics.util.protein_sequences_manager.gui.sequences_import.taxonomy; import java.util.HashMap; /** * Taxonomy tree dialog. * * @author Kenneth Verheggen */ public class TaxonomyTreeDialog extends javax.swing.JDialog { /** * Creates a new TaxonomyTreeDialog. * * @param parent the parent frame * @param modal whether the dialog is to be modal or not */ public TaxonomyTreeDialog(java.awt.Frame parent, boolean modal) { super(parent, modal); initComponents(); } /** * Returns the selected taxonomy ID and their corresponding name. * * @return the selected taxonomy ID and their corresponding name */ public HashMap<String, String> getTaxonomyResult() { return taxonomyTreePanel1.getSelectedTaxonomyMap(); } /** * 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() { backgroundPanel = new javax.swing.JPanel(); taxonomyTreePanel1 = new com.compomics.util.protein_sequences_manager.gui.sequences_import.taxonomy.TaxonomyTreePanel(); btnConfirm = new javax.swing.JButton(); btnCancel = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); backgroundPanel.setBackground(new java.awt.Color(255, 255, 255)); btnConfirm.setText("OK"); btnConfirm.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnConfirmActionPerformed(evt); } }); btnCancel.setText("Cancel"); btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); javax.swing.GroupLayout backgroundPanelLayout = new javax.swing.GroupLayout(backgroundPanel); backgroundPanel.setLayout(backgroundPanelLayout); backgroundPanelLayout.setHorizontalGroup( backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(backgroundPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(taxonomyTreePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 797, Short.MAX_VALUE) .addContainerGap()) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, backgroundPanelLayout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(btnConfirm) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnCancel) .addGap(7, 7, 7)) ); backgroundPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {btnCancel, btnConfirm}); backgroundPanelLayout.setVerticalGroup( backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(backgroundPanelLayout.createSequentialGroup() .addContainerGap() .addComponent(taxonomyTreePanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 441, Short.MAX_VALUE) .addGap(18, 18, 18) .addGroup(backgroundPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnConfirm) .addComponent(btnCancel)) .addContainerGap()) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(backgroundPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(backgroundPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * Close the dialog. * * @param evt */ private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelActionPerformed this.dispose(); }//GEN-LAST:event_btnCancelActionPerformed /** * Hide the dialog. * * @param evt */ private void btnConfirmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmActionPerformed this.setVisible(false); }//GEN-LAST:event_btnConfirmActionPerformed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JPanel backgroundPanel; private javax.swing.JButton btnCancel; private javax.swing.JButton btnConfirm; private com.compomics.util.protein_sequences_manager.gui.sequences_import.taxonomy.TaxonomyTreePanel taxonomyTreePanel1; // End of variables declaration//GEN-END:variables }