/*
 * SimPanel_n.java
 *
 * Created on November 19, 2003, 4:07 PM
 */
package usda.weru.weps.gui;

import usda.weru.util.ConvertedValue;
import usda.weru.util.Util;

/**
 * Provide the simulation RUN information for the WEPS model.
 * @author  manmohan
 */
public class ClientPanel_n extends javax.swing.JFrame {

    /**
     * Default constructor for the Simulation Run GUI object that helps the user in
     * entering/knowing the details of a specific run made for a project such as the
     * client name, the farm number, tract number, field number, etc. 
     * Based on the configuration like mode set for simulation run, the user can enter the 
     * number of MANAGEMENT rotation cyles or start & end date of the simulation runs.
     * It also initializes the components that go in the GUI with default settings.
     */
    public ClientPanel_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.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JP_main = new javax.swing.JPanel();
        JLabel4 = new javax.swing.JLabel();
        JLabel1 = new javax.swing.JLabel();
        JLabel3 = new javax.swing.JLabel();
        JLabel2 = new javax.swing.JLabel();
        JTF_ClientName = new javax.swing.JTextField();
        JTF_FarmID = new javax.swing.JTextField();
        JTF_TractID = new javax.swing.JTextField();
        JTF_FieldID = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });

        JP_main.setMaximumSize(new java.awt.Dimension(400, 300));

        JLabel4.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel4.setText("Farm No ");
        JLabel4.setToolTipText("SimPanel:farmID");

        JLabel1.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel1.setText("Client Name ");
        JLabel1.setToolTipText("SimPanel:clientName");

        JLabel3.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel3.setText("Tract No ");
        JLabel3.setToolTipText("SimPanel:tractID");

        JLabel2.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JLabel2.setText("Field No ");
        JLabel2.setToolTipText("SimPanel:fieldID");

        JTF_ClientName.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_ClientName.setToolTipText("SimPanel:clientName");
        JTF_ClientName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFClientName_ActionPerformed(evt);
            }
        });
        JTF_ClientName.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                JTF_ClientNameFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTFClientName_FocusLost(evt);
            }
        });

        JTF_FarmID.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_FarmID.setToolTipText("SimPanel:farmID");
        JTF_FarmID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFFarmID_ActionPerformed(evt);
            }
        });
        JTF_FarmID.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                JTF_FarmIDFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTFFarmID_FocusLost(evt);
            }
        });

        JTF_TractID.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_TractID.setToolTipText("SimPanel:tractID");
        JTF_TractID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFTractID_ActionPerformed(evt);
            }
        });
        JTF_TractID.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                JTF_TractIDFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTFTractID_FocusLost(evt);
            }
        });

        JTF_FieldID.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_FieldID.setToolTipText("SimPanel:fieldID");
        JTF_FieldID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFFieldID_ActionPerformed(evt);
            }
        });
        JTF_FieldID.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                JTF_FieldIDFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                JTFFieldID_FocusLost(evt);
            }
        });

        org.jdesktop.layout.GroupLayout JP_mainLayout = new org.jdesktop.layout.GroupLayout(JP_main);
        JP_main.setLayout(JP_mainLayout);
        JP_mainLayout.setHorizontalGroup(
            JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(JP_mainLayout.createSequentialGroup()
                .addContainerGap()
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                    .add(JLabel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(JLabel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(JLabel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, JLabel1))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(JTF_ClientName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .add(JTF_FarmID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .add(JTF_TractID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .add(JTF_FieldID, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
                .addContainerGap())
        );

        JP_mainLayout.linkSize(new java.awt.Component[] {JLabel1, JLabel2, JLabel3, JLabel4}, org.jdesktop.layout.GroupLayout.HORIZONTAL);

        JP_mainLayout.setVerticalGroup(
            JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(JP_mainLayout.createSequentialGroup()
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(JTF_ClientName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(JLabel1))
                .add(0, 0, 0)
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(JTF_FarmID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(JLabel4))
                .add(0, 0, 0)
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(JTF_TractID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(JLabel3))
                .add(0, 0, 0)
                .add(JP_mainLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(JTF_FieldID, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(JLabel2))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        JP_mainLayout.linkSize(new java.awt.Component[] {JLabel2, JTF_FieldID}, org.jdesktop.layout.GroupLayout.VERTICAL);

        JP_mainLayout.linkSize(new java.awt.Component[] {JLabel3, JTF_TractID}, org.jdesktop.layout.GroupLayout.VERTICAL);

        JP_mainLayout.linkSize(new java.awt.Component[] {JLabel4, JTF_FarmID}, org.jdesktop.layout.GroupLayout.VERTICAL);

        JP_mainLayout.linkSize(new java.awt.Component[] {JLabel1, JTF_ClientName}, org.jdesktop.layout.GroupLayout.VERTICAL);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(JP_main, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(JP_main, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
        );

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

    private void JTFFieldID_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFFieldID_FocusLost
        // Add your handling code here:
        JTFFieldID_focusLost(evt);
    }//GEN-LAST:event_JTFFieldID_FocusLost

    private void JTFFieldID_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFFieldID_ActionPerformed
        // Add your handling code here:
        JTFFieldID_actionPerformed(evt);
    }//GEN-LAST:event_JTFFieldID_ActionPerformed

    private void JTFTractID_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFTractID_FocusLost
        // Add your handling code here:
        JTFTractID_focusLost(evt);
    }//GEN-LAST:event_JTFTractID_FocusLost

    private void JTFTractID_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFTractID_ActionPerformed
        // Add your handling code here:
        JTFTractID_actionPerformed(evt);
    }//GEN-LAST:event_JTFTractID_ActionPerformed

    private void JTFFarmID_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFFarmID_FocusLost
        // Add your handling code here:
        JTFFarmID_focusLost(evt);
    }//GEN-LAST:event_JTFFarmID_FocusLost

    private void JTFFarmID_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFFarmID_ActionPerformed
        // Add your handling code here:
        JTFFarmID_actionPerformed(evt);
    }//GEN-LAST:event_JTFFarmID_ActionPerformed

    private void JTFClientName_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFClientName_ActionPerformed
        // Add your handling code here:
        JTFClientName_actionPerformed(evt);
    }//GEN-LAST:event_JTFClientName_ActionPerformed

    private void JTFClientName_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFClientName_FocusLost
        // Add your handling code here:
        JTFClientName_focusLost(evt);
    }//GEN-LAST:event_JTFClientName_FocusLost

    /**
     * This method is invoked whenever the client-name text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the containenr or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the client-name
     * text field.
     */
    public void JTFClientName_focusLost(java.awt.event.FocusEvent event) {   // to do: code goes here.		 

    }

    /**
     * This method is invoked whenever the client-name text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the client-name text field.
     */
    public void JTFClientName_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the farm ID text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the farm ID
     * text field.
     */
    public void JTFFarmID_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the farm ID text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the farm ID text field.
     */
    public void JTFFarmID_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the  Tract ID text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the Tract ID
     * text field.
     */
    public void JTFTractID_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the Tract ID text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the Tract ID text field.
     */
    public void JTFTractID_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the field ID text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the field ID
     * text field.
     */
    public void JTFFieldID_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.		 

    }

    /**
     * This method is invoked whenever the Tract ID text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the Tract ID text field.
     */
    public void JTFFieldID_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the rotation cycles text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the rotation 
     * cycles text field.
     */
    public void JTFRotationCycles_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.		 

    }

    /**
     * This method is invoked whenever the rotation cycles text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the rotation cycles text field.
     */
    public void JTFRotationCycles_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the start date text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the start date
     * text field.
     */
    public void JTFStartDate_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the start date text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the start date text field.
     */
    public void JTFStartDate_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the end date text field of the simulation 
     * run panel gets a value entered/modified or even just focused and then loses
     * focus to some other component in the container or a different container.
     * @param evt This focus lost event is generated when the the user clicks mouse 
     * at some different place on the GUI screen after having focused on the end date
     * text field.
     */
    public void JTFEndDate_focusLost(java.awt.event.FocusEvent event) {	// to do: code goes here.

    }

    /**
     * This method is invoked whenever the end date text field of the simulation 
     * run panel gets a value entered or modified for each simulation.
     * @param evt This action event is generated when the the user enters value 
     * in the end date text field.
     */
    public void JTFEndDate_actionPerformed(java.awt.event.ActionEvent event) {	// to do: code goes here.

    }

    /** 
     * This method is called when the simulation run panel is to be closed by hitting the 
     * "Red X" button of the window.
     * @param evt The window event generated when the " Red X " button on the window is hit. 
     */
    private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm
        System.exit(0);
    }//GEN-LAST:event_exitForm

private void JTF_ClientNameFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_ClientNameFocusGained
    JTF_ClientName.selectAll();
}//GEN-LAST:event_JTF_ClientNameFocusGained

private void JTF_FarmIDFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_FarmIDFocusGained
    JTF_FarmID.selectAll();
}//GEN-LAST:event_JTF_FarmIDFocusGained

private void JTF_TractIDFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_TractIDFocusGained
    JTF_TractID.selectAll();
}//GEN-LAST:event_JTF_TractIDFocusGained

private void JTF_FieldIDFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTF_FieldIDFocusGained
    JTF_FieldID.selectAll();
}//GEN-LAST:event_JTF_FieldIDFocusGained

    protected void JTF_Water_actionPerformed(java.awt.event.ActionEvent evt) {

    }

    protected void JTF_Water_focusLost(java.awt.event.FocusEvent evt) {

    }

    /**
     * This method is used if this dialog is rum as an independent application. If executed,
     * makes the GUI visible.
     * @param args These are the command line arguments passed to the main method.
     */
    public static void main(String args[]) {
        ClientPanel_n x = new ClientPanel_n();
        x.setVisible(true);
    }

    /**
     * This method notifies when the window or frame is resized and the components 
     * need to be re-arranged so they are evenly spaced relative to each other.
     */
    public void addNotify() {
        super.addNotify();
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JLabel JLabel1;
    public javax.swing.JLabel JLabel2;
    public javax.swing.JLabel JLabel3;
    public javax.swing.JLabel JLabel4;
    public javax.swing.JPanel JP_main;
    public javax.swing.JTextField JTF_ClientName;
    public javax.swing.JTextField JTF_FarmID;
    public javax.swing.JTextField JTF_FieldID;
    public javax.swing.JTextField JTF_TractID;
    // End of variables declaration//GEN-END:variables
}
