/*
 * OperationDlg_n.java
 *
 * Created on February 3, 2004, 5:16 PM
 */
package usda.weru.mcrew.gui;

/**
 * This class builds the GUI that holds all the components to make the operation data 
 * visible in different screens categorized in various segments as determined by the
 * designer.
 * @author manmohan
 */
public class OperationDlg_n extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    /**
     * Default constructor for the operation dialog GUI object.
     */
    public OperationDlg_n() {
        //this((Frame)null);
        super();
        initComponents();
    }

    /**
     * Single argument constructor for the operation dialog GUI object.
     * @param parent The address of the parent component in which this frame sits.
     */
    public OperationDlg_n(java.awt.Frame parent) {
        super(parent);
        initComponents();
    }

    /**
     * Single argument constructor for the operation dialog GUI object.
     * @param sTitle The title of the frame in which the operation dialog sits.
     */
    public OperationDlg_n(java.lang.String sTitle) {
        this();
        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.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        JP_main = new javax.swing.JPanel();
        JP_operDetails = new javax.swing.JPanel();
        JSP_list = new javax.swing.JScrollPane();
        JL_Date = new javax.swing.JLabel();
        JLabel1 = new javax.swing.JLabel();
        JTF_date = new javax.swing.JTextField();
        JP_toolbar = new javax.swing.JPanel();
        JTB_main = new javax.swing.JToolBar();
        JB_saveAs = new javax.swing.JButton();
        JB_help = new javax.swing.JButton();
        JB_cancel = new javax.swing.JButton();
        JB_close = new javax.swing.JButton();
        JP_upper = new javax.swing.JPanel();
        JP_upperParams = new javax.swing.JPanel();
        JL_OperationParams = new javax.swing.JLabel();
        JL_OperationAction = new javax.swing.JLabel();
        JSP_upperParam = new javax.swing.JScrollPane();
        JP_middle = new javax.swing.JPanel();
        JSP_middleParam = new javax.swing.JScrollPane();
        JP_middleParam = new javax.swing.JPanel();
        JL_middlePanel = new javax.swing.JLabel();
        JP_lower = new javax.swing.JPanel();
        JSP_lowerParam = new javax.swing.JScrollPane();
        JP_lowerParam = new javax.swing.JPanel();
        JL_lowerPanel = new javax.swing.JLabel();
        JP_operationName = new javax.swing.JPanel();
        operationNameLabel = new javax.swing.JLabel();
        JTF_operationName = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("Operation Drill-down: Display operation, group and process parameters");
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                OperationDlgN_ComponentResized(evt);
            }
        });
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });
        getContentPane().setLayout(null);

        JP_main.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JP_main.setLayout(null);

        JP_operDetails.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JP_operDetails.setToolTipText("OpnDrill:opndetails");
        JP_operDetails.setLayout(null);

        JSP_list.setToolTipText("OpnDrill:opnGrpProcessesList");
        JSP_list.setViewportBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JP_operDetails.add(JSP_list);
        JSP_list.setBounds(5, 55, 235, 395);

        JL_Date.setText("Date :");
        JL_Date.setToolTipText("OpnDrill:opndate");
        JP_operDetails.add(JL_Date);
        JL_Date.setBounds(5, 5, 40, 20);

        JLabel1.setText("Groups and Processes List :");
        JLabel1.setToolTipText("OpnDrill:opnGrpProcessesList");
        JP_operDetails.add(JLabel1);
        JLabel1.setBounds(5, 30, 230, 20);

        JTF_date.setEditable(false);
        JTF_date.setText("Date");
        JTF_date.setToolTipText("OpnDrill:opndate");
        JP_operDetails.add(JTF_date);
        JTF_date.setBounds(48, 5, 185, 20);

        JP_main.add(JP_operDetails);
        JP_operDetails.setBounds(5, 80, 250, 460);

        JP_toolbar.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JP_toolbar.setToolTipText("Weps:toolbar");
        JP_toolbar.setLayout(null);

        JTB_main.setBorder(null);
        JTB_main.setToolTipText("Weps:toolbar");

        JB_saveAs.setFont(new java.awt.Font("MS Sans Serif", 1, 11)); // NOI18N
        JB_saveAs.setIcon(new javax.swing.ImageIcon(getClass().getResource("/usda/weru/resources/save.gif"))); // NOI18N
        JB_saveAs.setToolTipText("OpnDrill:save");
        JB_saveAs.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_saveAs_ActionPerformed(evt);
            }
        });
        JTB_main.add(JB_saveAs);

        JB_help.setIcon(new javax.swing.ImageIcon(getClass().getResource("/usda/weru/resources/help.gif"))); // NOI18N
        JB_help.setToolTipText("Toolbar:popuphelp");
        JB_help.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBHelp_ActionPerformed(evt);
            }
        });
        JTB_main.add(JB_help);

        JB_cancel.setFont(new java.awt.Font("MS Sans Serif", 1, 11));
        JB_cancel.setText("Cancel");
        JB_cancel.setToolTipText("OpnDrill:cancel");
        JB_cancel.setMaximumSize(new java.awt.Dimension(50, 30));
        JB_cancel.setMinimumSize(new java.awt.Dimension(50, 30));
        JB_cancel.setPreferredSize(new java.awt.Dimension(50, 30));
        JB_cancel.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JB_cancel_ActionPerformed(evt);
            }
        });
        JTB_main.add(JB_cancel);

        JB_close.setFont(new java.awt.Font("MS Sans Serif", 1, 11)); // NOI18N
        JB_close.setIcon(new javax.swing.ImageIcon(getClass().getResource("/usda/weru/resources/close.gif"))); // NOI18N
        JB_close.setToolTipText("OpnDrill:close");
        JB_close.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JBClose_ActionPerformed(evt);
            }
        });
        JTB_main.add(JB_close);

        JP_toolbar.add(JTB_main);
        JTB_main.setBounds(5, 5, 250, 30);

        JP_main.add(JP_toolbar);
        JP_toolbar.setBounds(5, 5, 780, 40);

        JP_upper.setToolTipText("OpnDrill:opnparameters");
        JP_upper.setLayout(null);

        JP_upperParams.setToolTipText("OpnDrill:opnparameters");
        JP_upperParams.setLayout(null);

        JL_OperationParams.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_OperationParams.setText("Operation Parameters :");
        JL_OperationParams.setToolTipText("OpnDrill:opnparameters");
        JP_upperParams.add(JL_OperationParams);
        JL_OperationParams.setBounds(0, 0, 145, 20);

        JL_OperationAction.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_OperationAction.setText("No Action");
        JL_OperationAction.setToolTipText("OpnDrill:opnparameters");
        JP_upperParams.add(JL_OperationAction);
        JL_OperationAction.setBounds(155, 0, 350, 20);

        JP_upper.add(JP_upperParams);
        JP_upperParams.setBounds(5, 0, 510, 20);

        JSP_upperParam.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JSP_upperParam.setToolTipText("OpnDrill:opnparameters");
        JP_upper.add(JSP_upperParam);
        JSP_upperParam.setBounds(5, 22, 510, 120);

        JP_main.add(JP_upper);
        JP_upper.setBounds(265, 80, 520, 150);

        JP_middle.setToolTipText("OpnDrill:selparameters");
        JP_middle.setLayout(null);

        JSP_middleParam.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JSP_middleParam.setToolTipText("OpnDrill:selparameters");
        JP_middle.add(JSP_middleParam);
        JSP_middleParam.setBounds(5, 30, 510, 115);

        JP_middleParam.setToolTipText("OpnDrill:selparameters");
        JP_middleParam.setLayout(null);

        JL_middlePanel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_middlePanel.setText("Selection Parameters :");
        JL_middlePanel.setToolTipText("OpnDrill:selparameters");
        JL_middlePanel.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        JP_middleParam.add(JL_middlePanel);
        JL_middlePanel.setBounds(0, 2, 505, 20);

        JP_middle.add(JP_middleParam);
        JP_middleParam.setBounds(5, 5, 507, 20);

        JP_main.add(JP_middle);
        JP_middle.setBounds(265, 235, 520, 150);

        JP_lower.setToolTipText("OpnDrill:addnparameters");
        JP_lower.setLayout(null);

        JSP_lowerParam.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
        JSP_lowerParam.setToolTipText("OpnDrill:addnparameters");
        JP_lower.add(JSP_lowerParam);
        JSP_lowerParam.setBounds(5, 26, 510, 120);

        JP_lowerParam.setToolTipText("OpnDrill:addnparameters");
        JP_lowerParam.setLayout(null);

        JL_lowerPanel.setText("Additional Parameters :");
        JL_lowerPanel.setToolTipText("OpnDrill:addnparameters");
        JP_lowerParam.add(JL_lowerPanel);
        JL_lowerPanel.setBounds(0, 2, 505, 20);

        JP_lower.add(JP_lowerParam);
        JP_lowerParam.setBounds(5, 3, 507, 20);

        JP_main.add(JP_lower);
        JP_lower.setBounds(265, 390, 520, 150);

        JP_operationName.setToolTipText("OpnDrill:opnname");
        JP_operationName.setLayout(null);

        operationNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        operationNameLabel.setText("Operation Name :");
        operationNameLabel.setToolTipText("OpnDrill:opnname");
        operationNameLabel.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        JP_operationName.add(operationNameLabel);
        operationNameLabel.setBounds(5, 2, 98, 20);
        operationNameLabel.getAccessibleContext().setAccessibleName("Operation Name:");

        JTF_operationName.setEditable(false);
        JTF_operationName.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_operationName.setText("Operation Name");
        JTF_operationName.setToolTipText("OpnDrill:opnname");
        JP_operationName.add(JTF_operationName);
        JTF_operationName.setBounds(105, 2, 670, 20);

        JP_main.add(JP_operationName);
        JP_operationName.setBounds(5, 50, 780, 25);

        getContentPane().add(JP_main);
        JP_main.setBounds(5, 5, 800, 550);

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-820)/2, (screenSize.height-600)/2, 820, 600);
    }// </editor-fold>//GEN-END:initComponents

    private void JBClose_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBClose_ActionPerformed
        JBClose_actionPerformed(evt);
    }//GEN-LAST:event_JBClose_ActionPerformed

    private void JBHelp_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JBHelp_ActionPerformed
        JBHelp_actionPerformed(evt);
    }//GEN-LAST:event_JBHelp_ActionPerformed

    private void OperationDlgN_ComponentResized(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_OperationDlgN_ComponentResized
        OperationDlgN_componentResized(evt);

    }//GEN-LAST:event_OperationDlgN_ComponentResized

    private void JB_saveAs_ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JB_saveAs_ActionPerformed
        SaveAsButton_actionPerformed(evt);
}//GEN-LAST:event_JB_saveAs_ActionPerformed

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

    /**  
     * This method is called when a SaveAs button on the Operation dialog is pressed
     * so that the data could be saved in a new file.
     * @param evt The event generated when the SaveAs button is pressed.
     */
    public void SaveAsButton_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when a cancel button on the Operation dialog is pressed
     * and any modifications to the data on the screen need not be saved.
     * @param evt The event generated when the cancel button is pressed.
     */
    public void CancelButton_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when the screen is resized and the components sitting 
     * in the container are to be re-arranged so they are sitting correctly adjecent
     * to each other and evenly spaced.
     * @param evt The event generated when the frame is resized.
     */
    public void OperationDlgN_componentResized(java.awt.event.ComponentEvent evt) {
    }

    /**  
     * This method is called when the operation dialog is to be closed by hitting the 
     * close button in the tool bar.
     * @param evt The event generated when the cancel button is pressed.
     */
    public void JBClose_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /**  
     * This method is called when help button from tool bar on the JDialog is pressed
     * for any help related to the operation dialog components are needed.
     * @param evt The event generated when the help button is pressed.
     */
    public void JBHelp_actionPerformed(java.awt.event.ActionEvent evt) {
    }

    /** 
     * This method is called when the operation dialog is to be closed by hitting the 
     * "Red X" button of the window.
     * @param evt The event generated when the " Red X " button on the window is hit. 
     */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog
        closeWindow_actionPerformed(evt);
    }//GEN-LAST:event_closeDialog

    /**  
     * This method is called when the operation dialog is to be closed by hitting the 
     * "Red X" button of the window.
     * @param evt The event generated when the cancel button is pressed.
     */
    public void closeWindow_actionPerformed(java.awt.event.WindowEvent evt) {
        //Actual Implementation in the classes that inherit this class
    }

    /**
     * This method is used if this dialog is rum as an independent application.
     * @param args These are the command line arguments passed to themain method.
     */
    public static void main(String args[]) {
        new OperationDlg_n(new javax.swing.JFrame()).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() {
        //Dimension size = getSize();
        super.addNotify();

        /* if (frameSizeAdjusted)
         return;
         frameSizeAdjusted = true;

         // Adjust size of frame according to the insets
         Insets insets = getInsets();
         setSize(insets.left + insets.right + size.width, insets.top + insets.bottom + size.height);*/
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.JButton JB_cancel;
    public javax.swing.JButton JB_close;
    public javax.swing.JButton JB_help;
    public javax.swing.JButton JB_saveAs;
    public javax.swing.JLabel JL_Date;
    public javax.swing.JLabel JL_OperationAction;
    public javax.swing.JLabel JL_OperationParams;
    public javax.swing.JLabel JL_lowerPanel;
    public javax.swing.JLabel JL_middlePanel;
    public javax.swing.JLabel JLabel1;
    public javax.swing.JPanel JP_lower;
    public javax.swing.JPanel JP_lowerParam;
    public javax.swing.JPanel JP_main;
    public javax.swing.JPanel JP_middle;
    public javax.swing.JPanel JP_middleParam;
    public javax.swing.JPanel JP_operDetails;
    public javax.swing.JPanel JP_operationName;
    public javax.swing.JPanel JP_toolbar;
    public javax.swing.JPanel JP_upper;
    public javax.swing.JPanel JP_upperParams;
    public javax.swing.JScrollPane JSP_list;
    public javax.swing.JScrollPane JSP_lowerParam;
    public javax.swing.JScrollPane JSP_middleParam;
    public javax.swing.JScrollPane JSP_upperParam;
    public javax.swing.JToolBar JTB_main;
    public javax.swing.JTextField JTF_date;
    public javax.swing.JTextField JTF_operationName;
    public javax.swing.JLabel operationNameLabel;
    // End of variables declaration//GEN-END:variables
    boolean frameSizeAdjusted = false;

}
