/*
 * Weather_n.java
 *
 * Created on January 3, 2006, 1:33 PM
 */

package usda.weru.erosion.gui;

/**
 *
 * @author  wjr
 */
public class Weather_n extends javax.swing.JFrame {
    private static final long serialVersionUID = 1L;
    
    /** Creates new form Weather_n */
    public Weather_n() {
        initComponents();
    }
    
    /** 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.
     */
    // suppression is because the Netbeans designer doesn't allow specifying the type of
    // DefaultComboBoxModels.
    @SuppressWarnings({"rawtypes","unchecked"})
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        BG_windWeibull = new javax.swing.ButtonGroup();
        BG_zoLocFlg = new javax.swing.ButtonGroup();
        JSP_windTable = new javax.swing.JScrollPane();
        JTA_windTable = new javax.swing.JTextArea();
        JP_weather = new javax.swing.JPanel();
        jLabel30 = new javax.swing.JLabel();
        JTF_airDensity = new javax.swing.JTextField();
        jLabel31 = new javax.swing.JLabel();
        JTF_windDirection = new javax.swing.JTextField();
        jLabel32 = new javax.swing.JLabel();
        jLabel33 = new javax.swing.JLabel();
        JTF_anemometerHeight = new javax.swing.JTextField();
        jLabel34 = new javax.swing.JLabel();
        JTF_aeroRoughness = new javax.swing.JTextField();
        jLabel35 = new javax.swing.JLabel();
        JRB_zoStation = new javax.swing.JRadioButton();
        JRB_zoField = new javax.swing.JRadioButton();
        JRB_init1 = new javax.swing.JRadioButton();
        jLabel40 = new javax.swing.JLabel();
        JB_estimate = new javax.swing.JButton();
        JP_windSpeeds = new javax.swing.JPanel();
        jcTable = new com.klg.jclass.table.beans.LiveTable();
        JCB_intervals = new javax.swing.JComboBox<String>();
        JB_calcWeibullWindSpeeds = new javax.swing.JButton();

        JSP_windTable.setEnabled(false);

        JTA_windTable.setTabSize(6);
        JTA_windTable.setToolTipText("Weather:windTable");
        JTA_windTable.setWrapStyleWord(true);
        JTA_windTable.setEnabled(false);
        JTA_windTable.setPreferredSize(new java.awt.Dimension(300, 500));
        JTA_windTable.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTA_windTableFocusLost(evt);
            }
        });
        JTA_windTable.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyTyped(java.awt.event.KeyEvent evt) {
                JTA_windTableKeyTyped(evt);
            }
        });
        JSP_windTable.setViewportView(JTA_windTable);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(null);

        JP_weather.setLayout(null);

        jLabel30.setText("Air density (kg/m^3)");
        JP_weather.add(jLabel30);
        jLabel30.setBounds(40, 40, 300, 14);

        JTF_airDensity.setText("0.0");
        JTF_airDensity.setToolTipText("Weather:airDensity");
        JTF_airDensity.setName("WeaAirDen"); // NOI18N
        JTF_airDensity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_airDensityActionPerformed(evt);
            }
        });
        JTF_airDensity.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_airDensityFocusLost(evt);
            }
        });
        JP_weather.add(JTF_airDensity);
        JTF_airDensity.setBounds(350, 40, 50, 20);

        jLabel31.setText("Wind direction (deg)");
        JP_weather.add(jLabel31);
        jLabel31.setBounds(40, 60, 300, 14);

        JTF_windDirection.setText("0.0");
        JTF_windDirection.setToolTipText("Weather:windDirection");
        JTF_windDirection.setName("WeaWindDir"); // NOI18N
        JTF_windDirection.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_windDirectionActionPerformed(evt);
            }
        });
        JTF_windDirection.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_windDirectionFocusLost(evt);
            }
        });
        JP_weather.add(JTF_windDirection);
        JTF_windDirection.setBounds(350, 60, 50, 20);

        jLabel32.setText("Number of interval / day to run EROSION");
        JP_weather.add(jLabel32);
        jLabel32.setBounds(40, 200, 300, 14);

        jLabel33.setText("Anemometer height (m)");
        JP_weather.add(jLabel33);
        jLabel33.setBounds(40, 80, 300, 14);

        JTF_anemometerHeight.setText("0.0");
        JTF_anemometerHeight.setToolTipText("Weather:anemHeight");
        JTF_anemometerHeight.setName("WeaAnemHgt"); // NOI18N
        JTF_anemometerHeight.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_anemometerHeightActionPerformed(evt);
            }
        });
        JTF_anemometerHeight.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_anemometerHeightFocusLost(evt);
            }
        });
        JP_weather.add(JTF_anemometerHeight);
        JTF_anemometerHeight.setBounds(350, 80, 50, 20);

        jLabel34.setText("Aerodynamic roughness at anemometer site (mm)");
        JP_weather.add(jLabel34);
        jLabel34.setBounds(40, 100, 300, 14);

        JTF_aeroRoughness.setText("0.0");
        JTF_aeroRoughness.setToolTipText("Weather:aeroRough");
        JTF_aeroRoughness.setName("WeaAeroRough"); // NOI18N
        JTF_aeroRoughness.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_aeroRoughnessActionPerformed(evt);
            }
        });
        JTF_aeroRoughness.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_aeroRoughnessFocusLost(evt);
            }
        });
        JP_weather.add(JTF_aeroRoughness);
        JTF_aeroRoughness.setBounds(350, 100, 50, 20);

        jLabel35.setText("Zo location flag");
        JP_weather.add(jLabel35);
        jLabel35.setBounds(40, 120, 300, 14);

        BG_zoLocFlg.add(JRB_zoStation);
        JRB_zoStation.setText("Station");
        JRB_zoStation.setToolTipText("Weather:zoFlg");
        JRB_zoStation.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                JRB_zoStationItemStateChanged(evt);
            }
        });
        JP_weather.add(JRB_zoStation);
        JRB_zoStation.setBounds(350, 120, 80, 20);

        BG_zoLocFlg.add(JRB_zoField);
        JRB_zoField.setText("Field");
        JRB_zoField.setToolTipText("Weather:zoFlg");
        JRB_zoField.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                JRB_zoFieldItemStateChanged(evt);
            }
        });
        JP_weather.add(JRB_zoField);
        JRB_zoField.setBounds(450, 120, 80, 20);

        BG_windWeibull.add(JRB_init1);
        JRB_init1.setSelected(true);
        JRB_init1.setText("hidden");
        JP_weather.add(JRB_init1);
        JRB_init1.setBounds(520, 160, 0, 23);

        jLabel40.setText("Wind table (m/s)  (must have 1 for each interval / day)");
        JP_weather.add(jLabel40);
        jLabel40.setBounds(40, 220, 300, 14);

        JB_estimate.setText("Estimate Air Density");
        JB_estimate.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_estimateActionPerformed(evt);
            }
        });
        JP_weather.add(JB_estimate);
        JB_estimate.setBounds(410, 40, 200, 20);

        JP_windSpeeds.setName("WeaWindSpeeds"); // NOI18N
        JP_windSpeeds.setLayout(null);
        JP_windSpeeds.add(jcTable);
        jcTable.setBounds(0, 0, 610, 120);

        JP_weather.add(JP_windSpeeds);
        JP_windSpeeds.setBounds(40, 250, 610, 150);

        JCB_intervals.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "1 Hour (24 intervals)", "30 Minutes (48 intervals)", "20 Minutes (72 intervals)", "15 Minutes (96 intervals)", "10 Minutes (144 intervals)", "5 Minutes (288 intervals)" }));
        JCB_intervals.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JCB_intervalsActionPerformed(evt);
            }
        });
        JP_weather.add(JCB_intervals);
        JCB_intervals.setBounds(350, 200, 180, 20);

        JB_calcWeibullWindSpeeds.setText("Calculate Wind Speeds Using Weibull Equations");
        JB_calcWeibullWindSpeeds.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_calcWeibullWindSpeedsActionPerformed(evt);
            }
        });
        JP_weather.add(JB_calcWeibullWindSpeeds);
        JB_calcWeibullWindSpeeds.setBounds(40, 160, 310, 23);

        getContentPane().add(JP_weather);
        JP_weather.setBounds(0, 0, 650, 410);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    protected void JB_estimateActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_estimateActionPerformed
    }//GEN-LAST:event_JB_estimateActionPerformed

    protected void JTA_windTableKeyTyped(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_JTA_windTableKeyTyped
    }//GEN-LAST:event_JTA_windTableKeyTyped

    protected void JTA_windTableFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTA_windTableFocusLost
    }//GEN-LAST:event_JTA_windTableFocusLost

    protected void JRB_zoFieldItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_JRB_zoFieldItemStateChanged
    }//GEN-LAST:event_JRB_zoFieldItemStateChanged

    protected void JRB_zoStationItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_JRB_zoStationItemStateChanged
    }//GEN-LAST:event_JRB_zoStationItemStateChanged

    protected void JTF_aeroRoughnessFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_aeroRoughnessFocusLost
    }//GEN-LAST:event_JTF_aeroRoughnessFocusLost

    protected void JTF_aeroRoughnessActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_aeroRoughnessActionPerformed
    }//GEN-LAST:event_JTF_aeroRoughnessActionPerformed

    protected void JTF_anemometerHeightFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_anemometerHeightFocusLost
    }//GEN-LAST:event_JTF_anemometerHeightFocusLost

    protected void JTF_anemometerHeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_anemometerHeightActionPerformed
    }//GEN-LAST:event_JTF_anemometerHeightActionPerformed

    protected void JTF_windDirectionFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_windDirectionFocusLost
    }//GEN-LAST:event_JTF_windDirectionFocusLost

    protected void JTF_windDirectionActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_windDirectionActionPerformed
    }//GEN-LAST:event_JTF_windDirectionActionPerformed

    protected void JTF_airDensityFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_airDensityFocusLost
    }//GEN-LAST:event_JTF_airDensityFocusLost

    protected void JTF_airDensityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_airDensityActionPerformed
    }//GEN-LAST:event_JTF_airDensityActionPerformed

    protected void JB_calcWeibullWindSpeedsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_calcWeibullWindSpeedsActionPerformed
            }//GEN-LAST:event_JB_calcWeibullWindSpeedsActionPerformed

    protected void JCB_intervalsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JCB_intervalsActionPerformed
            }//GEN-LAST:event_JCB_intervalsActionPerformed
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Weather_n().setVisible(true);
            }
        });
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.ButtonGroup BG_windWeibull;
    public javax.swing.ButtonGroup BG_zoLocFlg;
    public javax.swing.JButton JB_calcWeibullWindSpeeds;
    public javax.swing.JButton JB_estimate;
    public javax.swing.JComboBox<String> JCB_intervals;
    public javax.swing.JPanel JP_weather;
    public javax.swing.JPanel JP_windSpeeds;
    public javax.swing.JRadioButton JRB_init1;
    public javax.swing.JRadioButton JRB_zoField;
    public javax.swing.JRadioButton JRB_zoStation;
    public javax.swing.JScrollPane JSP_windTable;
    public javax.swing.JTextArea JTA_windTable;
    public javax.swing.JTextField JTF_aeroRoughness;
    public javax.swing.JTextField JTF_airDensity;
    public javax.swing.JTextField JTF_anemometerHeight;
    public javax.swing.JTextField JTF_windDirection;
    public javax.swing.JLabel jLabel30;
    public javax.swing.JLabel jLabel31;
    public javax.swing.JLabel jLabel32;
    public javax.swing.JLabel jLabel33;
    public javax.swing.JLabel jLabel34;
    public javax.swing.JLabel jLabel35;
    public javax.swing.JLabel jLabel40;
    public com.klg.jclass.table.beans.LiveTable jcTable;
    // End of variables declaration//GEN-END:variables
    
}
