/*
 * RunDialog_n.java
 *
 * Created on November 22, 2003, 4:09 PM
 */
package usda.weru.weps.gui;

/**
 * This "RUN dialog" GUI shows the progress of the run's execution process.The wind 
 * generation, climate file generation and the overall WEPS model itself is being 
 * monitored here.
 * @author  manmohan
 */
public class RunDialog_n extends javax.swing.JFrame {

    private static final long serialVersionUID = 1L;

    /**
     * Default constructor for the Run Dialog GUI object that helps the user in
     * getting to know how long will the run take to be executed before all the 
     * reports are generated. 
     * It also initializes the components that go in the GUI with default settings.
     */
    public RunDialog_n() {
        super();
        initComponents();
    }

    /**
     * Single argument constructor for the Run Dialog GUI object that helps the user in
     * getting to know how long will the run take to be executed before all the 
     * reports are generated.
     * It also initializes the components that go in the GUI with default settings.
     * @param title The title string for the parent frame of the GUI.
     */
    public RunDialog_n(java.lang.String title) {
        this();
        initComponents();
        setTitle(title);
    }

    /** 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() {

        JLabel4 = new javax.swing.JLabel();
        JLabel2 = new javax.swing.JLabel();
        JLabel3 = new javax.swing.JLabel();
        JTF_win = new javax.swing.JTextField();
        JTF_cli = new javax.swing.JTextField();
        JTF_weps = new javax.swing.JTextField();
        JTF_status = new javax.swing.JTextField();
        JPB_weps = new javax.swing.JProgressBar();
        jPanel1 = new javax.swing.JPanel();
        JB_can = new javax.swing.JButton();
        JL_runName = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Run Dialog");
        setMinimumSize(new java.awt.Dimension(220, 240));
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                RunDialog_n_WindowClosing(evt);
            }
        });

        JLabel4.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JLabel4.setText("Wind Generation :");

        JLabel2.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JLabel2.setText("Climate Generation :");

        JLabel3.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JLabel3.setText("WEPS Model :");

        JTF_win.setEditable(false);
        JTF_win.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JTF_cli.setEditable(false);
        JTF_cli.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JTF_weps.setEditable(false);
        JTF_weps.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JTF_status.setEditable(false);
        JTF_status.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JB_can.setText("Cancel");
        JB_can.setToolTipText("RunDialog : Cancel");
        JB_can.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBCan_ActionPerformed(evt);
            }
        });
        jPanel1.add(JB_can);

        JL_runName.setText("run name klajsdf l;kajs dflkj asl;dfkj alsdkjf lkajsdf lkajsd flasd");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(JL_runName, javax.swing.GroupLayout.PREFERRED_SIZE, 238, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(JLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JTF_win, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(JLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JTF_cli, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE))
                    .addComponent(JTF_status, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(JLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(JTF_weps, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE))
                    .addComponent(JPB_weps, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(JL_runName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(JLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_win, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_cli, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_weps, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JTF_status, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JPB_weps, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void JBCan_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBCan_ActionPerformed
        JBCan_actionPerformed(evt);
    }//GEN-LAST:event_JBCan_ActionPerformed

    private void RunDialog_n_WindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_RunDialog_n_WindowClosing
        this.dispose();
    }//GEN-LAST:event_RunDialog_n_WindowClosing

    /**
     * This method is used if this dialog is rum as an independent application. If executed,
     * makes the GUI visible.
     * @param evt The cancel button event is generated if the "Run dialog" is to be 
     * closed and the run itself "cancelled".
     */
    public void JBCan_actionPerformed(java.awt.event.ActionEvent 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[]) {
        new RunDialog_n().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.JButton JB_can;
    protected javax.swing.JLabel JL_runName;
    public javax.swing.JLabel JLabel2;
    public javax.swing.JLabel JLabel3;
    public javax.swing.JLabel JLabel4;
    public javax.swing.JProgressBar JPB_weps;
    public javax.swing.JTextField JTF_cli;
    public javax.swing.JTextField JTF_status;
    public javax.swing.JTextField JTF_weps;
    public javax.swing.JTextField JTF_win;
    private javax.swing.JPanel jPanel1;
    // End of variables declaration//GEN-END:variables

}
