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

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

    private static final long serialVersionUID = 1L;

    /**
     * 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.setDocument(new LimitDocument(65));
        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.setDocument(new LimitDocument(10));
        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.setDocument(new LimitDocument(10));
        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.setDocument(new LimitDocument(10));
        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);
            }
        });

        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.TRAILING, false)
                    .addComponent(JLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(JLabel1, javax.swing.GroupLayout.Alignment.LEADING))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JTF_ClientName, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .addComponent(JTF_FarmID, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .addComponent(JTF_TractID, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
                    .addComponent(JTF_FieldID, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE))
                .addContainerGap())
        );

        JP_mainLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {JLabel1, JLabel2, JLabel3, JLabel4});

        JP_mainLayout.setVerticalGroup(
            JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_mainLayout.createSequentialGroup()
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTF_ClientName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLabel1))
                .addGap(0, 0, 0)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTF_FarmID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLabel4))
                .addGap(0, 0, 0)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTF_TractID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLabel3))
                .addGap(0, 0, 0)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTF_FieldID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JLabel2))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        JP_mainLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {JLabel2, JTF_FieldID});

        JP_mainLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {JLabel3, JTF_TractID});

        JP_mainLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {JLabel4, JTF_FarmID});

        JP_mainLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {JLabel1, JTF_ClientName});

        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)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    private void JTFFieldID_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFFieldID_FocusLost
        JTFFieldID_focusLost(evt);
    }//GEN-LAST:event_JTFFieldID_FocusLost

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

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

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

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

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

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

    private void JTFClientName_FocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_JTFClientName_FocusLost
        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 container or a different container.
     * @param event
     */
    public void JTFClientName_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFClientName_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFFarmID_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFFarmID_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFTractID_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFTractID_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFFieldID_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFFieldID_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFRotationCycles_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFRotationCycles_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFStartDate_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFStartDate_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFEndDate_focusLost(java.awt.event.FocusEvent event) {

    }

    /**
     * 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 event
     */
    public void JTFEndDate_actionPerformed(java.awt.event.ActionEvent event) {

    }

    /** 
     * 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

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

    }

    /**
     *
     * @param 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.
     */
    @Override
    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

}
