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 ihaas
 */
public class UpgmDlg_n extends javax.swing.JDialog {

    private static final long serialVersionUID = 1L;

    /**
     * Default constructor for the operation dialog GUI object.
     */
    public UpgmDlg_n() {
        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 UpgmDlg_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 UpgmDlg_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">                          
    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();
        upgmNameLabel = new javax.swing.JLabel();
        JTF_upgmName = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
        setTitle("UPGM Drill-down: Display UPGM process parameters");
        addComponentListener(new java.awt.event.ComponentAdapter() {
            public void componentResized(java.awt.event.ComponentEvent evt) {
                UpgmDlgN_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("UPGMDrill:opndetails");
        JP_operDetails.setLayout(null);

        JSP_list.setToolTipText("UPGMDrill: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("UPGMDrill:upgmdate");
        JP_operDetails.add(JL_Date);
        JL_Date.setBounds(5, 5, 40, 20);

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

        JTF_date.setEditable(false);
        JTF_date.setText("Date");
        JTF_date.setToolTipText("UPGMDrill:upgmdate");
        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("UPGMDrill: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("SansSerif", 1, 10)); // NOI18N
        JB_cancel.setText("Cancel");
        JB_cancel.setToolTipText("UPGMDrill: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("UPGMDrill: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("UPGM 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("UPGMDrill:selparameters");
        JP_middle.setLayout(null);

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

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

        JL_middlePanel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        JL_middlePanel.setText("Selection Parameters :");
        JL_middlePanel.setToolTipText("UPGMDrill: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, 80, 520, 350);//-ihaas-

        JP_operationName.setToolTipText("UPGMDrill:upgmname");
        JP_operationName.setLayout(null);

        upgmNameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        upgmNameLabel.setText("UPGM Name :");
        upgmNameLabel.setToolTipText("UPGMDrill:upgmname");
        upgmNameLabel.setHorizontalTextPosition(javax.swing.SwingConstants.LEFT);
        JP_operationName.add(upgmNameLabel);
        upgmNameLabel.setBounds(5, 2, 98, 20);
        upgmNameLabel.getAccessibleContext().setAccessibleName("UPGM Name:");

        JTF_upgmName.setEditable(false);
        JTF_upgmName.setHorizontalAlignment(javax.swing.JTextField.LEFT);
        JTF_upgmName.setText("UPGM Name");
        JTF_upgmName.setToolTipText("UPGMDrill:upgmname");
        JP_operationName.add(JTF_upgmName);
        JTF_upgmName.setBounds(105, 2, 670, 27);

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

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

        setSize(new java.awt.Dimension(820, 600));
        setLocationRelativeTo(null);
    }// </editor-fold>                        

    private void JBClose_ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        JBClose_actionPerformed(evt);
    }                                        

    private void JBHelp_ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        JBHelp_actionPerformed(evt);
    }                                       

    private void UpgmDlgN_ComponentResized(java.awt.event.ComponentEvent evt) {                                                
        UpgmDlgN_componentResized(evt);

    }                                               

    private void JB_saveAs_ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        SaveAsButton_actionPerformed(evt);
}                                          

    private void JB_cancel_ActionPerformed(java.awt.event.ActionEvent evt) {                                           
        CancelButton_actionPerformed(evt);
}                                          

    /**  
     * 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 UpgmDlgN_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) {                             
        closeWindow_actionPerformed(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 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 UpgmDlg_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                     
    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_middlePanel;
    public javax.swing.JLabel JLabel1;
    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.JScrollPane JSP_list;
    public javax.swing.JScrollPane JSP_middleParam;
    public javax.swing.JToolBar JTB_main;
    public javax.swing.JTextField JTF_date;
    public javax.swing.JTextField JTF_upgmName;
    public javax.swing.JLabel upgmNameLabel;
    // End of variables declaration                   
    boolean frameSizeAdjusted = false;

}
