/*
 * BarDialog_nb.java
 *
 * Created on June 30, 2004, 10:38 AM
 */

package usda.weru.weps.gui;

/**
 * This class builds a GUI that allows the user to mention width, height and porosity
 * of the barrier for the field whose area in acres is computed in the acres field
 * of the constructed GUI.
 * @author  manmohan
 */
public class BarDialog_n extends javax.swing.JDialog {
    private static final long serialVersionUID = 1L;
    
    /** 
    * Single aregument constructor that initialises the components that go in the 
    * GUI container
    * @param parent The address of a parent frame in which the About dialog sits.
    */
    public BarDialog_n(java.awt.Frame parent) {
        super(parent);
        initComponents();
    }
    /** 
    * Two argument constructor that initialises the components that go in the GUI
    * container.
    * @param parent The address of a parent frame in which the About dialog sits.
    * @param modal True means no other object can be accessed when this is instantiated
    * while false means we can.
    */ 
    public BarDialog_n(java.awt.Frame parent, boolean modal) {
        //super(parent, modal);
        this(parent);
        this.setModal(modal);
    }
    
    /** 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.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JP_main = new javax.swing.JPanel();
        JL_title = new javax.swing.JLabel();
        JL_width = new javax.swing.JLabel();
        JL_height = new javax.swing.JLabel();
        JL_area = new javax.swing.JLabel();
        JL_porosity = new javax.swing.JLabel();
        JL_ft1 = new javax.swing.JLabel();
        JL_ft2 = new javax.swing.JLabel();
        JL_ac = new javax.swing.JLabel();
        JTF_Width = new usda.weru.util.WepsTextField();
        JTF_Height = new usda.weru.util.WepsTextField();
        JTF_Area = new usda.weru.util.WepsTextField();
        JTF_Porosity = new usda.weru.util.WepsTextField();
        JB_OK = new javax.swing.JButton();
        JB_cancel = new javax.swing.JButton();
        JB_help = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Barrier Details");
        setModal(true);
        setResizable(false);

        JL_title.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_title.setText("Title");
        JL_title.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);

        JL_width.setFont(new java.awt.Font("MS Sans Serif", 1, 12)); // NOI18N
        JL_width.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_width.setText("Width :");

        JL_height.setFont(new java.awt.Font("MS Sans Serif", 1, 12)); // NOI18N
        JL_height.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_height.setText("Height :");

        JL_area.setFont(new java.awt.Font("MS Sans Serif", 1, 12)); // NOI18N
        JL_area.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_area.setText("Area :");

        JL_porosity.setFont(new java.awt.Font("MS Sans Serif", 1, 12)); // NOI18N
        JL_porosity.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_porosity.setText("Porosity :");

        JL_ft1.setFont(new java.awt.Font("MS Sans Serif", 0, 12)); // NOI18N
        JL_ft1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_ft1.setText("ft");

        JL_ft2.setFont(new java.awt.Font("MS Sans Serif", 0, 12)); // NOI18N
        JL_ft2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_ft2.setText("ft");

        JL_ac.setFont(new java.awt.Font("MS Sans Serif", 0, 12)); // NOI18N
        JL_ac.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_ac.setText("ac");

        JTF_Width.setFormat("#0.0");
        JTF_Width.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_WidthActionPerformed(evt);
            }
        });
        JTF_Width.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_WidthFocusLost(evt);
            }
        });

        JTF_Height.setFormat("#0.0");
        JTF_Height.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_HeightActionPerformed(evt);
            }
        });
        JTF_Height.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_HeightFocusLost(evt);
            }
        });

        JTF_Area.setBackground(java.awt.SystemColor.control);
        JTF_Area.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        JTF_Area.setEnabled(false);
        JTF_Area.setFormat("#0.0");

        JTF_Porosity.setFormat("#0.0");
        JTF_Porosity.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_PorosityActionPerformed(evt);
            }
        });
        JTF_Porosity.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_PorosityFocusLost(evt);
            }
        });

        JB_OK.setText("OK");
        JB_OK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_OK_ActionPerformed(evt);
            }
        });

        JB_cancel.setText("Cancel");
        JB_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_cancel_ActionPerformed(evt);
            }
        });

        JB_help.setText("Help");
        JB_help.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_helpActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout JP_mainLayout = new javax.swing.GroupLayout(JP_main);
        JP_main.setLayout(JP_mainLayout);
        JP_mainLayout.setHorizontalGroup(
            JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_mainLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JL_width, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_area, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_height))
                                .addGap(16, 16, 16))
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addComponent(JL_porosity)
                                .addGap(4, 4, 4)))
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JTF_Height, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JTF_Area, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JTF_Porosity, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(JL_ac)
                                    .addComponent(JL_ft2, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addComponent(JTF_Width, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(JL_ft1, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addComponent(JL_title, javax.swing.GroupLayout.DEFAULT_SIZE, 262, Short.MAX_VALUE)
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addComponent(JB_OK)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_cancel)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JB_help)))
                .addContainerGap())
        );

        JP_mainLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {JB_OK, JB_cancel, JB_help});

        JP_mainLayout.setVerticalGroup(
            JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_mainLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JL_title, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JL_width, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(JTF_Height, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(JL_height, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addGap(25, 25, 25)
                                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(JTF_Area, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_area, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_ac, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addGroup(JP_mainLayout.createSequentialGroup()
                                .addGap(50, 50, 50)
                                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(JTF_Porosity, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(JL_porosity, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                            .addComponent(JL_ft2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(JTF_Width, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(JL_ft1, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addGap(15, 15, 15)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JB_OK)
                    .addComponent(JB_cancel)
                    .addComponent(JB_help))
                .addGap(0, 11, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(JP_main, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(JP_main, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        setSize(new java.awt.Dimension(288, 228));
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void JTF_PorosityFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_PorosityFocusLost
        JTFPorosity_focusLost(evt);
    }//GEN-LAST:event_JTF_PorosityFocusLost

    private void JTF_HeightFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_HeightFocusLost
        JTFHeight_focusLost(evt);
    }//GEN-LAST:event_JTF_HeightFocusLost

    private void JTF_HeightActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_HeightActionPerformed
        JTFHeight_actionPerformed(evt);
    }//GEN-LAST:event_JTF_HeightActionPerformed

    private void JTF_WidthFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_WidthFocusLost
       JTFWidth_focusLost(evt);
    }//GEN-LAST:event_JTF_WidthFocusLost

    private void JTF_WidthActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_WidthActionPerformed
        JTFWidth_actionPerformed(evt);
    }//GEN-LAST:event_JTF_WidthActionPerformed

    private void JTF_PorosityActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_PorosityActionPerformed
        JTFPorosity_actionPerformed(evt);
    }//GEN-LAST:event_JTF_PorosityActionPerformed

    private void JB_helpActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_helpActionPerformed
        JBHelp_actionPerformed(evt);
    }//GEN-LAST:event_JB_helpActionPerformed

    private void JB_cancel_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_cancel_ActionPerformed
        JB_cancel_actionPerformed(evt);
    }//GEN-LAST:event_JB_cancel_ActionPerformed

    private void JB_OK_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_OK_ActionPerformed
        JB_OK_actionPerformed(evt);
    }//GEN-LAST:event_JB_OK_ActionPerformed
    
   /** 
    * This method is called when the "porosity text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This focuslost event is generated when the porosity text field looses
    * its focus. 
    */
    public void JTFPorosity_focusLost(java.awt.event.FocusEvent evt) {
    }

    /** 
    * This method is called when the "porosity text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This action event is generated when the porosity text field gets a
    * new value by modifying the old one or just the old value is re-entered.
    */
    public void JTFPorosity_actionPerformed(java.awt.event.ActionEvent evt) {
    }
    
   /** 
    * This method is called when the "height text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This focuslost event is generated when the height text field looses
    * its focus. 
    */
    public void JTFHeight_focusLost(java.awt.event.FocusEvent evt) {
    }

    /** 
    * This method is called when the "porosity text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This action event is generated when the porosity text field gets a
    * new value by modifying the old one or just the old value is re-entered.
    */
    public void JTFHeight_actionPerformed(java.awt.event.ActionEvent evt) {
    }    
    
    /** 
    * This method is called when the "height text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This focuslost event is generated when the height text field looses
    * its focus. 
    */
    public void JTFWidth_focusLost(java.awt.event.FocusEvent evt) {
    }

    /** 
    * This method is called when the "width text field" looses its focus 
    * and the values entered into it needs to be cross checked and accepted.
    * @param evt This action event is generated when the width text field gets a
    * new value by modifying the old one or just the old value is re-entered.
    */
    public void JTFWidth_actionPerformed(java.awt.event.ActionEvent evt) {
    }
    
    /** 
    * This method is called when the "Cancel" button of the dialog is clicked for 
    * closing the frame and discarding any changes made to the values in the GUI panel. 
    * @param evt The event is generated when the OK button of the GUI panel is hit. 
    */
    public void JB_cancel_actionPerformed(java.awt.event.ActionEvent evt) {
    }
    
   /** 
    * This method is called when the OK button of the dialog is clicked for closing the
    * frame after accepting the changes made to the values in the GUI panel. 
    * @param evt The event is generated when the OK button of the GUI panel is hit. 
    */
    public void JB_OK_actionPerformed(java.awt.event.ActionEvent evt) {
    }
    
    /** 
    * This method is called when the "help" button of the dialog is clicked for barrier 
    * dialog related help.
    * @param evt The action event is generated when the "help" button of the GUI panel is clicked. 
    */
    public void JBHelp_actionPerformed(java.awt.event.ActionEvent evt) {
    }
     
    /**
     * This method is used if this dialog is rum as an independent application.
     * @param args These are the command line arguments passed to the main method.
     */
    public static void main(String args[]) {
        new BarDialog_n(new javax.swing.JFrame(), true).setVisible(true);
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton JB_OK;
    public javax.swing.JButton JB_cancel;
    protected javax.swing.JButton JB_help;
    public javax.swing.JLabel JL_ac;
    public javax.swing.JLabel JL_area;
    public javax.swing.JLabel JL_ft1;
    public javax.swing.JLabel JL_ft2;
    public javax.swing.JLabel JL_height;
    public javax.swing.JLabel JL_porosity;
    public javax.swing.JLabel JL_title;
    public javax.swing.JLabel JL_width;
    public javax.swing.JPanel JP_main;
    public usda.weru.util.WepsTextField JTF_Area;
    public usda.weru.util.WepsTextField JTF_Height;
    public usda.weru.util.WepsTextField JTF_Porosity;
    public usda.weru.util.WepsTextField JTF_Width;
    // End of variables declaration//GEN-END:variables
    
}
