/*
 * TillageChange_n.java
 *
 * Created on May 2, 2005, 4:30 PM
 */

package usda.weru.mcrew.gui;

/**
 * This class brings up the dialog that provides the options to change the tillage
 * values by incrementing or decrementing by specified number of years.
 * author Neha, Manmohan
 */
public class TillageChange_n extends javax.swing.JDialog {
    private static final long serialVersionUID = 1L;
    
    /** Creates new form TillageChange_n */
    public TillageChange_n() {
    }
    
    /**
     * Creates new form TillageChange_n
     * @param parent The owner frame from which this dialog is displayed.
     * This dialog will be relative to this frame.
     * @param modal true for a modal dialog, false for one that allows
     * other windows to be active at the same time
     */
    public TillageChange_n(java.awt.Frame parent, boolean modal) {
        super(parent, modal);
        initComponents();
    }
    
     /**
      * Creates new form TillageChange_n
      * @param parent The owner frame from which this dialog is displayed.
      * This dialog will be relative to this frame.
      */
    public TillageChange_n(java.awt.Frame parent) {
        super(parent);
        initComponents();
    }
    
    /**
     * Creates new form TillageChange_n
     * @param sTitle The String to display in the dialog's title bar
     */
    public TillageChange_n(java.lang.String sTitle) {
        super();
        initComponents();
        setTitle(sTitle);
    }
    
    /** 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.
     */
    private void initComponents() {//GEN-BEGIN:initComponents
        JBG_choice = new javax.swing.ButtonGroup();
        JP_main = new javax.swing.JPanel();
        JRB_increment = new javax.swing.JRadioButton();
        JRB_decrement = new javax.swing.JRadioButton();
        JTF_value = new javax.swing.JTextField();
        JP_buttons = new javax.swing.JPanel();
        JB_ok = new javax.swing.JButton();
        JB_cancel = new javax.swing.JButton();

        getContentPane().setLayout(null);

        JP_main.setLayout(null);

        JRB_increment.setMnemonic('I');
        JRB_increment.setSelected(true);
        JRB_increment.setText("Increment");
        JBG_choice.add(JRB_increment);
        JRB_increment.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                JRB_increment_ItemStateChanged(evt);
            }
        });

        JP_main.add(JRB_increment);
        JRB_increment.setBounds(120, 10, 73, 20);

        JRB_decrement.setMnemonic('E');
        JRB_decrement.setText("Decrement");
        JBG_choice.add(JRB_decrement);
        JRB_decrement.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                JRB_decrement_ItemStateChanged(evt);
            }
        });

        JP_main.add(JRB_decrement);
        JRB_decrement.setBounds(120, 30, 77, 20);

        JTF_value.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTF_value_ActionPerformed(evt);
            }
        });
        JTF_value.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTF_value_FocusLost(evt);
            }
        });

        JP_main.add(JTF_value);
        JTF_value.setBounds(25, 15, 50, 25);

        getContentPane().add(JP_main);
        JP_main.setBounds(0, 0, 250, 65);

        JP_buttons.setLayout(null);

        JB_ok.setMnemonic('O');
        JB_ok.setText("OK");
        JB_ok.setToolTipText("Date Changed : Ok");
        JB_ok.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_ok_ActionPerformed(evt);
            }
        });

        JP_buttons.add(JB_ok);
        JB_ok.setBounds(20, 5, 70, 23);

        JB_cancel.setMnemonic('C');
        JB_cancel.setText("Cancel");
        JB_cancel.setToolTipText("Date Changed : Cancel");
        JB_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_cancel_ActionPerformed(evt);
            }
        });

        JP_buttons.add(JB_cancel);
        JB_cancel.setBounds(120, 5, 65, 23);

        getContentPane().add(JP_buttons);
        JP_buttons.setBounds(5, 70, 250, 40);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-280)/2, (screenSize.height-151)/2, 280, 151);
    }//GEN-END:initComponents

    private void JTF_value_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_value_FocusLost
        JTFValue_focusLost(evt);
    }//GEN-LAST:event_JTF_value_FocusLost

    private void JTF_value_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTF_value_ActionPerformed
        JTFValue_actionPerformed(evt);
    }//GEN-LAST:event_JTF_value_ActionPerformed

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

    private void JB_ok_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_ok_ActionPerformed
        JBOk_actionPerformed(evt);
    }//GEN-LAST:event_JB_ok_ActionPerformed

    private void JRB_decrement_ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_JRB_decrement_ItemStateChanged
        JRBDecrement_itemStateChanged(evt);
    }//GEN-LAST:event_JRB_decrement_ItemStateChanged

    private void JRB_increment_ItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_JRB_increment_ItemStateChanged
        JRBIncrement_itemStateChanged(evt);
    }//GEN-LAST:event_JRB_increment_ItemStateChanged
    
     /**
     * This method is called when a cancel button on the JDialog is pressed. 
     * @param evt The event generated when the cancel button is pressed.
     */
    public void JBCancel_actionPerformed(java.awt.event.ActionEvent evt) {
        
    }
    
     /**
     * This method is called when an OK button on the JDialog is pressed. 
     * @param evt The event generated when the OK button is pressed.
     */
    public void JBOk_actionPerformed(java.awt.event.ActionEvent evt) {
        
    }
    
     /**
     * This method is called when the decrement button on the JDialog is pressed. 
     * @param evt The event generated when the decrement button is pressed.
     */
    public void JRBDecrement_itemStateChanged(java.awt.event.ItemEvent evt) {
        
    }
    
     /**
     * This method is called when the increment button on the JDialog is pressed. 
     * @param evt The event generated when the increment button is pressed.
     */
    public void JRBIncrement_itemStateChanged(java.awt.event.ItemEvent evt) {
        
    }
    
     /**
     * This method is called when the value text field gets a new value inserted
     * into it and we hit enter.
     * @param evt The event generated when the value text field gets modified.
     */
    public void JTFValue_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**
     * This method is called whenever the value text field looses its focus and the 
     * new value is inserted or modified.
     * @param evt The event generated when the value text field losses its focus
     */
    public void JTFValue_focusLost(java.awt.event.FocusEvent evt) {
    }
    
    /**
     * This method is used if this dialog is rum as an independent application
     * @param args The array consists of the command line arguments passed to the 
     * main method if needed.
     */
    public static void main(String args[]) {
        new TillageChange_n(new javax.swing.JFrame(), true).setVisible(true);
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup JBG_choice;
    protected javax.swing.JButton JB_cancel;
    protected javax.swing.JButton JB_ok;
    private javax.swing.JPanel JP_buttons;
    private javax.swing.JPanel JP_main;
    protected javax.swing.JRadioButton JRB_decrement;
    protected javax.swing.JRadioButton JRB_increment;
    protected javax.swing.JTextField JTF_value;
    // End of variables declaration//GEN-END:variables
    
}
