/*
 * Email_n.java
 *
 * Created on November 18, 2003, 4:25 PM
 */
package usda.weru.weps.gui;

/**
 * This GUI helps the user to attach the project and the specific run along with 
 * some commentsto send any errors or exceptions that occured to the WEPS support 
 * team or other people by mentioning their email address from within the application. 
 * @author  manmohan
 */
public class Email_n extends javax.swing.JFrame {

    private static final long serialVersionUID = 1L;

    /** Creates new form Email_n */
    /**
     * Default constructor for the Email GUI object that helps the user in sending 
     * the email with bug reports attached if the application doen't execute properly 
     * to the WEPS support tem.
     */
    public Email_n() {
        initComponents();
        //System.out.println("Email_n: Default constructor");
    }

    /**
     * Default constructor for the Email GUI object that helps the user in sending 
     * the email with bug reports attached if the application doen't execute properly 
     * to the WEPS support tem.
     * @param sTitle The frame title in which the email details will be fed for sending 
     * bug reports  or other quesries.
     */
    public Email_n(java.lang.String sTitle) {
        this();
        setTitle(sTitle);
        //System.out.println("Email_n: 1 argument constructor");
    }

    /** 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_header = new javax.swing.JLabel();
        JL_clientNote = new javax.swing.JLabel();
        JL_from = new javax.swing.JLabel();
        JTF_from = new javax.swing.JTextField();
        JTF_to = new javax.swing.JTextField();
        JL_to = new javax.swing.JLabel();
        JL_subject = new javax.swing.JLabel();
        JTF_subject = new javax.swing.JTextField();
        JTF_attachment = new javax.swing.JTextField();
        JL_attachment = new javax.swing.JLabel();
        JSP_text = new javax.swing.JScrollPane();
        JTA_text = new javax.swing.JTextArea();
        JP_buttons = new javax.swing.JPanel();
        JB_send = new javax.swing.JButton();
        JB_client = new javax.swing.JButton();
        JB_cancel = new javax.swing.JButton();
        JB_Run = new javax.swing.JButton();
        JB_Project = new javax.swing.JButton();

        setTitle("sTitle");
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                exitForm(evt);
            }
        });

        JL_header.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        JL_header.setText("E-mail ");

        JL_clientNote.setText("<html><p>This screen allows you to attach a run or project to an email message in your default mail client.<ol><li>Attach a run or project (optional)</li><li>Click Open Mail Client.</li></ol></p></html>");
        JL_clientNote.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        JL_clientNote.setVerticalTextPosition(javax.swing.SwingConstants.TOP);

        JL_from.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JL_from.setText("From :");

        JTF_from.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JTF_to.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JL_to.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JL_to.setText("To :");

        JL_subject.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JL_subject.setText("Subject :");

        JTF_subject.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JTF_attachment.setHorizontalAlignment(javax.swing.JTextField.LEFT);

        JL_attachment.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        JL_attachment.setText("Attachment :");

        JSP_text.setViewportBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JSP_text.setPreferredSize(new java.awt.Dimension(5, 21));
        JSP_text.setViewportView(JTA_text);

        JB_send.setMnemonic('S');
        JB_send.setText("Send");
        JB_send.setToolTipText("Email:JB_Send");
        JB_send.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBSend_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_send);

        JB_client.setText("Open Mail Client");
        JB_client.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_clientActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_client);

        JB_cancel.setMnemonic('C');
        JB_cancel.setText("Cancel");
        JB_cancel.setToolTipText("Email:JB_Cancel");
        JB_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBCancel_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_cancel);

        JB_Run.setMnemonic('R');
        JB_Run.setText("Attach Run");
        JB_Run.setToolTipText("Email:JB_Run");
        JB_Run.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBRun_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_Run);

        JB_Project.setMnemonic('P');
        JB_Project.setText("Attach Project");
        JB_Project.setToolTipText("Email:JB_Project");
        JB_Project.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBProject_ActionPerformed(evt);
            }
        });
        JP_buttons.add(JB_Project);

        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()
                        .addComponent(JSP_text, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
                        .addContainerGap())
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(JL_clientNote, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE)
                            .addComponent(JL_header, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE))
                        .addContainerGap())
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(JL_from, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JL_to, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JL_subject, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JL_attachment, javax.swing.GroupLayout.PREFERRED_SIZE, 76, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(JTF_from, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JTF_to, javax.swing.GroupLayout.PREFERRED_SIZE, 250, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JTF_attachment, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE)
                            .addComponent(JTF_subject, javax.swing.GroupLayout.DEFAULT_SIZE, 428, Short.MAX_VALUE))
                        .addGap(13, 13, 13))
                    .addGroup(JP_mainLayout.createSequentialGroup()
                        .addComponent(JP_buttons, javax.swing.GroupLayout.DEFAULT_SIZE, 511, Short.MAX_VALUE)
                        .addContainerGap())))
        );
        JP_mainLayout.setVerticalGroup(
            JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(JP_mainLayout.createSequentialGroup()
                .addComponent(JL_header, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JL_clientNote, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JL_from, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_from, 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.BASELINE)
                    .addComponent(JL_to, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_to, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(JP_mainLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JL_subject, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_subject, 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.BASELINE)
                    .addComponent(JL_attachment, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTF_attachment, javax.swing.GroupLayout.PREFERRED_SIZE, 19, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(JSP_text, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(JP_buttons, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        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.Alignment.TRAILING, 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, 415, Short.MAX_VALUE)
        );

        getAccessibleContext().setAccessibleName("");

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

    private void JB_clientActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_clientActionPerformed
        JB_client_actionPerformed(evt);
    }//GEN-LAST:event_JB_clientActionPerformed
    protected void JB_client_actionPerformed(java.awt.event.ActionEvent evt) {

    }
    private void JBProject_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBProject_ActionPerformed
        JBProject_actionPerformed(evt);
    }//GEN-LAST:event_JBProject_ActionPerformed

    private void JBRun_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBRun_ActionPerformed
        JBRun_actionPerformed(evt);
    }//GEN-LAST:event_JBRun_ActionPerformed

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

    private void JBSend_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBSend_ActionPerformed
        JBSend_actionPerformed(evt);
    }//GEN-LAST:event_JBSend_ActionPerformed

    /**  
     * This method is called when a "Attach Project" button on the "Email GUI Screen"  
     * is clicked to attach the bugs encountered in the project during the execution.
     * @param evt This event generated when the "Attach" button on the "Email" GUI 
     * is pressed.
     */
    public void JBProject_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when a "Attach RUN" button on the "Email GUI Screen"  
     * is clicked to attach the bugs encountered in the specific run of a project
     * during the execution.
     * @param evt This event generated when the "Attach Run" button on the "Email" GUI 
     * is pressed.
     */
    public void JBRun_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when the "Cancel" button on the "Email GUI Screen"  
     * is clicked to discard any changes made and close the frame.
     * @param evt This event generated when the "Cancel" button on the "Email" GUI 
     * is pressed.
     */
    public void JBCancel_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when the user intends to send the email to the recipient
     * by pressing the "Send" labeled button on the "Email GUI screen. 
     * @param evt This event generated when the "Send" button on the "Email" GUI 
     * is pressed.
     */
    public void JBSend_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /** 
     * This method is called when the email frame 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
        exit_form(evt);
    }//GEN-LAST:event_exitForm

    protected void exit_form(java.awt.event.WindowEvent evt) {
        this.dispose();
    }

    /**
     * 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[]) {
        javax.swing.JFrame jf = new javax.swing.JFrame("test");
        jf.setVisible(true);
        Email_n e = new Email_n();
        //System.out.println("E_m: " + e);
        e.setVisible(true);
        e.invalidate();
        e.repaint();
        e.setVisible(true);
        //System.out.println("E_m: " + e);
        //System.out.println("Email_n: Inside main after Email_n.setVisible(true)");
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton JB_Project;
    public javax.swing.JButton JB_Run;
    public javax.swing.JButton JB_cancel;
    protected javax.swing.JButton JB_client;
    public javax.swing.JButton JB_send;
    protected javax.swing.JLabel JL_attachment;
    protected javax.swing.JLabel JL_clientNote;
    protected javax.swing.JLabel JL_from;
    public javax.swing.JLabel JL_header;
    protected javax.swing.JLabel JL_subject;
    protected javax.swing.JLabel JL_to;
    public javax.swing.JPanel JP_buttons;
    protected javax.swing.JPanel JP_main;
    public javax.swing.JScrollPane JSP_text;
    public javax.swing.JTextArea JTA_text;
    public javax.swing.JTextField JTF_attachment;
    public javax.swing.JTextField JTF_from;
    public javax.swing.JTextField JTF_subject;
    public javax.swing.JTextField JTF_to;
    // End of variables declaration//GEN-END:variables

}
