<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package usda.weru.soil.gui;

import de.schlichtherle.truezip.file.TFile;
import java.awt.event.ActionEvent;
import usda.weru.util.About;
import usda.weru.util.Util;
import usda.weru.util.wepsFileChooser2.WepsFileChooser2;
import usda.weru.util.wepsFileChooser2.WepsFileTypes2;

/**
 *
 * @author jonathanhornbaker
 */
public class MassSoilChooser_n extends javax.swing.JFrame
{
    private static final long serialVersionUID = 1L;

    /**
     * Creates new form MassSoilChooser_new
     */    
    public MassSoilChooser_n() {
        initComponents();       
        setIconImage (About.getWeruIconImage());
        g_tree.setShowsRootHandles(true);
    }

    /**
     * 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")
    // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;//GEN-BEGIN:initComponents
    private void initComponents()
    {

        destinationDirectoryField = new javax.swing.JTextField();
        componentsTot = new javax.swing.JLabel();
        totalProgress = new javax.swing.JProgressBar();
        componentsNum = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        componentsLab = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        mapUnitsLab = new javax.swing.JLabel();
        cancelAllButton = new javax.swing.JButton();
        mapUnitsNum = new javax.swing.JLabel();
        componentProgress = new javax.swing.JProgressBar();
        mapUnitsTot = new javax.swing.JLabel();
        legendsLab = new javax.swing.JLabel();
        g_scrollPane = new javax.swing.JScrollPane();
        g_tree = new javax.swing.JTree();
        legendsNum = new javax.swing.JLabel();
        legendsTot = new javax.swing.JLabel();
        downloadButton = new javax.swing.JButton();
        destinationDirectoryButton = new javax.swing.JButton();
        exitButton = new javax.swing.JButton();
        clearSelectionButton = new javax.swing.JButton();
        JCB_printFullPath = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(400, 600));

        destinationDirectoryField.setText(org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.destinationDirectoryField.text")); // NOI18N
        destinationDirectoryField.addFocusListener(new java.awt.event.FocusAdapter()
        {
            public void focusLost(java.awt.event.FocusEvent evt)
            {
                destinationDirectoryFieldFocusLost(evt);
            }
        });
        destinationDirectoryField.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                destinationDirectoryFieldActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(componentsTot, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.componentsTot.text")); // NOI18N

        totalProgress.setPreferredSize(new java.awt.Dimension(146, 21));
        totalProgress.setString(org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.totalProgress.string")); // NOI18N
        totalProgress.setStringPainted(true);

        org.openide.awt.Mnemonics.setLocalizedText(componentsNum, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.componentsNum.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.jLabel1.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(componentsLab, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.componentsLab.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.jLabel2.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(mapUnitsLab, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.mapUnitsLab.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(cancelAllButton, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.cancelAllButton.text")); // NOI18N
        cancelAllButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                cancelAllButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(mapUnitsNum, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.mapUnitsNum.text")); // NOI18N

        componentProgress.setPreferredSize(new java.awt.Dimension(429, 21));
        componentProgress.setString(org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.componentProgress.string")); // NOI18N
        componentProgress.setStringPainted(true);

        org.openide.awt.Mnemonics.setLocalizedText(mapUnitsTot, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.mapUnitsTot.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(legendsLab, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.legendsLab.text")); // NOI18N

        g_tree.addMouseListener(new java.awt.event.MouseAdapter()
        {
            public void mouseClicked(java.awt.event.MouseEvent evt)
            {
                g_treeMouseClicked(evt);
            }
        });
        g_tree.addTreeSelectionListener(new javax.swing.event.TreeSelectionListener()
        {
            public void valueChanged(javax.swing.event.TreeSelectionEvent evt)
            {
                g_treeValueChanged(evt);
            }
        });
        g_scrollPane.setViewportView(g_tree);

        org.openide.awt.Mnemonics.setLocalizedText(legendsNum, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.legendsNum.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(legendsTot, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.legendsTot.text")); // NOI18N

        org.openide.awt.Mnemonics.setLocalizedText(downloadButton, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.downloadButton.text")); // NOI18N
        downloadButton.setEnabled(false);
        downloadButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                downloadButtonActionPerformed(evt);
            }
        });

        destinationDirectoryButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/usda/weru/resources/folder.gif"))); // NOI18N
        destinationDirectoryButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                destinationDirectoryButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(exitButton, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.exitButton.text")); // NOI18N
        exitButton.setMaximumSize(new java.awt.Dimension(101, 31));
        exitButton.setMinimumSize(new java.awt.Dimension(101, 31));
        exitButton.setPreferredSize(new java.awt.Dimension(101, 31));
        exitButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                exitButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(clearSelectionButton, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.clearSelectionButton.text")); // NOI18N
        clearSelectionButton.setEnabled(false);
        clearSelectionButton.addActionListener(new java.awt.event.ActionListener()
        {
            public void actionPerformed(java.awt.event.ActionEvent evt)
            {
                clearSelectionButtonActionPerformed(evt);
            }
        });

        org.openide.awt.Mnemonics.setLocalizedText(JCB_printFullPath, org.openide.util.NbBundle.getMessage(MassSoilChooser_n.class, "MassSoilChooser_n.JCB_printFullPath.text")); // NOI18N

        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(g_scrollPane)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(destinationDirectoryField)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(destinationDirectoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(componentProgress, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE)
                    .addComponent(totalProgress, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel2)
                            .addComponent(cancelAllButton))
                        .addGap(0, 220, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGap(0, 0, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(legendsLab)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(legendsNum)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(legendsTot)
                                    .addGap(43, 43, 43)
                                    .addComponent(clearSelectionButton)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(downloadButton))
                                .addGroup(layout.createSequentialGroup()
                                    .addComponent(mapUnitsLab)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(mapUnitsNum)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(mapUnitsTot)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                    .addComponent(componentsLab)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(componentsNum)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(componentsTot)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(JCB_printFullPath, javax.swing.GroupLayout.Alignment.TRAILING))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(destinationDirectoryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(destinationDirectoryButton, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(g_scrollPane, javax.swing.GroupLayout.DEFAULT_SIZE, 332, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(totalProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cancelAllButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(componentProgress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7)
                .addComponent(JCB_printFullPath)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(downloadButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(clearSelectionButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(legendsNum)
                    .addComponent(legendsLab)
                    .addComponent(legendsTot))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(mapUnitsTot)
                    .addComponent(mapUnitsNum)
                    .addComponent(mapUnitsLab)
                    .addComponent(componentsTot)
                    .addComponent(componentsNum)
                    .addComponent(componentsLab))
                .addContainerGap())
        );

        pack();
    }// &lt;/editor-fold&gt;//GEN-END:initComponents

    private void destinationDirectoryFieldFocusLost(java.awt.event.FocusEvent evt)//GEN-FIRST:event_destinationDirectoryFieldFocusLost
    {//GEN-HEADEREND:event_destinationDirectoryFieldFocusLost
        destinationDirectoryFieldUpdate();
    }//GEN-LAST:event_destinationDirectoryFieldFocusLost

    private void destinationDirectoryFieldActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_destinationDirectoryFieldActionPerformed
    {//GEN-HEADEREND:event_destinationDirectoryFieldActionPerformed
        destinationDirectoryFieldUpdate();
    }//GEN-LAST:event_destinationDirectoryFieldActionPerformed

    private void cancelAllButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_cancelAllButtonActionPerformed
    {//GEN-HEADEREND:event_cancelAllButtonActionPerformed
        CancelAllButtonActionPerformed(evt);
    }//GEN-LAST:event_cancelAllButtonActionPerformed

    private void g_treeMouseClicked(java.awt.event.MouseEvent evt)//GEN-FIRST:event_g_treeMouseClicked
    {//GEN-HEADEREND:event_g_treeMouseClicked
        treeMouseClicked(evt);
    }//GEN-LAST:event_g_treeMouseClicked

    private void g_treeValueChanged(javax.swing.event.TreeSelectionEvent evt)//GEN-FIRST:event_g_treeValueChanged
    {//GEN-HEADEREND:event_g_treeValueChanged
        treeValueChanged(evt);
    }//GEN-LAST:event_g_treeValueChanged

    private void downloadButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_downloadButtonActionPerformed
    {//GEN-HEADEREND:event_downloadButtonActionPerformed
        downloadButtonAction(evt);
    }//GEN-LAST:event_downloadButtonActionPerformed

    private void destinationDirectoryButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_destinationDirectoryButtonActionPerformed
    {//GEN-HEADEREND:event_destinationDirectoryButtonActionPerformed
        destinationDirectoryChooser();
    }//GEN-LAST:event_destinationDirectoryButtonActionPerformed

    private void exitButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_exitButtonActionPerformed
    {//GEN-HEADEREND:event_exitButtonActionPerformed
        ExitButtonActionPerformed(evt);
    }//GEN-LAST:event_exitButtonActionPerformed

    private void clearSelectionButtonActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_clearSelectionButtonActionPerformed
    {//GEN-HEADEREND:event_clearSelectionButtonActionPerformed
        clearSelection();
    }//GEN-LAST:event_clearSelectionButtonActionPerformed

    /**
     *
     * @param evt
     */
    protected void indexActionPerformed(java.awt.event.ActionEvent evt) {

    }
                                  
    /**
     * Clears the current selection.
     */
    protected void clearSelection(){}
    
    /**
     *
     * @param evt
     */
    protected void treeMouseClicked(java.awt.event.MouseEvent evt) {                                    

    }                              

    /**
     *
     * @param evt
     */
    protected void treeValueChanged(javax.swing.event.TreeSelectionEvent evt) {

    }
    
    protected void ExitButtonActionPerformed(ActionEvent evt) {}

    protected void CancelAllButtonActionPerformed(java.awt.event.ActionEvent evt) {}
    /**
     *
     * @param evt
     */
    protected void downloadButtonAction(ActionEvent evt) {                                               

}   
    protected void destinationDirectoryFieldUpdate()
    {

    }
    private void destinationDirectoryChooser()
    {
        WepsFileChooser2 wfc = new WepsFileChooser2(WepsFileTypes2.Dir, 
                destinationDirectoryField.getText(), WepsFileChooser2.Action.Select);
        wfc.setCurrentDirectory(new TFile(destinationDirectoryField.getText()));
        wfc.allowNewDir(true);
        if (wfc.showDialog(this) == WepsFileChooser2.APPROVE_OPTION) 
        {
            TFile install = new TFile(".").getCanOrAbsFile();
            TFile selected = new TFile(wfc.getSelectedFile());
            selected = Util.resolveFileAsRelativeChildOrAbsolute(install, selected);

            String path = selected.getPath();
            destinationDirectoryField.setText(path + TFile.separator);
            destinationDirectoryFieldUpdate();
        }

    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[])
    {
        /* Set the Nimbus look and feel */
        //&lt;editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "&gt;
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try
        {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
            {
                if ("Nimbus".equals(info.getName()))
                {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        }
        catch (ClassNotFoundException ex)
        {
            java.util.logging.Logger.getLogger(MassSoilChooser_n.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        catch (InstantiationException ex)
        {
            java.util.logging.Logger.getLogger(MassSoilChooser_n.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        catch (IllegalAccessException ex)
        {
            java.util.logging.Logger.getLogger(MassSoilChooser_n.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        catch (javax.swing.UnsupportedLookAndFeelException ex)
        {
            java.util.logging.Logger.getLogger(MassSoilChooser_n.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //&lt;/editor-fold&gt;
        //&lt;/editor-fold&gt;

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable()
        {
            public void run()
            {
                new MassSoilChooser_n().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    protected javax.swing.JCheckBox JCB_printFullPath;
    protected javax.swing.JButton cancelAllButton;
    protected javax.swing.JButton clearSelectionButton;
    protected javax.swing.JProgressBar componentProgress;
    protected javax.swing.JLabel componentsLab;
    protected javax.swing.JLabel componentsNum;
    protected javax.swing.JLabel componentsTot;
    protected javax.swing.JButton destinationDirectoryButton;
    protected javax.swing.JTextField destinationDirectoryField;
    protected javax.swing.JButton downloadButton;
    protected javax.swing.JButton exitButton;
    private javax.swing.JScrollPane g_scrollPane;
    protected javax.swing.JTree g_tree;
    protected javax.swing.JLabel jLabel1;
    protected javax.swing.JLabel jLabel2;
    protected javax.swing.JLabel legendsLab;
    protected javax.swing.JLabel legendsNum;
    private javax.swing.JLabel legendsTot;
    protected javax.swing.JLabel mapUnitsLab;
    protected javax.swing.JLabel mapUnitsNum;
    protected javax.swing.JLabel mapUnitsTot;
    protected javax.swing.JProgressBar totalProgress;
    // End of variables declaration//GEN-END:variables
}
</pre></body></html>